/* ==========================================================================
   Swiss-Grid Architectural Design System — inspired by motiuexpert.ro
   Palette: Pale Lavender Canvas (#fbf9fc), Deep Indigo Ink (#171326),
   Royal Plum (#4d286b / #32164d), Muted Lavender (#8964a7),
   Champagne Gold (#d6b77b), Hairline Borders (#d8cbe3).
   ========================================================================== */

:root {
  --bg: #fbf9fc;
  --surface: #ffffff;
  --lav-soft: #f4eff9;
  --lav-mid: #e9def2;
  --ink: #171326;
  --muted: #5b5468;
  --plum: #4d286b;
  --plum-dark: #32164d;
  --lav: #8964a7;
  --gold: #d6b77b;
  --gold-bg: #fcf8ef;
  --line: #d8cbe3;
  --danger: #9e2a3b;
  --danger-bg: #fdf2f4;
  --ok: #1f6e4a;
  --ok-bg: #eef8f3;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

html.cui-sheet-open,
html.cui-sheet-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, a, input, select, textarea, label {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(77, 40, 107, 0.12);
}

img {
  max-width: 100%;
}

/* Continuous Architectural Frame */
.frame {
  max-width: 1240px;
  margin: 0 auto;
  background: var(--bg);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 100vh;
}

@media (max-width: 1240px) {
  .frame {
    border-left: none;
    border-right: none;
  }
}

/* Header & Navigation — flush full-height architectural strip */
.site-header {
  height: 82px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 36px;
  text-decoration: none;
  color: var(--ink);
}

.brand-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
}

.brand-bars span {
  display: block;
  width: 6px;
  background: var(--plum);
}

.brand-bars span:nth-child(1) {
  height: 15px;
  background: rgba(137, 100, 167, 0.55);
  clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 100%);
}

.brand-bars span:nth-child(2) {
  height: 28px;
  background: var(--plum);
  clip-path: polygon(0 0, 100% 12%, 100% 100%, 0 100%);
}

.brand-bars span:nth-child(3) {
  height: 21px;
  background: rgba(137, 100, 167, 0.85);
  clip-path: polygon(0 0, 100% 18%, 100% 100%, 0 100%);
}

.brand-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-wordmark strong {
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--plum);
}

