:root {
  --brand: #E34C2A;
  --brand-dark: #C73E21;
  --brand-soft: #FFF2EC;
  --ink: #1E293B;
  --muted: #64748B;
  --line: #E5E7EB;
  --bg: #F7F7F8;
  --card: #ffffff;
  --ok: #138A57;
  --warn: #F59E0B;
  --danger: #b91c1c;
  --shadow: 0 10px 25px rgba(227, 76, 42, .08);
  --focus-ring: 0 0 0 3px rgba(227, 76, 42, .18);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font: 14px/1.45 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}


/* Main Container */
.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  box-shadow: 0 0 40px rgba(15, 23, 42, .08);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Header & Progress */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff;
  border-bottom: 1px solid #f2d7ce;
  padding: 12px 16px 10px;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand-left {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.brand-logo-img {
  height: 34px;
  width: auto;
  display: block;
}
.brand-name {
  font-size: 18px;
  font-weight: 900;
  color: var(--brand-dark);
  letter-spacing: -0.02em;
}
.save {
  font-size: 11px;
  color: var(--brand);
  font-weight: 800;
  background: var(--brand-soft);
  padding: 4px 8px;
  border-radius: 999px;
}
.btn-header-back {
  border: 1px solid #f0cbbf;
  background: #ffffff;
  color: #8a3c29;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-header-back:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
}
.progress-wrap {
  margin-top: 10px;
  height: 6px;
  background: #fde2d8;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-inner {
  height: 100%;
  width: 8%;
  background: linear-gradient(90deg, var(--brand), #ff8655);
  transition: width 0.3s ease-in-out;
}
.stepmeta {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 11px;
  color: #95523f;
  font-weight: 700;
}

/* Hero Section */
.hero {
  padding: 16px 16px;
  background: linear-gradient(135deg, var(--brand-soft), #fff 65%);
  border-bottom: 1px solid #ffe1d6;
}
.hero h1 {
  margin: 0 0 6px;
  font-size: 21px;
  line-height: 1.2;
  color: #7a2410;
  font-weight: 800;
}
.hero p {
  margin: 0;
  color: #8a4e3f;
  font-size: 12px;
  line-height: 1.4;
}

/* Edit Banner */
.edit-banner {
  display: none;
  margin: 10px 14px 4px;
  padding: 10px 14px;
  border: 1px solid #efb5a5;
  background: #fff3ef;
  color: #8e321c;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.edit-banner.show {
  display: flex;
}
.edit-banner button {
  border: 0;
  background: none;
  color: #b9361e;
  font-weight: 900;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 12px;
  text-decoration: underline;
}

/* Form Content */
.content {
  padding: 14px 14px 110px;
  flex: 1 0 auto;
}
.card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.25;
  color: #1e293b;
  font-weight: 800;
}
h3 {
  margin: 16px 0 8px;
  font-size: 14px;
  color: #334155;
  font-weight: 800;
}
.sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* Form Fields */
.field {
  margin: 0 0 14px;
}
label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 12px;
  color: #334155;
}
.req:after {
  content: ' *';
  color: var(--brand);
}
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d7dbe2;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}
input:not([type="checkbox"]):not([type="radio"]).field-error, select.field-error, textarea.field-error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18) !important;
}

input[type="checkbox"], input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 4px !important;
  accent-color: #dc2626 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  outline: none !important;
  background: #ffffff !important;
}
textarea {
  min-height: 78px;
  resize: vertical;
}

/* Grids */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* Choice Cards */
.choicegrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.choice {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 10px;
  cursor: pointer;
  background: #ffffff;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all .15s ease;
  user-select: none;
}
.choice input {
  display: none;
}
.choice strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.25;
}
.choice span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.3;
}
.choice.on {
  border: 2px solid var(--brand);
  background: var(--brand-soft);
  padding: 11px 9px;
}
.choice.on strong {
  color: #8b2b14;
}

/* Pills */
.pillrow {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  flex-wrap: wrap;
}
.pill {
  white-space: nowrap;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  transition: all .15s;
}
.pill.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

