* { box-sizing: border-box; }

:root {
  --ink: #111827;
  --muted: #475569;
  --line: #d5dbe6;
  --line-strong: #b8c2d1;
  --canvas: #eef2f7;
  --panel: #ffffff;
  --soft: #f8fafc;
  --mint: #dff8ee;
  --mint-strong: #08735f;
  --red: #b91c1c;
  --blue-soft: #d7e7ff;
  --navy: #0f172a;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.06), 0 12px 32px rgba(17, 24, 39, 0.05);
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.network-banner {
  position: fixed;
  left: 50%;
  top: 12px;
  z-index: 30;
  width: min(520px, calc(100% - 24px));
  transform: translate(-50%, -120%);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff1f2;
  color: #991b1b;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 850;
  text-align: center;
  transition: transform 180ms ease;
}

.network-banner.visible {
  transform: translate(-50%, 0);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.loading-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.loading-card {
  width: min(360px, 100%);
  display: grid;
  justify-items: center;
  gap: 10px;
  border: 1px solid #dfe5ef;
  border-radius: 8px;
  padding: 28px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(15, 23, 42, 0.22);
  text-align: center;
}

.loading-card strong {
  font-size: 1.15rem;
}

.loading-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e4eaf3;
  border-top-color: var(--theme, #0f766e);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

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

a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 750;
}

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

input, textarea, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input::placeholder, textarea::placeholder { color: #727d8e; }

input:focus, textarea:focus, select:focus {
  border-color: color-mix(in srgb, var(--theme, #0f766e) 55%, #ffffff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme, #0f766e) 14%, transparent);
}

textarea { min-height: 96px; resize: vertical; }

label span, legend {
  display: block;
  margin-bottom: 6px;
  color: #263244;
  font-size: 0.88rem;
  font-weight: 800;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 14px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid #e7ebf1;
  text-align: left;
  vertical-align: top;
}

th {
  color: #4b5565;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

td {
  color: #263244;
}

tr:last-child td { border-bottom: 0; }

.topbar {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(18px, 3vw, 30px);
  padding: 10px clamp(16px, 2vw, 22px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.32rem;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.brand img, .tenant-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
}

.brand-mark {
  position: relative;
  width: 22px;
  height: 16px;
  border: 2px solid #111827;
  border-radius: 3px;
}

.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  bottom: -6px;
  width: 6px;
  height: 6px;
  border: 2px solid #111827;
  border-radius: 50%;
  background: #fff;
}

.brand-mark::before { left: 2px; }
.brand-mark::after { right: 2px; }

.topbar nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 25px);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar nav::-webkit-scrollbar { display: none; }

.topbar nav a {
  position: relative;
  color: #3f4a5a;
  font-size: 0.85rem;
  font-weight: 820;
  white-space: nowrap;
  border-radius: 6px;
  padding: 7px 9px;
}

.topbar nav a[aria-current="page"], .topbar nav a:hover {
  color: #111827;
  background: #f1f5f9;
}

.topbar nav a[aria-current="page"]::after {
  content: none;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  justify-self: end;
}

.user-pill {
  display: inline-grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  color: #3f4a5a;
  font-size: 0.78rem;
  line-height: 1.1;
  text-align: right;
}

.user-pill strong {
  display: block;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 850;
}

.user-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #bfd0ec;
  border-radius: 50%;
  background: #e7f0ff;
  color: #364152;
  font-size: 0;
}

.user-avatar::before,
.user-avatar::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
}

.user-avatar::before {
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.user-avatar::after {
  bottom: 9px;
  width: 17px;
  height: 8px;
  border-radius: 8px 8px 3px 3px;
  border-top-width: 2px;
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 30px auto 68px;
}

.panel, .auth-panel, .confirmation, .metric-card, .side-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel, .auth-panel, .confirmation {
  padding: clamp(22px, 3vw, 30px);
  margin-bottom: 20px;
}

.narrow, .auth-panel { max-width: 560px; margin-left: auto; margin-right: auto; }

.stack { display: grid; gap: 16px; }

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

.inline-form, .button-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-form input, .inline-form select { width: auto; min-width: 180px; }

.panel > .inline-form,
.table-wrap + .inline-form {
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 8px 16px;
  color: #1f2937;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 850;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.btn:hover {
  border-color: #aeb7c6;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
  transform: translateY(-1px);
}

.btn.primary {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.btn.compact {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.84rem;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  margin: 0 0 20px;
}

.page-header h1 {
  margin: 4px 0 6px;
  font-size: clamp(1.85rem, 3vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.page-header p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  background: #fff;
}

.table-wrap table {
  min-width: 680px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #d8deea;
  border-radius: 999px;
  padding: 3px 10px;
  background: #f6f8fb;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.badge.active,
.badge.available {
  border-color: #b8e7d7;
  background: #e8f8f2;
  color: #075f50;
}

.badge.inactive,
.badge.disabled,
.badge.archived,
.badge.invited {
  border-color: #d8deea;
  background: #f1f5f9;
  color: #475569;
}

.badge.occupied,
.badge.danger {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.shelf-panel .btn {
  min-height: 34px;
  border-color: transparent;
  background: #edf4ff;
  color: #111827;
  padding: 6px 15px;
  font-size: 0.84rem;
}

.btn.danger {
  border-color: #fecaca;
  color: var(--red);
  background: #fffafa;
}

.link-button {
  border: 0;
  background: transparent;
  color: #4b5565;
  font-weight: 760;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.signout-button {
  color: #2f3643;
  font-size: 0.86rem;
  font-weight: 850;
}

.icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  position: relative;
  flex: 0 0 auto;
}

.icon.plus::before, .icon.plus::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 2px;
}

.icon.plus::before { width: 12px; height: 2px; left: 2px; top: 7px; }
.icon.plus::after { width: 2px; height: 12px; left: 7px; top: 2px; }

.icon.external {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon.external::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  right: 2px;
  top: 2px;
}

.public-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(360px, 1fr);
  gap: clamp(22px, 5vw, 56px);
  align-items: start;
}

.kiosk-layout {
  min-height: calc(100vh - 160px);
  align-items: center;
}

.kiosk-note {
  display: grid;
  gap: 2px;
  max-width: 420px;
  margin-top: 22px;
  border-left: 4px solid var(--theme, #0f766e);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.kiosk-note span {
  color: var(--muted);
  font-weight: 650;
}

.public-hero {
  position: sticky;
  top: 96px;
  padding: 12px 4px;
}

.public-form-panel {
  max-width: 720px;
  justify-self: stretch;
  position: relative;
  overflow: hidden;
}

#dropoffForm.submitting {
  opacity: 0.65;
  pointer-events: none;
}

body.kiosk-assignment-active {
  overflow: hidden;
}

.kiosk-success {
  position: fixed;
  inset: 0;
  z-index: 40;
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: clamp(24px, 6vw, 72px);
  background: var(--canvas);
  text-align: center;
  animation: assignmentIn 260ms ease both;
}

.kiosk-success[hidden] {
  display: none;
}

.kiosk-success h1 {
  max-width: 760px;
  margin: 8px 0 4px;
  font-size: 4rem;
  line-height: 1;
}

.kiosk-success [data-kiosk-message] {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 700;
}

.assignment-orbit {
  position: relative;
  width: 62px;
  height: 62px;
  border: 2px solid color-mix(in srgb, var(--theme, #0f766e) 28%, #dbe5f1);
  border-radius: 50%;
}

.assignment-orbit::before,
.assignment-orbit::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 8px;
  background: var(--theme, #0f766e);
  animation: shelfPulse 900ms ease-in-out infinite alternate;
}

.assignment-orbit::after {
  inset: 21px;
  background: #fff;
  animation-delay: 140ms;
}

.countdown-line {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.countdown-line strong {
  display: inline-flex;
  justify-content: center;
  min-width: 1.3em;
  color: var(--ink);
}

@keyframes assignmentIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shelfPulse {
  from { transform: scale(0.82); opacity: 0.72; }
  to { transform: scale(1); opacity: 1; }
}

.landing-hero {
  min-height: 500px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  padding: clamp(28px, 6vw, 68px) 0;
}

.landing-hero h1 {
  max-width: 780px;
  margin: 8px 0 16px;
  font-size: clamp(2.25rem, 5vw, 4.6rem);
  line-height: 1;
}

.landing-hero p {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.08rem;
}

.landing-board {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: #111827;
  border: 1px solid #2f3b4f;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(23, 32, 51, 0.22);
}

.landing-board div {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 86px;
  padding: 16px;
  background: #f8fafc;
  border-left: 6px solid var(--theme, #0f766e);
  border-radius: 8px;
}

.landing-board strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--theme, #0f766e);
  color: #fff;
  font-size: 1.2rem;
}

.landing-board span { color: #2f3b4f; font-weight: 750; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature-grid article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.feature-grid h2 { margin: 0 0 8px; }
.feature-grid p { color: var(--muted); margin: 0; }

.public-hero h1, .confirmation h1, .panel h1 {
  margin: 8px 0 8px;
  line-height: 1.08;
}

.panel h2 {
  margin: 0 0 16px;
  line-height: 1.15;
}

.public-hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.public-hero p { max-width: 650px; color: var(--muted); font-weight: 600; }

.confirmation {
  text-align: center;
  max-width: 640px;
  margin: 28px auto;
}

.kicker {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 850;
}

.shelf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  min-height: 86px;
  padding: 14px 20px;
  border-radius: 8px;
  background: var(--theme, #0f766e);
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  margin: 14px 0;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) minmax(0, 1.25fr);
  gap: 20px;
  align-items: start;
}

.dashboard-sidebar {
  display: grid;
  gap: 16px;
}

.stats {
  display: grid;
  gap: 16px;
}

.dashboard-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 20px;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin: -4px 0 16px;
  border: 1px solid #b8e7d7;
  border-radius: 999px;
  padding: 5px 12px;
  background: #e8f8f2;
  color: #075f50;
  font-size: 0.82rem;
  font-weight: 900;
}

.live-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: livePulse 1100ms ease-in-out infinite;
}

.live-status.disconnected {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

@keyframes livePulse {
  0%, 100% { opacity: 0.45; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1); }
}

.metric-card {
  min-height: 116px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 22px 24px;
}

.metric-card p {
  margin: 0 0 4px;
  color: #6b7280;
  font-size: 0.92rem;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  color: #0f172a;
  font-size: 2.35rem;
  line-height: 1;
}

.metric-card.available strong { color: var(--mint-strong); }
.metric-card.occupied strong { color: var(--red); }

.metric-icon, .empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #eef4ff;
  color: #1f2937;
}

.metric-icon::before, .empty-icon::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 3px solid currentColor;
  border-radius: 4px;
}

.available .metric-icon { background: #73efba; color: #0b6f59; }
.occupied .metric-icon { background: #fee2e2; color: #b91c1c; }

.available .metric-icon::before {
  width: 19px;
  height: 10px;
  border-top: 0;
  border-right: 0;
  border-radius: 0;
  transform: rotate(-45deg);
}

.occupied .metric-icon::before {
  border-radius: 2px;
  box-shadow: inset 0 -7px 0 currentColor;
}

.side-panel,
.active-dropoffs-panel {
  min-height: 325px;
  padding: 22px 24px;
}

.side-panel .section-title,
.active-dropoffs-panel .section-title {
  padding-bottom: 15px;
  border-bottom: 1px solid #e6e9ef;
}

.side-panel .section-title h1,
.active-dropoffs-panel .section-title h1 {
  font-size: 1.13rem;
}

.side-panel .section-title a {
  font-size: 0.86rem;
}

.empty-state {
  min-height: 190px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #6b7280;
}

.empty-state p { margin: 10px 0 14px; font-weight: 650; }

.shelf-panel {
  min-height: 0;
}

.shelf-panel .section-title {
  padding-bottom: 18px;
  border-bottom: 1px solid #e6e9ef;
}

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.shelf {
  position: relative;
  min-height: 146px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--mint-strong);
  border-radius: 8px;
  padding: 22px;
  background: #f8faff;
  overflow: hidden;
}

.shelf strong {
  display: block;
  align-self: center;
  color: #111827;
  font-size: 1.86rem;
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.shelf small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #586474;
  font-weight: 760;
}

.shelf small::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.shelf.occupied {
  border-left-color: var(--red);
  background: #fff7f7;
}

.shelf.disabled {
  border: 1px dashed #d8deea;
  opacity: 1;
  background: #f6f8fd;
}

.shelf.disabled strong { color: #8b94a3; }

.status-pill {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 12px;
  background: #6ceeb5;
  color: #08755d;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.occupied {
  background: #fee2e2;
  color: #b91c1c;
}

.status-pill.inactive {
  background: #e8eef7;
  color: #475569;
}

.dropoff-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcff;
  animation: rowIn 180ms ease both;
}

@keyframes rowIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropoff-card .btn {
  flex: 0 0 auto;
  min-width: 112px;
}

.dropoff-main {
  min-width: 0;
}

.shelf-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 6px;
  padding: 4px 9px;
  background: #eef4ff;
  color: #1f2937;
  font-size: 0.84rem;
  font-weight: 900;
}

.dropoff-card p { margin: 8px 0 5px; color: #273345; font-weight: 650; }
.dropoff-card small { color: #586474; font-weight: 700; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.section-title h1,
.section-title h2 { margin: 0; font-size: 1.35rem; line-height: 1.1; }
.section-title p { margin: 4px 0 0; color: var(--muted); }

.check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.check input { width: auto; min-height: auto; }

.help { color: #69778a; font-size: 0.9rem; margin: 6px 0 0; }

.notice {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.error-list { color: #b91c1c; font-weight: 750; }

.form-builder-shell {
  width: min(1280px, calc(100% - 32px));
  margin: -28px auto -64px;
  display: grid;
  grid-template-columns: 240px minmax(420px, 1fr) 300px;
  min-height: calc(100vh - 66px);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #cfe0f8;
}

.form-builder-shell .panel {
  box-shadow: none;
}

.builder-rail, .property-panel {
  background: #fff;
}

.builder-rail {
  border-right: 1px solid var(--line);
  padding: 18px 16px;
}

.builder-title {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.builder-title strong { display: block; font-weight: 900; }
.builder-title span span, .builder-title small { color: var(--muted); font-size: 0.82rem; font-weight: 720; }

.builder-icon {
  width: 38px;
  height: 38px;
  border-radius: 3px;
  background: #111827;
  position: relative;
}

.builder-icon::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 18px;
  left: 11px;
  top: 9px;
  border-radius: 2px;
  background: #5fc6df;
  box-shadow: 0 -5px 0 #c8eff7;
}

.builder-menu {
  display: grid;
  gap: 8px;
  margin: 22px 0;
}

.builder-menu span {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  border-radius: 7px;
  padding: 0 14px;
  color: #5f6876;
  font-size: 0.88rem;
  font-weight: 850;
}

.builder-menu span::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.builder-menu .active {
  background: var(--mint);
  color: #08755d;
}

.builder-publish { width: 100%; border-radius: 7px; }

.form-canvas {
  min-width: 0;
  padding: 24px;
}

.form-sheet {
  max-width: 650px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-sheet-header {
  padding: 26px 24px 22px;
  border-bottom: 1px solid var(--line);
}

.form-sheet-header h1 { margin: 0 0 4px; font-size: 1.58rem; }
.form-sheet-header p { margin: 0; color: var(--muted); }

.mapping-panel {
  padding: 18px 24px 0;
}

.field-preview-list {
  display: grid;
  gap: 14px;
  padding: 22px 24px 0;
}

.field-preview {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  cursor: grab;
  transition: border-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.field-preview:hover {
  border-color: #b7c1d0;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.07);
}

.field-preview.selected {
  border: 2px solid #111827;
  box-shadow: 0 0 0 1px #111827;
}

.field-preview.dragging {
  cursor: grabbing;
  opacity: 0.55;
  transform: scale(0.985);
}

.field-preview h3 {
  margin: 0 0 8px;
  color: #364152;
  font-size: 0.92rem;
}

.field-preview h3 span { color: var(--red); }

.fake-input {
  min-height: 39px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  background: #f7f8fb;
  color: #a0a8b6;
  font-weight: 650;
}

.fake-input.long {
  min-height: 78px;
  align-items: flex-start;
}

.field-handle {
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #eaf1fb;
}

.field-handle::before {
  content: "";
  position: absolute;
  inset: 8px;
  background: radial-gradient(circle, #8692a3 1px, transparent 2px);
  background-size: 6px 6px;
}

.drop-zone {
  min-height: 112px;
  display: grid;
  place-items: center;
  margin: 14px 24px 24px;
  border: 2px dashed #c6d5ed;
  border-radius: 8px;
  color: #737d8e;
  font-weight: 820;
}

.drop-zone.active {
  border-color: var(--theme, #0f766e);
  background: color-mix(in srgb, var(--theme, #0f766e) 8%, #ffffff);
  color: #283548;
}

.field-preview-list.saving {
  pointer-events: none;
}

.field-order-status {
  min-height: 20px;
  margin: -12px 24px 22px;
  color: #657184;
  font-size: 0.86rem;
  font-weight: 750;
}

.add-field-panel {
  max-width: 650px;
  margin: 16px auto 0;
}

.property-panel {
  border-left: 1px solid var(--line);
  min-width: 0;
}

.property-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.property-header h2 { margin: 0; font-size: 1rem; }

.property-close {
  color: #98a1b0;
  font-size: 1.35rem;
  font-weight: 500;
}

.property-scroll {
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 130px);
  overflow: auto;
  padding: 18px;
}

.property-card {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.field-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}

.field-editor summary {
  cursor: pointer;
  color: #364152;
  font-weight: 850;
}

.field-editor form { margin-top: 14px; }

.form-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 20px;
  align-items: start;
}

.settings-sidebar {
  display: grid;
  gap: 20px;
}

.form-flow-panel .field-preview-list,
.field-settings-panel .field-editor-list {
  padding: 0;
}

.form-flow-panel .section-title,
.mapping-panel .section-title,
.add-field-panel .section-title,
.field-settings-panel .section-title {
  margin-bottom: 18px;
}

.settings-sidebar .mapping-panel,
.settings-sidebar .add-field-panel {
  max-width: none;
  margin: 0;
  padding: clamp(20px, 2.5vw, 26px);
}

.field-preview-list {
  gap: 12px;
}

.field-preview {
  padding: 16px 16px 16px 18px;
}

.field-preview.selected {
  border: 1px solid #9db3d6;
  box-shadow: 0 0 0 3px #e7eefb;
}

.field-preview-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.field-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.field-preview h3 {
  margin: 0;
  color: #263244;
}

.field-preview p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.field-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 30px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 900;
}

.badge.required {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.fake-input {
  color: #607086;
}

.form-flow-panel .drop-zone {
  margin: 14px 0 0;
}

.form-flow-panel .field-order-status {
  margin: 10px 0 0;
}

.field-settings-panel {
  margin-top: 20px;
}

.field-editor-list {
  display: grid;
  gap: 12px;
}

.field-editor {
  padding: 0;
  overflow: hidden;
}

.field-editor summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
}

.field-editor summary span {
  display: grid;
  gap: 2px;
}

.field-editor summary small {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
}

.field-editor form {
  margin-top: 0;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.editor-section {
  display: grid;
  gap: 12px;
  padding: 0 0 16px;
  border-bottom: 1px solid #e9edf4;
}

.editor-section + .editor-section {
  padding-top: 2px;
}

.editor-section h3 {
  margin: 0;
  color: #263244;
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
}

.compact-editor {
  padding-bottom: 14px;
}

.advanced-validation {
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcff;
}

.advanced-validation summary {
  display: list-item;
  padding: 0;
  background: transparent;
  color: #334155;
  font-weight: 850;
}

.advanced-validation label {
  display: block;
  margin-top: 12px;
}

.editor-toggles {
  align-items: center;
}

.add-shelves-form { margin-top: 18px; }
.shelves-table input[type="text"],
.shelves-table input:not([type]) {
  width: min(100%, 320px);
}

.shelves-table input[type="number"] {
  width: 92px;
}

.shelf-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shelf-edit-form {
  margin: 0;
}
details summary { cursor: pointer; font-weight: 850; }

.branding-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 20px;
  align-items: start;
}

.branding-form {
  margin-bottom: 0;
}

.branding-preview {
  display: grid;
  gap: 20px;
}

.link-copy {
  display: grid;
  gap: 5px;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcff;
}

.link-copy + .link-copy {
  margin-top: 10px;
}

.link-copy span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.link-copy a {
  overflow-wrap: anywhere;
  color: #1f2937;
}

.brand-card-preview {
  position: sticky;
  top: 92px;
  border-top: 6px solid var(--preview-theme, var(--theme));
}

.brand-card-preview h2 {
  margin-bottom: 8px;
}

.brand-card-preview p {
  color: var(--muted);
  font-weight: 650;
}

.brand-card-preview .btn.primary {
  background: var(--preview-theme, var(--theme));
  border-color: var(--preview-theme, var(--theme));
}

.mini-assignment {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.mini-assignment span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-assignment strong {
  color: var(--preview-theme, var(--theme));
  font-size: 2rem;
  line-height: 1;
}

.mini-assignment small {
  color: #334155;
  font-weight: 700;
}

.offline-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.offline-page {
  width: min(100%, 760px);
  padding: 24px;
}

.offline-card {
  text-align: center;
}

.offline-card .loading-spinner {
  margin: 0 auto 16px;
}

@media (max-width: 1060px) {
  .form-builder-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .property-panel {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .property-scroll { max-height: none; }
}

@media (max-width: 820px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .topbar nav {
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
    overflow-y: visible;
  }
  .topbar nav a[aria-current="page"]::after { bottom: -8px; }
  .topbar-actions { justify-self: start; width: 100%; justify-content: space-between; }

  .page-header,
  .dashboard-layout,
  .grid-2,
  .landing-hero,
  .feature-grid,
  .public-layout,
  .form-settings-layout,
  .branding-layout {
    grid-template-columns: 1fr;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .dashboard-summary {
    grid-template-columns: 1fr;
  }

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

  .public-hero {
    position: static;
  }

  .kiosk-success h1 {
    font-size: 2.6rem;
  }

  .kiosk-success [data-kiosk-message] {
    font-size: 1.05rem;
  }

  .brand-card-preview {
    position: static;
  }

  .form-builder-shell {
    width: 100%;
    margin: -28px 0 -64px;
    grid-template-columns: 1fr;
    border: 0;
  }

  .builder-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .form-canvas { padding: 18px; }

  .landing-hero { min-height: 0; padding-top: 24px; }
  .dropoff-card { align-items: stretch; flex-direction: column; }
  .inline-form { align-items: stretch; }
  .inline-form input, .inline-form select { width: 100%; }

  th, td { display: block; width: 100%; }
  tr { display: block; border-bottom: 1px solid #e4e8ef; padding: 8px 0; }
  td { border: 0; }

  .table-wrap table {
    min-width: 680px;
  }

  .table-wrap th,
  .table-wrap td {
    display: table-cell;
    width: auto;
  }

  .table-wrap tr {
    display: table-row;
    border-bottom: 0;
    padding: 0;
  }

  .table-wrap td {
    border-bottom: 1px solid #e7ebf1;
  }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 20px, 1220px); }
  .builder-menu { grid-template-columns: 1fr; }
  .metric-card { padding: 18px; }
  .shelf-grid { grid-template-columns: 1fr; }
  .form-sheet-header, .mapping-panel, .field-preview-list { padding-left: 16px; padding-right: 16px; }
  .drop-zone { margin-left: 16px; margin-right: 16px; }
}