.brand-wordmark small {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.header-nav {
  display: flex;
  align-items: stretch;
}

.header-nav a,
.header-nav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  border: none;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.header-nav a:hover,
.header-nav button:hover {
  background: var(--surface);
  color: var(--plum-dark);
}

.header-nav a.cta-cell,
.header-nav button.cta-cell {
  background: var(--plum);
  color: #ffffff;
  border-left-color: var(--plum);
}

.header-nav a.cta-cell:hover,
.header-nav button.cta-cell:hover {
  background: var(--plum-dark);
}

@media (max-width: 780px) {
  .site-header { height: 68px; }
  .brand-lockup { padding: 0 18px; }
  .header-nav a, .header-nav button { padding: 0 14px; font-size: 11.5px; }
  .hide-mobile { display: none !important; }
}

/* Hero Section — Asymmetric 2-column with Blueprint Grid & Ruler */
.hero {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  border-bottom: 1px solid var(--line);
}

.hero-left {
  position: relative;
  padding: 58px 40px 56px;
  border-right: 1px solid var(--line);
  overflow: hidden;
  background-color: var(--bg);
}

/* Blueprint 40px subtle grid */
.hero-left::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(77, 40, 107, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(77, 40, 107, 0.07) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(125deg, transparent 18%, #000 85%);
  -webkit-mask-image: linear-gradient(125deg, transparent 18%, #000 85%);
  pointer-events: none;
}

/* Bottom architectural ruler ticks */
.hero-left::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  background-image:
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(to right, var(--lav) 0 1px, transparent 1px 50px);
  background-size: 100% 6px, 100% 12px;
  background-position: bottom left;
  background-repeat: no-repeat;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.mono-kicker {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mono-kicker b {
  color: var(--plum);
  font-weight: 500;
}

.hero h1 {
  margin: 16px 0 18px;
  font-weight: 300;
  font-size: clamp(34px, 4.3vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.hero h1 em {
  display: block;
  font-style: normal;
  font-weight: 600;
  color: var(--plum);
}

.hero-lead {
  margin: 0;
  max-width: 560px;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
}

.hero-note {
  margin-top: 22px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  font-size: 13.5px;
  color: var(--muted);
}

.hero-note strong {
  color: var(--ink);
}

.hero-right {
  background: linear-gradient(180deg, var(--lav-soft) 0%, var(--lav-mid) 100%);
  padding: 36px 36px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 360px;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 16px;
}

.hero-stat-cell {
  padding: 18px 10px 16px 0;
}

.hero-stat-cell + .hero-stat-cell {
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.hero-stat-num {
  font-weight: 300;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.hero-stat-num sup {
  color: var(--plum);
  font-size: 0.45em;
  font-weight: 600;
}

.hero-stat-lbl {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Three slanted architectural bars from motiuexpert.ro */
.monoliths {
  display: grid;
  grid-template-columns: 1fr 1.08fr 1fr;
  gap: 14px;
  align-items: end;
  height: 150px;
  margin-top: 28px;
}

.monoliths span:nth-child(1) {
  height: 55%;
  background: rgba(137, 100, 167, 0.52);
  clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 100%);
}

.monoliths span:nth-child(2) {
  height: 100%;
  background: var(--plum);
  clip-path: polygon(0 0, 100% 12%, 100% 100%, 0 100%);
}

.monoliths span:nth-child(3) {
  height: 76%;
  background: rgba(137, 100, 167, 0.78);
  clip-path: polygon(0 0, 100% 16%, 100% 100%, 0 100%);
}

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; }
  .hero-left { border-right: none; border-bottom: 1px solid var(--line); padding: 36px 20px 42px; }
  .hero-right { padding: 28px 20px 0; min-height: 260px; }
}

/* Section blocks separated by 1px architectural hairlines */
.section-block {
  border-bottom: 1px solid var(--line);
  padding: 40px;
  background: var(--bg);
}

.section-block.alt {
  background: var(--surface);
}

@media (max-width: 780px) {
  .section-block { padding: 26px 18px; }
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 22px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.section-title {
  margin: 6px 0 0;
  font-weight: 300;
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.section-sub {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Grids & Form Inputs */
.grid { display: grid; gap: 18px; align-items: end; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-tight { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }

@media (max-width: 800px) {
  .grid-2, .grid-3, .grid-4, .grid-2-tight { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.req {
  color: var(--plum);
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 0;
  background-color: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.4;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.field select.cselect-native {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}

/* Custom Architectural Dropdown */
.cselect {
  position: relative;
  width: 100%;
}

.cselect-trigger {
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.cselect-value {
  flex: 1;
  padding: 11px 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cselect-caret {
  width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--line);
  color: var(--plum);
  background: var(--bg);
  transition: background-color 0.15s, color 0.15s, transform 0.18s;
}

.cselect-caret svg {
  transition: transform 0.18s ease;
}

.cselect-trigger:hover {
  border-color: var(--lav);
}

.cselect-trigger:hover .cselect-caret {
  background: var(--lav-soft);
}

.cselect-trigger:focus,
.cselect.open .cselect-trigger {
  outline: none;
  border-color: var(--plum);
  box-shadow: inset 0 -2px 0 0 var(--gold);
}

.cselect.open .cselect-caret {
  background: var(--plum);
  color: #ffffff;
  border-left-color: var(--plum);
}

.cselect.open .cselect-caret svg {
  transform: rotate(180deg);
}

.cselect-menu {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--plum);
  border-top: 2px solid var(--gold);
  box-shadow: 0 12px 28px rgba(23, 19, 38, 0.14);
}

.cselect.open-up .cselect-menu {
  top: auto;
  bottom: calc(100% + 2px);
  border-top: 1px solid var(--plum);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 -10px 26px rgba(23, 19, 38, 0.14);
}

.cselect-sheet-head {
  display: none;
}

.cselect-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(23, 19, 38, 0.54);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.cselect-wide .cselect-menu {
  min-width: 340px;
}

@media (max-width: 640px) {
  .cselect-wide .cselect-menu {
    min-width: 100%;
  }
}

.cselect.open .cselect-menu {
  display: block;
}

.cselect.is-sheet.open .cselect-menu {
  position: fixed;
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  min-width: 0;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  max-height: 78dvh;
  z-index: 120;
  display: flex;
  flex-direction: column;
  border: none;
  border-top: 3px solid var(--plum);
  box-shadow: 0 -12px 36px rgba(23, 19, 38, 0.28);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.cselect.is-sheet .cselect-sheet-head,
.cdate.is-sheet .cselect-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.cselect-sheet-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--plum);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cselect-sheet-close {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cselect-sheet-close:active {
  background: var(--lav-soft);
  border-color: var(--plum);
}

.cselect-options {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.cselect.is-sheet .cselect-options {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.cselect-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--lav-soft);
}

.cselect-search {
  width: 100%;
  padding: 8px 10px !important;
  border: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  font-family: var(--sans);
  font-size: 13.5px !important;
}

.cselect-search:focus {
  outline: none;
  border-color: var(--plum) !important;
  box-shadow: inset 0 -2px 0 0 var(--gold) !important;
}

.cselect-empty {
  padding: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.cselect-value.is-placeholder {
  color: var(--muted);
}

.cselect.is-disabled .cselect-trigger {
  background: var(--bg);
  color: var(--muted);
  border-style: dashed;
  cursor: not-allowed;
  opacity: 0.72;
}

.cselect.is-disabled .cselect-caret {
  color: var(--muted);
  background: var(--bg);
}

.cselect-opt-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cselect-opt-desc {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  font-weight: 400;
}

.cselect-option.has-desc {
  align-items: flex-start;
  padding: 11px 14px;
}

/* Searchable Combobox (Localitate — suggestions + free plain text) */
.ccombo-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ccombo-row:focus-within,
.ccombo.open .ccombo-row {
  border-color: var(--plum);
  box-shadow: inset 0 -2px 0 0 var(--gold);
}

.ccombo-row input {
  flex: 1;
  min-width: 0;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.ccombo-caret {
  border: none;
  border-left: 1px solid var(--line);
  cursor: pointer;
}

.ccombo.open .ccombo-caret {
  background: var(--plum);
  color: #ffffff;
  border-left-color: var(--plum);
}

.ccombo.open .ccombo-caret svg {
  transform: rotate(180deg);
}

.cselect-option.kb-active {
  background: var(--lav-soft);
  color: var(--plum-dark);
  box-shadow: inset 3px 0 0 var(--plum);
}

.ccombo-sheet-search-wrap {
  display: none;
}

.ccombo.is-sheet .ccombo-sheet-search-wrap {
  display: block;
}

.cselect-option.ccombo-custom {
  background: var(--gold-bg);
  border-top: 1px solid var(--gold);
}

/* Architectural Romanian Date Picker */
.cdate-popover {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  width: 296px;
  max-width: calc(100vw - 32px);
  z-index: 70;
  background: var(--surface);
  border: 1px solid var(--plum);
  border-top: 2px solid var(--gold);
  box-shadow: 0 14px 32px rgba(23, 19, 38, 0.16);
}

.cdate.open-up .cdate-popover {
  top: auto;
  bottom: calc(100% + 2px);
  border-top: 1px solid var(--plum);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 -12px 28px rgba(23, 19, 38, 0.16);
}

.cdate.open .cdate-popover {
  display: block;
}

.cdate.is-sheet.open .cdate-popover {
  position: fixed;
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  z-index: 120;
  border: none;
  border-top: 3px solid var(--plum);
  box-shadow: 0 -12px 36px rgba(23, 19, 38, 0.28);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.cdate.is-sheet .cdate-nav {
  width: 38px;
  height: 38px;
  font-size: 16px;
}

.cdate.is-sheet .cdate-day {
  height: 44px;
  font-size: 15px;
}

.cdate.is-sheet .cdate-foot {
  padding: 10px 14px 14px;
}

.cdate.is-sheet .cdate-foot-btn {
  padding: 10px 14px;
  font-size: 12px;
  min-height: 40px;
}

.cdate.open .ccombo-row {
  border-color: var(--plum);
  box-shadow: inset 0 -2px 0 0 var(--gold);
}

.cdate.open .ccombo-caret {
  background: var(--plum);
  color: #ffffff;
  border-left-color: var(--plum);
}

.cdate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px;
  background: var(--lav-soft);
  border-bottom: 1px solid var(--line);
}

.cdate-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--plum);
}

.cdate-nav-group {
  display: inline-flex;
  gap: 3px;
}

.cdate-nav {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s;
}

.cdate-nav:hover {
  background: var(--plum);
  color: #ffffff;
  border-color: var(--plum);
}

.cdate-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 8px 10px 4px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
}

.cdate-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 4px 10px 10px;
}

.cdate-day {
  height: 34px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s;
}

.cdate-day:hover {
  background: var(--lav-soft);
  color: var(--plum-dark);
  border-color: var(--line);
}

.cdate-day.today {
  border-color: var(--gold);
  background: var(--gold-bg);
  font-weight: 600;
}

.cdate-day.selected {
  background: var(--plum);
  color: #ffffff;
  font-weight: 600;
  border-color: var(--plum);
  box-shadow: inset 0 -2px 0 0 var(--gold);
}

.cdate-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.cdate-foot-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cdate-foot-btn {
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--plum);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.cdate-foot-muted {
  color: var(--muted);
}

@media (hover: hover) and (pointer: fine) {
  .cdate-foot-btn:hover {
    background: var(--plum);
    color: #ffffff;
    border-color: var(--plum);
  }
}

.cdate-foot-btn:active {
  background: var(--plum);
  color: #ffffff;
  border-color: var(--plum);
}

.cselect-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border: none;
  border-bottom: 1px solid #efe9f5;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s, box-shadow 0.12s;
}

.cselect-option:last-child {
  border-bottom: none;
}

@media (hover: hover) and (pointer: fine) {
  .cselect-option:hover:not(.disabled) {
    background: var(--lav-soft);
    color: var(--plum-dark);
    box-shadow: inset 3px 0 0 var(--plum);
  }
}

.cselect-option:active:not(.disabled) {
  background: var(--lav-soft);
  color: var(--plum-dark);
}

.cselect.is-sheet .cselect-option {
  min-height: 50px;
  padding: 13px 16px;
  font-size: 16px;
}

.cselect.is-sheet .cselect-opt-desc {
  font-size: 13px;
}

.cselect.is-sheet .cselect-search-wrap {
  padding: 10px 14px;
  flex-shrink: 0;
}

.cselect-option.selected {
  background: var(--gold-bg);
  color: var(--plum);
  font-weight: 600;
}

.cselect-option.disabled {
  background: #f7f5fa;
  color: #9b93a8;
  cursor: not-allowed;
}

.cselect-opt-label {
  flex: 1;
}

.cselect-opt-hint {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.cselect-option.disabled .cselect-opt-hint {
  color: #9b93a8;
}

.cselect-option.selected::after {
  content: "✓";
  font-family: var(--mono);
  font-size: 12px;
  color: var(--plum);
}

.field input:disabled,
.field textarea:disabled {
  background-color: var(--bg);
  color: var(--muted);
  border-style: dashed;
  border-color: var(--line);
  cursor: not-allowed;
  opacity: 0.72;
}

.field.is-disabled label {
  opacity: 0.65;
}

/* Segmented toggle (Persoană Juridică / Persoană Fizică) */
.type-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  background: var(--bg);
}

.type-toggle button {
  padding: 9px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.type-toggle button + button {
  border-left: 1px solid var(--line);
}

.type-toggle button.active {
  background: var(--plum);
  color: #ffffff;
  box-shadow: inset 0 -2px 0 0 var(--gold);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--plum);
  background-color: var(--surface);
  box-shadow: inset 0 -2px 0 0 var(--gold);
}

.buildings-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
  background: var(--lav-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
}

/* Local Draft Cache / Retry Recovery Bar */
.draft-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 40px;
  background: var(--lav-soft);
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--plum);
}

.draft-bar.pending-retry {
  background: var(--gold-bg);
  border-left-color: var(--gold);
  border-bottom-color: var(--gold);
}

.draft-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.prefill-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 40px;
  background: var(--gold-bg);
  border-bottom: 1px solid var(--gold);
  border-left: 4px solid var(--plum);
}

@media (max-width: 780px) {
  .draft-bar { padding: 14px 18px; }
  .prefill-bar { padding: 16px 18px; }
}

.field-hint {
  font-size: 12.5px;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-size: 13.5px;
}

/* Photo Guide Panel */
.guide-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--lav-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--plum);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.guide-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 22px;
  margin-bottom: 24px;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 820px) {
  .guide-layout { grid-template-columns: 1fr; }
}

.guide-img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  cursor: zoom-in;
  display: block;
}

.guide-rules ul {
  margin: 8px 0 18px;
  padding-left: 18px;
  font-size: 14px;
  color: var(--muted);
}

.guide-rules li { margin-bottom: 5px; }
.guide-rules strong { color: var(--ink); }

/* Building Block (zero border-radius, gold hover bar) */
.building-card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 24px;
  margin-bottom: 22px;
  transition: border-color 0.2s;
}

.building-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--plum);
}

.building-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.building-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.building-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  background: var(--plum);
  color: #fff;
  padding: 4px 10px;
}

.photos-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.photo-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  margin-top: 12px;
}