/* Notes & Warnings */
.note {
  background: #fff7f4;
  border-left: 4px solid var(--brand);
  padding: 10px 12px;
  border-radius: 10px;
  color: #8a4e3f;
  font-size: 12px;
  line-height: 1.4;
}
.note.warn {
  border-left-color: var(--warn);
  background: #fff9ec;
  color: #8a6931;
}

/* Local Upload Previews */
.upload {
  border: 1.5px dashed #f2b8a5;
  border-radius: 14px;
  background: #fffaf8;
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  position: relative;
  margin-top: 10px;
}
.upload input[type="file"] {
  width: 100%;
  height: 100%;
  opacity: 0;
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.upload b {
  display: block;
  color: #8a2f17;
  font-size: 13px;
  margin-top: 2px;
}
.upload small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.attachment-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff0eb;
  border: 1px solid #efbdae;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  color: #923018;
  font-weight: 700;
}
.attachment-chip .btn-remove-file {
  background: none;
  border: none;
  padding: 0;
  color: #c53030;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

/* Checkbox Row */
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
  cursor: pointer;
}
.check input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}
.check label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  line-height: 1.4;
}

/* Sticky Action Area */
.btns {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-top: 1px solid #f2ddd6;
  z-index: 30;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, .05);
}
.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 46px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .15s ease;
  text-decoration: none;
}
.btn:active {
  transform: scale(0.98);
}
.ghost {
  background: #ffffff;
  border: 1px solid #f0cbbf;
  color: #8a3c29;
}
.ghost:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}
.primary {
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(227, 76, 42, .28);
}

/* Row Cards (Defects & Included Items) */
.rowcard {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
  background: #fafbfc;
}
.rowhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rowhead b {
  font-size: 13px;
  color: #334155;
}
.edit {
  background: none;
  border: none;
  color: var(--brand);
  font-weight: 800;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 12px;
}

/* Scope Table */
.scope {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 10px 0;
}
.scope th, .scope td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}
.scope th {
  background: #fff5f0;
  font-weight: 800;
  color: #7b2915;
}