@media (max-width: 820px) {
  .photo-slots-grid { grid-template-columns: 1fr; }
}

.photo-slot {
  position: relative;
  padding: 18px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.18s;
}

.photo-slots-grid .photo-slot + .photo-slot {
  border-left: 1px solid var(--line);
}

@media (max-width: 820px) {
  .photo-slots-grid .photo-slot + .photo-slot {
    border-left: none;
    border-top: 1px solid var(--line);
  }
}

.photo-slot::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.photo-slot:hover {
  background: var(--surface);
}

.photo-slot:hover::after,
.photo-slot.has-file::after {
  transform: scaleX(1);
}

.photo-slot.has-file {
  background: var(--surface);
}

.photo-slot.has-file::after {
  background: var(--plum);
}

.photo-slot-extra {
  border: 1px solid var(--line);
  margin-top: 14px;
}

.photo-slot-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.photo-slot-tip {
  font-size: 13px;
  color: var(--muted);
  min-height: 40px;
  line-height: 1.45;
}

.photo-preview-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-thumb {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.photo-thumb-sm {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.file-input-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--surface);
  color: var(--plum);
  border: 1px solid var(--plum);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.file-input-btn:hover {
  background: var(--plum);
  color: #fff;
}

.file-input-btn input[type="file"] {
  display: none;
}

.file-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ok);
  word-break: break-word;
}

/* Signature pad */
.sig-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sig-auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--lav-soft);
  border: 1px solid var(--line);
  font-family: var(--sans) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--plum) !important;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.sig-auto-toggle:hover {
  border-color: var(--plum);
  background: var(--gold-bg);
}

.sig-auto-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--plum);
}

.sig-wrap {
  border: 1px solid var(--line);
  background: var(--surface);
}

#signatureCanvas {
  display: block;
  width: 100%;
  height: 140px;
  touch-action: none;
  cursor: crosshair;
}

.sig-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: var(--lav-soft);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--plum);
  margin-bottom: 14px;
  cursor: pointer;
  font-size: 14.5px;
}

.checkbox-row.optional {
  border-left-color: var(--gold);
  background: var(--bg);
}

.checkbox-row input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--plum);
}

.optional-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  background: var(--gold-bg);
  color: #7c5c1a;
  border: 1px solid var(--gold);
  vertical-align: middle;
}

.inline-link-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--plum);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
  cursor: pointer;
}

.inline-link-btn:hover {
  color: var(--plum-dark);
}

.gdpr-modal-card {
  width: 100%;
  max-width: 660px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--plum);
  padding: 26px 28px;
}

.gdpr-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.gdpr-modal-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.gdpr-modal-body strong {
  color: var(--ink);
}