/* Review Sections */
.reviewsec {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  background: #fff;
}
.reviewsec header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 12px;
  background: #fff6f2;
  font-weight: 800;
  font-size: 13px;
  color: #722613;
}
.reviewsec .inside {
  padding: 10px 12px;
}
.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
.kv div {
  padding: 6px 0;
  border-bottom: 1px dashed #eceff3;
}
.kv div:last-child {
  border-bottom: none;
}
.kv b {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

/* Helpers */
.hidden {
  display: none !important;
}

/* ============================================================
   GATE SCREEN: Mobile Verification & OTP
   ============================================================ */
.gate {
  min-height: 100vh;
  padding: 24px 16px 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 0, #fff4ef 0, #fff 45%), #fff;
}
.gate-shell {
  width: 100%;
  max-width: 440px;
}
.gatehero {
  text-align: center;
  padding: 0 14px 20px;
}
.gatehero-logo {
  height: 48px;
  max-width: 200px;
  object-fit: contain;
  margin-bottom: 16px;
}
.gatehero h1 {
  margin: 0 0 7px;
  font-size: 23px;
  line-height: 1.2;
  color: #6f2413;
  font-weight: 900;
}
.gatehero p {
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  max-width: 360px;
}
.gate .card {
  border: 1px solid #f1ddd5;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 18px 55px rgba(145, 56, 30, .11);
}
.gate-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff1eb;
  color: #b33b20;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  margin-bottom: 12px;
}
.mobile-input {
  display: flex;
  align-items: center;
  border: 1px solid #d7dbe2;
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
  transition: .2s;
}
.mobile-input:focus-within {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}
.mobile-prefix {
  padding: 0 12px;
  border-right: 1px solid #eceff3;
  color: #475569;
  font-weight: 800;
  height: 46px;
  display: flex;
  align-items: center;
  background: #fafafa;
}
.mobile-input input {
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0;
  height: 46px;
  font-size: 16px;
  letter-spacing: .4px;
  padding: 0 12px;
}
.security-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  color: #64748b;
  font-size: 11px;
}
.security-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px #dcfce7;
}
.gate-note {
  margin-top: 14px;
  background: #fff8f5;
  border: 1px solid #f3d4c8;
  border-radius: 12px;
  padding: 9px 11px;
  color: #8a4e3f;
  font-size: 11px;
}
.accountfound {
  border: 1px solid #f3cdbc;
  background: linear-gradient(180deg, #fff8f5, #fff);
  border-radius: 14px;
  padding: 12px 13px;
  margin: 12px 0 16px;
}
.accountfound b {
  font-size: 14px;
  color: #1e293b;
}
.accountfound .mini {
  font-size: 12px;
  color: var(--muted);
}
.otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.otp input {
  min-width: 0;
  height: 50px;
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  padding: 0;
  border-radius: 12px;
}
.otp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.linkbtn {
  border: 0;
  background: none;
  color: var(--brand);
  font-weight: 800;
  padding: 8px 0;
  cursor: pointer;
  font-size: 12px;
}

body.locked {
  overflow: hidden !important;
  height: 100vh;
}
body.locked .top,
body.locked .hero,
body.locked #form,
body.locked .btns {
  display: none !important;
}

/* ============================================================
   QUICK REGISTRATION MODAL / VIEW (Reference Prototype)
   ============================================================ */
.quick-registration-host {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #f8f6f5;
  display: none;
  overflow: auto;
  color: #1f2937;
}
.quick-registration-host.show {
  display: block;
}
.qr-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #f0d7cf;
}
.qr-back {
  border: 1px solid #efb4a5;
  background: #fff;
  color: #b9361e;
  border-radius: 11px;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
}
.qr-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 26px 16px 50px;
}
.qr-intro {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 20px;
}
.qr-eyebrow {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff0eb;
  color: #c63f24;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.qr-intro h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.12;
  color: #6e2515;
}
.qr-intro p {
  margin: 0;
  color: #64748b;
}
.qr-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 22px auto;
  max-width: 560px;
}
.qr-progress-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  white-space: nowrap;
}
.qr-progress-step .n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e9edf2;
  color: #64748b;
}
.qr-progress-step.active {
  color: #9c321c;
}
.qr-progress-step.active .n {
  background: #e34c2a;
  color: #fff;
}
.qr-progress-step.done .n {
  background: #15805b;
  color: #fff;
}
.qr-line {
  height: 2px;
  flex: 1;
  min-width: 16px;
  background: #e4e7eb;
  margin: 0 8px;
}
.qr-line.done {
  background: #15805b;
}
.qr-card {
  background: #fff;
  border: 1px solid #eadbd6;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 20px 55px rgba(138, 59, 35, .10);
  max-width: 680px;
  margin: 0 auto;
}
.qr-step {
  display: none;
}
.qr-step.active {
  display: block;
}
.qr-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}
.qr-title-row h2 {
  margin: 0 0 5px;
  font-size: 24px;
  color: #1f2937;
}
.qr-title-row p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}
.qr-time {
  padding: 6px 9px;
  border-radius: 999px;
  background: #fff1ec;
  color: #b73b22;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.qr-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.qr-field {
  margin-bottom: 14px;
}
.qr-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
}
.qr-field input,
.qr-field select,
.qr-field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d9dee5;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  outline: none;
}
.qr-field textarea {
  min-height: 78px;
}
.qr-field input:focus,
.qr-field select:focus,
.qr-field textarea:focus {
  border-color: #e34c2a;
  box-shadow: 0 0 0 3px rgba(227, 76, 42, .10);
}
.qr-phone {
  display: grid;
  grid-template-columns: 72px 1fr;
  border: 1px solid #d9dee5;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.qr-phone .cc {
  display: grid;
  place-items: center;
  background: #fff8f5;
  border-right: 1px solid #e8e8e8;
  font-weight: 800;
  color: #475569;
}
.qr-phone input {
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.qr-user-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  max-height: 240px;
  overflow-y: auto;
  padding: 10px;
  border: 1.5px solid #e2e7ec;
  border-radius: 12px;
  background: #fbfcfd;
}
.qr-type {
  position: relative;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 12px !important;
  min-height: unset !important;
  height: auto !important;
  border: 1.5px solid #e2e7ec !important;
  border-radius: 8px !important;
  background: #fff !important;
  cursor: pointer !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  user-select: none !important;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease !important;
}
.qr-type:hover {
  border-color: #cbd5e1 !important;
  background-color: #f8fafc !important;
}
.qr-type input,
.qr-field .qr-user-types .qr-type input {
  width: 17px !important;
  height: 17px !important;
  min-width: 17px !important;
  min-height: 17px !important;
  max-width: 17px !important;
  max-height: 17px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 4px !important;
  accent-color: #c43c20 !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  cursor: pointer !important;
  box-shadow: none !important;
  outline: none !important;
  background: #fff !important;
}
.qr-type span,
.qr-field .qr-user-types .qr-type span {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  padding: 0 !important;
  user-select: none !important;
}
.qr-type.on {
  border-color: #c43c20 !important;
  background: #fff9f7 !important;
  box-shadow: 0 0 0 1px #c43c20 !important;
}
.qr-type.on span,
.qr-field .qr-user-types .qr-type.on span {
  color: #9a2c14 !important;
  font-weight: 600 !important;
}
.qr-role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.qr-chip {
  position: relative;
}
.qr-chip input {
  position: absolute;
  opacity: 0;
}
.qr-chip span {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #dde3e9;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  color: #526174;
  cursor: pointer;
}
.qr-chip input:checked + span {
  background: #fff1ec;
  border-color: #efad9b;
  color: #9b341e;
}
.qr-consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  font-size: 11px;
  color: #64748b;
  margin-top: 10px;
  cursor: pointer;
  align-items: flex-start;
}
.qr-consent input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  padding: 0 !important;
  margin: 1px 0 0 0 !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 4px !important;
  accent-color: #dc2626 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  outline: none !important;
  background: #ffffff !important;
}
.qr-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.qr-btn {
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  font-weight: 850;
  cursor: pointer;
}
.qr-primary {
  flex: 1;
  background: linear-gradient(135deg, #f15b38, #e34c2a, #c93c20);
  color: #fff;
  box-shadow: 0 10px 24px rgba(227, 76, 42, .20);
}
.qr-secondary {
  background: #fff;
  border: 1px solid #dfe4ea;
  color: #475569;
}
.qr-error {
  min-height: 16px;
  margin-top: 8px;
  color: #c92a2a;
  font-size: 11px;
  font-weight: 700;
}
.wizard-field-msg {
  min-height: 0;
  margin-top: 4px;
  font-size: 12px;
}
.qr-otp {
  text-align: center;
}
.qr-otp-boxes {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 14px;
}
.qr-otp-boxes input {
  width: 50px;
  height: 55px;
  text-align: center;
  border: 1px solid #d9dee5;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 900;
  outline: none;
}
.qr-otp-boxes input:focus {
  border-color: #e34c2a;
  box-shadow: 0 0 0 3px rgba(227, 76, 42, .10);
}
.qr-success {
  text-align: center;
}
.qr-success-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  background: #e34c2a;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
}
.qr-summary {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid #e1e6ec;
  border-radius: 14px;
  background: #fafbfc;
  text-align: left;
}
.qr-summary-row {
  display: grid;
  grid-template-columns: 125px 1fr;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #e9edf1;
  font-size: 12px;
}
.qr-summary-row:last-child {
  border-bottom: 0;
}
.qr-summary-row span:first-child {
  color: #64748b;
}
.qr-summary-row span:last-child {
  font-weight: 800;
}