.gdpr-modal-body ul {
  margin: 6px 0 14px;
  padding-left: 20px;
}

.gdpr-modal-body li {
  margin-bottom: 6px;
}

/* Buttons — Sharp Swiss geometry + gold underline accent */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 0;
  border: 1px solid transparent;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-plum {
  background: var(--plum);
  color: #ffffff;
  border-bottom: 2px solid var(--gold);
}

.btn-plum:hover:not(:disabled) {
  background: var(--plum-dark);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--plum);
  color: var(--plum);
}

.btn-danger-outline {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid #e7b8bf;
  padding: 6px 12px;
  font-size: 11.5px;
}

.btn-danger-outline:hover:not(:disabled) {
  background: var(--danger-bg);
}

.btn-sm { padding: 7px 14px; font-size: 11.5px; }
.btn-lg { padding: 15px 28px; font-size: 13.5px; width: 100%; }
.btn-full { width: 100%; }

/* Alerts */
.alert {
  padding: 14px 18px;
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-left: 3px solid var(--danger);
}

.alert-gold {
  background: var(--gold-bg);
  color: var(--ink);
  border-color: var(--gold);
  border-left: 3px solid var(--gold);
}

.alert-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-left: 3px solid var(--ok);
}

.hidden { display: none !important; }

/* Royal Plum Confirmation Banner (inspired by motiuexpert.ro .contact) */
.plum-banner {
  background: linear-gradient(110deg, #45235f, #583478);
  color: #ffffff;
  padding: 48px 40px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.plum-banner h2 {
  font-weight: 300;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.03em;
  margin: 10px 0 12px;
}

.ref-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 500;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom: 2px solid var(--gold);
  padding: 10px 24px;
  margin: 14px 0 18px;
  background: rgba(255, 255, 255, 0.06);
}

/* Auth / OAuth Panel */
.auth-panel {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--plum);
  padding: 34px;
}