/* ============================================================
   MY LISTINGS DASHBOARD
   ============================================================ */
.listings-host {
  position: fixed;
  inset: 0;
  z-index: 180;
  background: #f7f7f8;
  display: none;
  overflow-y: auto;
  color: var(--ink);
}
.listings-host.show {
  display: block;
}
.listings-top {
  position: sticky;
  top: 0;
  z-index: 8;
  background: #fff;
  border-bottom: 1px solid #f0d8d0;
  padding: 12px 16px;
}
.listings-top-inner {
  max-width: 960px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.listings-top-logo {
  height: 32px;
  width: auto;
}
.account-mini {
  text-align: right;
}
.account-mini b {
  display: block;
  font-size: 12px;
  color: #1e293b;
}
.account-mini span {
  font-size: 10px;
  color: #64748b;
}
.listings-page {
  max-width: 960px;
  margin: auto;
  padding: 22px 16px 50px;
}
.listings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.listings-head h1 {
  margin: 0 0 4px;
  font-size: 24px;
  color: #6f2413;
  font-weight: 900;
}
.listings-head p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
}
.new-listing-btn {
  border: 0;
  border-radius: 13px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f15b38, #e34c2a, #c93c20);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(227, 76, 42, .20);
  font-size: 13px;
  min-height: 44px;
}
.listing-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 0 18px;
}
.summary-tile {
  background: #fff;
  border: 1px solid #eadfdc;
  border-radius: 14px;
  padding: 12px;
}
.summary-tile b {
  display: block;
  font-size: 20px;
  color: #8b2d18;
}
.summary-tile span {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}
.listing-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 14px;
}
.filter-pill {
  border: 1px solid #e2e6eb;
  background: #fff;
  color: #64748b;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  min-height: 36px;
}
.filter-pill.on {
  background: #fff1ec;
  color: #a8371f;
  border-color: #efb3a2;
}
.listing-list {
  display: grid;
  gap: 12px;
}
.listing-card {
  background: #fff;
  border: 1px solid #e7e2e0;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(50, 30, 20, .05);
}
.listing-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.listing-id {
  font-size: 11px;
  font-weight: 900;
  color: #c04428;
  letter-spacing: .04em;
}
.listing-title {
  margin: 3px 0 4px;
  font-size: 17px;
  font-weight: 900;
  color: #1e293b;
}
.listing-sub {
  font-size: 12px;
  color: #64748b;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.status-draft {
  background: #f1f5f9;
  color: #475569;
}
.status-review {
  background: #fff7e7;
  color: #9a6816;
}
.status-info {
  background: #fff0ed;
  color: #b23b22;
}
.status-published {
  background: #e9f8f1;
  color: #16734e;
}
.status-closed {
  background: #eef2f7;
  color: #596579;
}
.status-complete {
  background: #eaf4ff;
  color: #356797;
}
.listing-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.listing-meta div {
  padding: 8px 10px;
  background: #fafafa;
  border-radius: 10px;
}
.listing-meta b {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 2px;
}
.listing-meta span {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
.listing-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.list-action {
  border: 1px solid #e4e7eb;
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 850;
  color: #475569;
  cursor: pointer;
  min-height: 38px;
}
.list-action.primary {
  background: #fff1ec;
  border-color: #efb4a4;
  color: #a8361e;
}
.list-action.danger {
  color: #b42318;
}
.empty-listings {
  background: #fff;
  border: 1px dashed #efb6a6;
  border-radius: 18px;
  padding: 34px 20px;
  text-align: center;
}
.empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  background: #fff1ec;
  color: #d64528;
  font-size: 24px;
  font-weight: 900;
}
.empty-listings h2 {
  margin: 0 0 6px;
  font-size: 18px;
}
.empty-listings p {
  margin: 0 auto 16px;
  color: #64748b;
  font-size: 12px;
  max-width: 400px;
}