.auth-heading {
  margin: 10px 0 6px;
  font-weight: 300;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.auth-heading em {
  font-style: normal;
  font-weight: 600;
  color: var(--plum);
}

.auth-lead {
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  margin-bottom: 22px;
}

.auth-tab {
  padding: 11px 14px;
  text-align: center;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--bg);
  border: none;
  cursor: pointer;
}

.auth-tab + .auth-tab {
  border-left: 1px solid var(--line);
}

.auth-tab.active {
  background: var(--plum);
  color: #ffffff;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.oauth-user-box {
  padding: 16px;
  background: var(--lav-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
}

/* Admin Dashboard Layout */
.toolbar-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 32px;
  background: var(--lav-soft);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.admin-split {
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: calc(100vh - 220px);
}

.admin-sidebar {
  border-right: 1px solid var(--line);
  padding: 20px;
  background: var(--bg);
}

.admin-detail {
  padding: 28px 34px;
  background: var(--surface);
}

@media (max-width: 960px) {
  .admin-split { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: none; border-bottom: 1px solid var(--line); }
  .admin-detail { padding: 22px 18px; }
  .toolbar-strip { padding: 14px 18px; }
}

.sub-item {
  border: 1px solid var(--line);
  padding: 13px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}

.sub-item:hover {
  border-color: var(--plum);
}

.sub-item.active {
  border-color: var(--plum);
  border-left: 3px solid var(--plum);
  background: var(--lav-soft);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
}

.badge-new { background: var(--lav-soft); color: var(--plum); border-color: var(--line); }
.badge-in_review { background: var(--gold-bg); color: #7c5c1a; border-color: var(--gold); }
.badge-opinion_uploaded { background: #f5eefb; color: #5b2e83; border-color: #c7a9df; }
.badge-opinion_sent { background: #e8f4f8; color: #155e75; border-color: #a5d8e6; }
.badge-report_uploaded { background: #ece4f6; color: var(--plum-dark); border-color: var(--lav); }
.badge-report_sent,
.badge-sent { background: var(--ok-bg); color: var(--ok); border-color: #b7dfc9; }
.badge-archived { background: #efedf3; color: var(--muted); border-color: var(--line); }

.table-wrap { overflow-x: auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border: 1px solid var(--line);
}

table.data-table th {
  background: var(--plum);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 10px 10px;
  white-space: nowrap;
}

table.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
}

.photo-card {
  border: 1px solid var(--line);
  background: var(--bg);
}

.photo-card img {
  width: 100%;
  height: 135px;
  object-fit: cover;
  display: block;
}

.photo-card-body {
  padding: 10px;
  font-size: 12px;
}

.code-box {
  background: #171326;
  color: #efe9f7;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12px;
  overflow-x: auto;
  white-space: pre;
  border-left: 3px solid var(--gold);
}

.mcp-drawer {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 24px 32px;
}

.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  margin-bottom: 8px;
  font-size: 13px;
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 40px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--bg);
}

@media (max-width: 780px) {
  .site-footer { padding: 20px 18px; }
}

/* Lightbox Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 19, 38, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-backdrop img {
  max-width: 94vw;
  max-height: 88dvh;
  border: 1px solid var(--gold);
}

.lightbox-close-btn {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 14px));
  right: 14px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gold);
  background: rgba(23, 19, 38, 0.92);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 102;
}

.form-error-wrap {
  padding: 20px 40px 0;
}

.draft-inline-status {
  margin-top: 12px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}

.draft-inline-discard {
  border: none;
  background: none;
  padding: 2px 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--plum);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.intake-url-code {
  word-break: break-all;
  overflow-wrap: anywhere;
}

.create-key-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.create-key-form input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
}

.admin-back-btn {
  display: none;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Mobile-First Optimizations (Zero iOS Zoom, Zero Jump, Thumb-Friendly UI)
   ========================================================================== */

@media (max-width: 820px), (pointer: coarse) {
  /* Prevent iOS Safari automatic focus-zoom on inputs (< 16px triggers zoom jump) */
  .field input,
  .field select,
  .field textarea,
  .cselect-trigger,
  .cselect-search,
  .create-key-form input {
    font-size: 16px !important;
  }

  .field input,
  .field textarea,
  .cselect-value {
    padding: 12px 13px;
  }

  .cselect-caret {
    width: 44px;
  }

  .cselect-search {
    padding: 10px 12px !important;
  }
}

@media (max-width: 960px) {
  .admin-back-btn {
    display: inline-flex;
    margin-bottom: 16px;
  }
}

@media (max-width: 780px) {
  html {
    scroll-padding-top: 76px;
  }

  .site-header {
    height: auto;
    min-height: 62px;
  }

  .brand-lockup {
    padding: 10px 14px;
    gap: 10px;
    min-width: 0;
  }

  .brand-bars {
    height: 24px;
    flex-shrink: 0;
  }

  .brand-wordmark strong {
    font-size: 15.5px;
  }

  .brand-wordmark small {
    font-size: 9.5px;
    letter-spacing: 0.05em;
  }

  .header-nav a,
  .header-nav button {
    padding: 0 12px;
    font-size: 11px;
    min-height: 44px;
    white-space: nowrap;
  }

  /* Admin header has 3 actions: wrap onto crisp second architectural bar on phones */
  .site-header-admin {
    flex-wrap: wrap;
  }

  .site-header-admin .brand-lockup {
    flex: 1 1 100%;
  }

  .site-header-admin .header-nav {
    flex: 1 1 100%;
    border-top: 1px solid var(--line);
    display: flex;
  }

  .site-header-admin .header-nav a,
  .site-header-admin .header-nav button {
    flex: 1 1 0;
    justify-content: center;
    padding: 10px 8px;
    font-size: 11px;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }

  .site-header-admin .header-nav a:first-child,
  .site-header-admin .header-nav button:first-child {
    border-left: none;
  }

  /* Compact Hero for phone screens */
  .hero-left {
    padding: 24px 16px 28px;
  }

  .hero h1 {
    margin: 12px 0 12px;
    font-size: clamp(26px, 7.2vw, 38px);
  }

  .hero-lead {
    font-size: 15px;
  }

  .hero-note {
    margin-top: 16px;
    padding: 12px 14px;
    font-size: 13px;
  }

  .hero-right {
    padding: 18px 16px 0;
    min-height: auto;
  }

  .hero-stat-cell {
    padding: 12px 8px 12px 0;
  }

  .hero-stat-cell + .hero-stat-cell {
    padding-left: 10px;
  }

  .hero-stat-num {
    font-size: 30px;
  }

  .hero-stat-lbl {
    font-size: 10px;
  }

  .monoliths {
    height: 36px;
    gap: 10px;
    margin-top: 14px;
  }

  .section-head {
    padding-bottom: 16px;
    margin-bottom: 20px;
    gap: 12px;
  }

  .type-toggle {
    width: 100%;
  }

  .type-toggle button {
    min-height: 46px;
    padding: 10px 8px;
    font-size: 11px;
    line-height: 1.25;
  }

  .form-error-wrap {
    padding: 14px 14px 0;
  }

  .mcp-drawer {
    padding: 18px 14px;
  }

  .key-row {
    flex-wrap: wrap;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .plum-banner {
    padding: 32px 18px;
  }

  .ref-badge {
    font-size: 20px;
    padding: 8px 18px;
  }
}

@media (max-width: 640px) {
  .section-block {
    padding: 22px 14px;
  }

  .building-card {
    padding: 16px 14px;
    margin-bottom: 18px;
  }

  .building-head {
    flex-wrap: wrap;
    gap: 10px;
  }

  .guide-bar {
    padding: 14px;
    margin-bottom: 18px;
  }

  .guide-bar .btn,
  .buildings-footer .btn,
  .prefill-bar .btn {
    width: 100%;
    min-height: 44px;
  }

  .guide-panel {
    padding: 14px;
    margin-bottom: 18px;
  }

  .draft-bar {
    padding: 14px;
  }

  .draft-bar-actions {
    width: 100%;
  }

  .draft-bar-actions .btn {
    flex: 1 1 auto;
    min-height: 42px;
  }

  .prefill-bar {
    padding: 14px;
  }

  .buildings-footer {
    padding: 14px;
  }

  .photo-slot {
    padding: 14px;
  }

  .photo-slot-tip {
    min-height: auto;
  }

  .file-input-btn {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    font-size: 12.5px;
  }

  .photo-slot-extra .file-input-btn {
    align-self: stretch !important;
  }

  .checkbox-row {
    padding: 14px;
    gap: 12px;
  }

  .checkbox-row input {
    width: 22px;
    height: 22px;
    margin-top: 2px;
  }

  .sig-header-row {
    align-items: flex-start;
  }

  .sig-auto-toggle {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
  }

  .sig-auto-toggle input {
    width: 18px;
    height: 18px;
  }

  #signatureCanvas {
    height: 165px;
  }

  .sig-actions {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
  }

  .btn-lg {
    min-height: 52px;
    padding: 15px 18px;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .gdpr-modal-card {
    padding: 18px 16px;
    max-height: 86dvh;
  }

  .gdpr-modal-head {
    flex-direction: column;
    align-items: stretch;
  }

  .gdpr-modal-head .btn {
    align-self: flex-end;
  }

  .auth-panel {
    padding: 22px 16px;
  }

  .auth-heading {
    font-size: 26px;
  }

  .admin-sidebar {
    padding: 16px 14px;
  }

  .admin-detail {
    padding: 18px 14px;
  }

  .toolbar-strip {
    padding: 14px;
  }

  .site-footer {
    padding: 18px 14px;
    padding-bottom: max(18px, env(safe-area-inset-bottom, 18px));
  }
}