/* Listing Details Sheet */
.listing-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(15, 23, 42, .46);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.listing-detail-backdrop.show {
  display: flex;
}
.listing-detail-sheet {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -16px 50px rgba(0, 0, 0, .18);
}
.sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 99px;
  background: #d8dde4;
  margin: 0 auto 14px;
}
.detail-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.detail-grid div {
  border: 1px solid #eceff2;
  border-radius: 11px;
  padding: 9px;
}
.detail-grid b {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  margin-bottom: 2px;
}
.detail-grid span {
  font-size: 12px;
  font-weight: 750;
  color: #1e293b;
}
.history-box {
  border-top: 1px solid #eceff2;
  margin-top: 12px;
  padding-top: 12px;
}
.history-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 6px 0;
  font-size: 11px;
}
.history-row span:first-child {
  color: #94a3b8;
}
.history-row span:last-child {
  color: #475569;
}

/* ============================================================
   RESPONSIVENESS (320px, 360px, 390px, 768px, 1024px)
   ============================================================ */
@media (max-width: 480px) {
  .gate {
    justify-content: flex-start;
    padding-top: 30px;
  }
  .gate-shell {
    max-width: 100%;
  }
  .gatehero h1 {
    font-size: 20px;
  }
  .gate .card {
    padding: 16px;
    border-radius: 18px;
  }
  .grid2, .choicegrid, .grid3, .kv {
    grid-template-columns: 1fr;
  }
  .btns {
    grid-template-columns: 1fr 1.2fr;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }
  .btn {
    padding: 12px 12px;
    font-size: 13px;
  }
  .qr-page {
    padding: 16px 12px 36px;
  }
  .qr-card {
    padding: 16px;
    border-radius: 18px;
  }
  .qr-grid2, .qr-user-types {
    grid-template-columns: 1fr;
  }
  .qr-intro h1 {
    font-size: 22px;
  }
  .qr-progress-step .lbl {
    display: none;
  }
  .qr-otp-boxes {
    gap: 6px;
  }
  .qr-otp-boxes input {
    width: min(44px, 13vw);
    height: 48px;
  }
  .qr-title-row {
    display: block;
  }
  .qr-time {
    display: inline-block;
    margin-top: 8px;
  }
  .qr-summary-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .listings-page {
    padding: 16px 12px 40px;
  }
  .listings-head {
    display: block;
  }
  .new-listing-btn {
    width: 100%;
    margin-top: 12px;
  }
  .listing-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .listing-meta {
    grid-template-columns: 1fr 1fr;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .account-mini {
    display: none;
  }
}

@media (max-width: 360px) {
  .otp input {
    height: 44px;
    font-size: 17px;
  }
  .summary-tile b {
    font-size: 18px;
  }
  .choice strong {
    font-size: 12px;
  }
  .hero h1 {
    font-size: 19px;
  }
}


/* ==========================================================================
   TOWER CRANE ATTACH PHOTOS MODULE (Matches Reference Mobile Flow)
   ========================================================================== */

.attach-photos-host {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: #f1f5f9;
  overflow-y: auto;
  display: block;
}

.attach-photos-host.hidden {
  display: none !important;
}

.ap-shell {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* Top Sticky Header */
.ap-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ap-back-btn,
.ap-refresh-btn,
.ap-close-x {
  background: none;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ap-back-btn:hover,
.ap-refresh-btn:hover,
.ap-close-x:hover {
  background: #f1f5f9;
}

.ap-top-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ap-logo {
  height: 26px;
  object-fit: contain;
}

.ap-listing-tag {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  margin-top: 2px;
}

/* Machine / Serial Bar */
.ap-machine-bar {
  background: #f8fafc;
  padding: 10px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ap-machine-title {
  display: flex;
  flex-direction: column;
}

.ap-machine-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.ap-machine-val {
  font-size: 15px;
  color: #0f172a;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Step Header */
.ap-step-header {
  padding: 14px 16px 8px;
  background: #ffffff;
}

.ap-step-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ap-step-num {
  min-width: 48px;
  height: 34px;
  padding: 0 6px;
  border-radius: 8px;
  background: #fee2e2;
  border: 1.5px solid #fca5a5;
  color: #dc2626;
  font-weight: 800;
  font-size: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ap-step-segments {
  display: flex;
  gap: 3px;
  margin-top: 6px;
  width: 100%;
}

.ap-step-segment {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  transition: background 0.2s ease;
}

.ap-step-segment.active {
  background: #dc2626;
}

.ap-step-info {
  flex: 1;
  min-width: 0;
}

.ap-step-title {
  font-size: 17px;
  font-weight: 750;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-step-help {
  font-size: 12px;
  color: #64748b;
  display: block;
  margin-top: 2px;
}

.ap-status-tag {
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.ap-status-tag.incomplete {
  background: #fef3c7;
  color: #92400e;
}

.ap-guide-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}

.ap-guide-text {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.ap-angle-badge {
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
}

/* Progress Bar (Legacy hidden) */
.ap-progress-bar-bg {
  display: none;
}

/* Angle Cards Container */
.ap-angles-container {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.ap-angle-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ap-angle-heading {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ap-angle-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

/* Sample Box (Left) */
.ap-sample-box {
  height: 135px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ap-sample-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.ap-sample-empty {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  padding: 10px;
}

.ap-zoom-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  border: none;
  display: grid;
  place-items: center;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ap-zoom-btn:hover {
  background: rgba(15, 23, 42, 0.85);
}

.ap-sample-tag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Arrow (Center) */
.ap-arrow {
  color: #dc2626;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Capture Box (Right) */
.ap-capture-box {
  height: 135px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

/* Empty State: Dashed Red Border */
.ap-capture-box.empty {
  border: 1.5px dashed #fca5a5;
  background: #fff5f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-align: center;
  padding: 8px;
}

.ap-capture-box.empty:hover {
  background: #fee2e2;
  border-color: #ef4444;
}

.ap-capture-icon {
  font-size: 24px;
  color: #dc2626;
  margin-bottom: 2px;
}

.ap-capture-label {
  font-size: 13px;
  font-weight: 700;
  color: #dc2626;
  margin: 0;
}

.ap-capture-sub {
  font-size: 11px;
  color: #94a3b8;
  margin: 0;
}

/* Captured State: Image Thumbnail */
.ap-capture-box.captured {
  border: 1px solid #e2e8f0;
  background: #0f172a;
}

.ap-captured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ap-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border: none;
  display: grid;
  place-items: center;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ap-remove-btn:hover {
  background: #dc2626;
}

.ap-retake-btn {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ap-retake-btn:hover {
  background: rgba(15, 23, 42, 0.95);
}

.ap-hidden-file {
  display: none;
}

/* Uploading Spinner */
.ap-uploading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
}

.ap-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid #fee2e2;
  border-top-color: #dc2626;
  border-radius: 50%;
  animation: ap-spin 0.7s linear infinite;
}

@keyframes ap-spin {
  to { transform: rotate(360deg); }
}

/* Notice */
.ap-notice {
  margin: 12px 16px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

.ap-notice i {
  color: #0284c7;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Bottom Actions */
.ap-bottom-actions {
  position: sticky;
  bottom: 0;
  background: #ffffff;
  padding: 12px 16px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 12px;
  z-index: 40;
}

.ap-btn-nav {
  height: 46px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#apPrevBtn {
  min-width: 100px;
}

#apNextBtn {
  flex: 1;
  background: #dc2626;
  border-color: #dc2626;
}

#apNextBtn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* Lightbox Modal */
.ap-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.90);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ap-lightbox-modal.hidden {
  display: none !important;
}

.ap-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ap-lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.ap-lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}

.ap-lightbox-caption {
  margin-top: 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}


/* Source Choice Modal (Camera vs Upload) */
.ap-source-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(15, 23, 42, 0.60);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.ap-source-modal.hidden {
  display: none !important;
}

.ap-source-sheet {
  max-width: 500px;
  width: 100%;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  padding: 16px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.15);
  animation: apSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes apSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.ap-source-handle {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: #cbd5e1;
  margin: 0 auto 4px;
}

.ap-source-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
}

.ap-source-sub {
  font-size: 13px;
  color: #64748b;
  text-align: center;
  margin-top: -6px;
  margin-bottom: 4px;
}

.ap-source-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.ap-source-btn:hover {
  border-color: #dc2626;
  background: #fff5f5;
  transform: translateY(-1px);
}

.ap-source-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.ap-source-icon.camera {
  background: #fee2e2;
  color: #dc2626;
}

.ap-source-icon.upload {
  background: #e0f2fe;
  color: #0284c7;
}

.ap-source-text {
  flex: 1;
}

.ap-source-text b {
  display: block;
  font-size: 15px;
  color: #0f172a;
}

.ap-source-text span {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 1px;
}

.ap-source-arr {
  color: #94a3b8;
  font-size: 16px;
}

.ap-source-cancel {
  border: none;
  background: #f1f5f9;
  color: #475569;
  border-radius: 14px;
  padding: 13px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s ease;
}

.ap-source-cancel:hover {
  background: #e2e8f0;
}

/* Live Camera Viewfinder Modal */
.ap-camera-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: #000000;
  display: flex;
  flex-direction: column;
}

.ap-camera-modal.hidden {
  display: none !important;
}

.ap-camera-shell {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #000000;
  position: relative;
}

.ap-camera-top {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  z-index: 10;
}

.ap-cam-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}

.ap-cam-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.ap-cam-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.ap-camera-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#apCameraVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#apCameraFrozenImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 5;
}

.ap-camera-bottom {
  height: 120px;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  z-index: 10;
}

.ap-cam-live-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.ap-shutter-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.1s ease;
  padding: 0;
}

.ap-shutter-btn:active {
  transform: scale(0.92);
}

.ap-shutter-inner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #dc2626;
  display: block;
}

.ap-cam-preview-controls {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 380px;
}

.ap-cam-action-btn {
  flex: 1;
  height: 48px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
}

/* =========================================================================
   TOWER CRANE ATTACH PHOTOS - STEP SELECTOR, SPECS & ACCESSORIES
   ========================================================================= */

/* Choose Any Step Dropdown */
.ap-step-select-wrapper {
  margin: 12px 16px 14px 16px;
  position: relative;
}

.ap-step-select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #ffffff;
  border: 1.5px solid #fecaca;
  border-radius: 12px;
  color: #b91c1c;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.05);
}

.ap-step-select-btn:hover {
  background: #fff5f5;
  border-color: #f87171;
}

.ap-step-select-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ap-step-select-arrow {
  transition: transform 0.2s ease;
  font-size: 14px;
}

.ap-step-select-arrow.open {
  transform: rotate(180deg);
}

.ap-step-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  max-height: 340px;
  overflow-y: auto;
  z-index: 100;
  padding: 6px;
}

.ap-step-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ap-step-menu-item:hover {
  background: #f8fafc;
  color: #b91c1c;
}

.ap-step-menu-item.active {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
}

.ap-step-menu-num {
  font-weight: 700;
  min-width: 28px;
  color: inherit;
}

.ap-step-menu-title {
  flex: 1;
  margin-left: 6px;
}

.ap-step-menu-count {
  font-size: 12px;
  color: #64748b;
}

/* Step 10 & 11 Form Fields */
.ap-fields-container {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.ap-spec-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ap-spec-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 2px;
  display: block;
}

.ap-req {
  color: #dc2626;
  font-weight: 700;
}

.ap-spec-input,
.ap-spec-select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 15px;
  color: #1e293b;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.ap-spec-input::placeholder {
  color: #94a3b8;
}

.ap-spec-input::-webkit-outer-spin-button,
.ap-spec-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ap-spec-input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.ap-spec-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

.ap-spec-input:focus,
.ap-spec-select:focus {
  outline: none;
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Item Section Cards inside Steps */
.ap-item-card {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}

.ap-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ap-item-badge-box {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #fee2e2;
  color: #dc2626;
  font-weight: 750;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ap-item-header-info {
  flex: 1;
  min-width: 0;
}

.ap-item-header-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.ap-item-header-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 1px;
}

.ap-item-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  background: #fef3c7;
  color: #b45309;
  white-space: nowrap;
}

.ap-item-status-pill.complete {
  background: #dcfce7;
  color: #15803d;
}

.ap-item-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  margin-bottom: 12px;
}

.ap-item-guide-text {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.ap-item-angle-badge {
  font-size: 12px;
  font-weight: 700;
  color: #dc2626;
}

.ap-item-angles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Step 12 Accessories */
.ap-accessories-container {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.ap-acc-card {
  background: #ffffff;
  border: 1.5px solid #f1f5f9;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ap-acc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.ap-acc-num-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.ap-acc-del-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.ap-acc-del-btn:hover {
  background: #fee2e2;
}

.ap-acc-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.ap-acc-angles {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}

.ap-acc-angles-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ap-acc-angles-badge {
  font-size: 13px;
  font-weight: 700;
  color: #b91c1c;
}

.ap-add-acc-wrapper {
  margin-top: 8px;
  margin-bottom: 24px;
}

.ap-add-acc-btn {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  border: 2px dashed #f87171;
  border-radius: 12px;
  color: #b91c1c;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ap-add-acc-btn:hover {
  background: #fff5f5;
  border-color: #ef4444;
}

/* Step 13 Review & Submit */
.ap-review-container {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.ap-review-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ap-review-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ap-review-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f8fafc;
  font-size: 14px;
}

.ap-review-row:last-child {
  border-bottom: none;
}

.ap-review-label {
  color: #64748b;
}

.ap-review-value {
  color: #1e293b;
  font-weight: 600;
}

.ap-review-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.ap-review-stat-box {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.ap-review-stat-num {
  font-size: 24px;
  font-weight: 800;
  color: #dc2626;
  line-height: 1.2;
}

.ap-review-stat-label {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}
