/* ==============================================================
   The REE Ledger — Add Listing v2
   Continuous with editorial core (navy · cream · sky) · realestate.eg
   Inherits design tokens from /real-eg/css/editorial/core.css
   ============================================================== */

:root{
  /* local aliases to site-wide tokens */
  --l-cream:      var(--ee-cream, #F8FAFC);
  --l-cream-2:    var(--ee-cream-2, #F1F5F9);
  --l-cream-3:    var(--ee-cream-3, #FBFCFD);
  --l-navy:       var(--ee-navy, #0A1929);
  --l-navy-2:     var(--ee-navy-2, #0F1B2C);
  --l-navy-3:     var(--ee-navy-3, #1E3A5F);
  --l-ink:        var(--ee-ink, #334155);
  --l-mute:       var(--ee-mute, #64748B);
  --l-mute-2:     var(--ee-mute-2, #94A3B8);
  --l-line:       var(--ee-line, rgba(10,25,41,.06));
  --l-line-2:     var(--ee-line-2, rgba(10,25,41,.1));
  --l-line-strong: rgba(10,25,41,.18);
  --l-sky:        var(--ee-sky-2, #38BDF8);
  --l-sky-deep:   var(--ee-sky-3, #0369A1);
  --l-red:        #B91C1C;
  --l-red-soft:   #FEE2E2;
  --l-green:      #047857;
  --l-serif:      var(--ee-display, "Cormorant Garamond","Playfair Display","Cairo",Georgia,serif);
  --l-sans:       var(--ee-body,    "Cairo","Plus Jakarta Sans",system-ui,sans-serif);
  --l-mono:       var(--ee-mono,    ui-monospace,"SF Mono",Menlo,monospace);
  --l-italic:     var(--ee-serif-italic, Georgia,"Times New Roman",serif);
  --l-t:          cubic-bezier(.4,0,.2,1);
  --l-radius:     2px;
  --l-radius-lg:  12px;
  --l-radius-pill: 999px;
}

/* ---------- Page shell ---------- */
.ledger-page{
  font-family: var(--l-sans);
  color: var(--l-ink);
  background: var(--l-cream);
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  padding-top: max(96px, calc(var(--ee-header-h, 64px) + 24px));
  padding-bottom: 80px;
}
.ledger-page::before{
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 400px at 85% 5%, rgba(56,189,248,.06), transparent 60%),
    radial-gradient(900px 300px at 8% 90%, rgba(10,25,41,.04), transparent 55%);
  pointer-events: none;
  z-index: -1;
}

.ledger-canvas{
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(20px,4vw,48px);
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 72px;
  align-items: start;
}

/* ==================================================
   LEFT RAIL
   ================================================== */
.ledger-rail{
  position: sticky;
  top: calc(var(--ee-header-h, 64px) + 28px);
  align-self: start;
  padding-inline-end: 28px;
  border-inline-end: 1px solid var(--l-line-2);
}

.ledger-brand .mono-eyebrow,
.mono-eyebrow{
  display: block;
  font-family: var(--l-mono);
  font-size: 10.5px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--l-sky-deep);
}
.ledger-brand .mono-eyebrow{ margin-bottom: 16px; }

.ledger-title{
  font-family: var(--l-serif);
  font-weight: 500;
  font-size: clamp(30px, 2.6vw, 40px);
  line-height: 1.02;
  color: var(--l-navy);
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}
.ledger-title em{
  font-style: italic;
  color: var(--l-sky-deep);
  font-weight: 400;
}
.ledger-sub{
  font-family: var(--l-italic);
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  color: var(--l-mute);
  margin: 0 0 32px;
  max-width: 300px;
}

/* Chapter index */
.ledger-chapters{
  display: flex;
  flex-direction: column;
  margin: 28px 0;
  border-top: 1px solid var(--l-navy);
}
.chap{
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px 2px;
  border-bottom: 1px solid var(--l-line-2);
  text-decoration: none;
  color: var(--l-mute);
  transition: color .3s var(--l-t);
  cursor: pointer;
  outline: none;
}
.chap:hover{ color: var(--l-navy); }
.chap:focus-visible{ outline: 1px solid var(--l-sky); outline-offset: 3px; }
.chap .folio{
  font-family: var(--l-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 34px;
  line-height: 1;
  color: var(--l-mute-2);
  transition: color .3s var(--l-t);
}
.chap-body{ display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chap-name{
  font-family: var(--l-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.15;
  color: inherit;
  letter-spacing: -0.005em;
}
.chap-meta{
  font-family: var(--l-mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--l-mute-2);
}
.chap-marker{
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1px solid var(--l-line-strong);
  background: var(--l-cream);
  transition: all .3s var(--l-t);
  flex-shrink: 0;
  position: relative;
}
.chap.active .folio{ color: var(--l-sky-deep); }
.chap.active .chap-name{ color: var(--l-navy); }
.chap.active .chap-marker{
  background: var(--l-sky-deep);
  border-color: var(--l-sky-deep);
  box-shadow: 0 0 0 4px rgba(3,105,161,.12);
}
.chap.done .folio{ color: var(--l-green); }
.chap.done .chap-name{ color: var(--l-navy-2); }
.chap.done .chap-marker{
  background: var(--l-green);
  border-color: var(--l-green);
}
.chap.done .chap-marker::before{
  content: ""; position: absolute;
  inset: 2px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' fill='none' stroke='white' stroke-width='1.6'><polyline points='1.5 4 3 5.5 6.5 2.5'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Completeness */
.ledger-complete{ margin: 28px 0; }
.ledger-complete .mono-eyebrow{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10.5px;
  margin-bottom: 10px;
  color: var(--l-mute);
  letter-spacing: .24em;
}
.lcomp-pct{
  font-family: var(--l-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--l-navy);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.lcomp-bar{
  height: 2px;
  background: var(--l-line-2);
  position: relative;
  overflow: hidden;
}
.lcomp-fill{
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background: var(--l-sky-deep);
  transition: width .6s var(--l-t);
}
[dir="rtl"] .lcomp-fill{ inset: 0 0 0 auto; }

/* Help block */
.ledger-help{
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--l-line-2);
}
.ledger-help a{
  display: block;
  font-family: var(--l-serif);
  font-size: 22px;
  color: var(--l-navy);
  text-decoration: none;
  margin-top: 6px;
  font-weight: 500;
  letter-spacing: -0.005em;
  direction: ltr;
  text-align: start;
  transition: color .2s var(--l-t);
}
.ledger-help a:hover{ color: var(--l-sky-deep); }

/* ==================================================
   RIGHT STAGE
   ================================================== */
.ledger-stage{ min-width: 0; }

.stage-head{
  margin-bottom: 44px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--l-navy);
}
.stage-folio{
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--l-mono);
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--l-sky-deep);
  margin-bottom: 14px;
}
.stage-folio::before{
  content: ""; width: 28px; height: 1px; background: var(--l-sky-deep);
}
.stage-title{
  font-family: var(--l-serif);
  font-weight: 500;
  font-size: clamp(40px, 5.6vw, 64px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--l-navy);
  margin: 0 0 16px;
}
.stage-title em{
  font-style: italic;
  font-weight: 400;
  color: var(--l-sky-deep);
}
.stage-sub{
  font-family: var(--l-italic);
  font-style: italic;
  font-size: 19px;
  color: var(--l-mute);
  margin: 0;
  max-width: 580px;
  line-height: 1.45;
}

/* ==================================================
   FORM WRAPPER — white card on cream (bento style)
   ================================================== */
.form-wrapper{
  background: #fff;
  border: 1px solid rgba(0,0,0,.04);
  border-radius: var(--l-radius-lg);
  padding: 40px clamp(24px, 3vw, 44px);
  box-shadow: 0 1px 3px rgba(10,25,41,.04), 0 20px 50px -24px rgba(10,25,41,.12);
}

/* ==================================================
   CHAPTERS
   ================================================== */
.chapter{ display: none; }
.chapter.active{ display: block; animation: chapFade .5s var(--l-t); }
@keyframes chapFade{
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.field{ margin-bottom: 38px; }

.field-eyebrow{
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--l-mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--l-mute);
  margin-bottom: 14px;
}
.field-eyebrow .req{
  color: var(--l-red);
  font-size: 14px;
  letter-spacing: 0;
}
.field-eyebrow .optional{
  font-family: var(--l-italic);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12.5px;
  color: var(--l-mute-2);
}

.field-hint{
  font-family: var(--l-italic);
  font-style: italic;
  font-size: 14px;
  color: var(--l-mute);
  margin: 8px 2px 0;
}

.field-error{
  display: none;
  font-family: var(--l-sans);
  font-size: 13px;
  color: var(--l-red);
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--l-red-soft);
  border-inline-start: 2px solid var(--l-red);
  animation: errorShake .3s var(--l-t);
}
.field-error.visible{ display: block; }
@keyframes errorShake{
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ==================================================
   INPUTS
   ================================================== */
.input-line{
  position: relative;
  border-bottom: 1px solid var(--l-line-strong);
  transition: border-color .3s var(--l-t), background .3s var(--l-t);
  padding-inline: 2px;
}
.input-line input,
.input-line select,
.input-line textarea{
  width: 100%;
  font-family: var(--l-serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.4;
  padding: 10px 0 12px;
  background: transparent;
  border: 0;
  color: var(--l-navy);
  outline: none;
}
.input-line input::placeholder{
  color: var(--l-mute-2);
  font-style: italic;
  opacity: 1;
}
.input-line:focus-within{ border-color: var(--l-sky-deep); }
.input-line.has-error{ border-color: var(--l-red); }

.input-line.ltr input,
.input-line.ltr{ direction: ltr; text-align: start; }
[dir="rtl"] .input-line.ltr input{ text-align: right; }
[dir="ltr"] .input-line.ltr input{ text-align: left; }

.input-line.has-suffix{
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.input-line.has-suffix input{ flex: 1; min-width: 0; }
.input-suffix{
  font-family: var(--l-mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--l-mute);
  white-space: nowrap;
  padding-bottom: 4px;
}

.input-line select{
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%230A1929' stroke-width='1.4'><polyline points='1 2 6 7 11 2'/></svg>");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 12px;
  padding-right: 24px;
  cursor: pointer;
}
[dir="rtl"] .input-line select{
  background-position: left 2px center;
  padding-right: 0;
  padding-left: 24px;
}

/* ==================================================
   UNIT TYPE GRID
   ================================================== */
.utype-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--l-line-2);
  border-inline-start: 1px solid var(--l-line-2);
}
.utype{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 26px 14px;
  background: transparent;
  border: 0;
  border-inline-end: 1px solid var(--l-line-2);
  border-bottom: 1px solid var(--l-line-2);
  cursor: pointer;
  position: relative;
  transition: all .25s var(--l-t);
  min-height: 132px;
  text-align: center;
  color: var(--l-navy);
  font-family: var(--l-sans);
}
.utype:hover:not(.dimmed){
  background: var(--l-cream-3);
}
.utype:hover:not(.dimmed) .utype-icon{ color: var(--l-sky-deep); transform: scale(1.08); }
.utype.selected{
  background: var(--l-navy);
  color: var(--l-cream);
}
.utype.selected .utype-icon,
.utype.selected .utype-label{ color: var(--l-cream); }
.utype.selected::after{
  content: "";
  position: absolute;
  top: 10px; inset-inline-end: 10px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--l-sky-deep) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='white' stroke-width='1.8'><polyline points='2 5 4 7 8 3'/></svg>") no-repeat center / 11px;
  animation: tickPop .4s var(--l-t);
  box-shadow: 0 2px 10px rgba(3,105,161,.4);
}
@keyframes tickPop{
  0% { transform: scale(0); }
  65% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.utype.dimmed{ opacity: .28; cursor: not-allowed; pointer-events: none; }
.utype-icon{
  width: 40px; height: 40px;
  color: var(--l-navy);
  transition: all .25s var(--l-t);
  display: flex; align-items: center; justify-content: center;
}
.utype-icon svg{ width: 100%; height: 100%; stroke-width: 1.15; }
.utype-label{
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--l-navy);
  font-family: var(--l-sans);
}

/* ==================================================
   NUMBER PILLS
   ================================================== */
.num-row{
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--l-line-2);
  width: fit-content;
  max-width: 100%;
}
.num-pill{
  min-width: 54px;
  height: 48px;
  background: transparent;
  border: 0;
  border-inline-end: 1px solid var(--l-line-2);
  font-family: var(--l-serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--l-navy);
  cursor: pointer;
  transition: all .2s var(--l-t);
  padding: 0 16px;
}
.num-pill:last-child{ border-inline-end: 0; }
.num-pill:hover{ background: var(--l-cream-3); color: var(--l-sky-deep); }
.num-pill.selected{
  background: var(--l-navy);
  color: var(--l-cream);
}

/* ==================================================
   CHIPS
   ================================================== */
.chip-row{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip{
  background: transparent;
  border: 1px solid var(--l-line-strong);
  border-radius: 999px;
  padding: 10px 22px;
  font-family: var(--l-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--l-navy);
  cursor: pointer;
  transition: all .25s var(--l-t);
}
.chip:hover{
  border-color: var(--l-navy);
  background: var(--l-cream-3);
}
.chip.selected{
  background: var(--l-navy);
  color: var(--l-cream);
  border-color: var(--l-navy);
}

/* ==================================================
   PRICE/AREA ROW
   ================================================== */
.field-row-2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 38px;
}
.field-row-2 > .field{ margin-bottom: 0; }

.calc-display{
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 20px;
  background: var(--l-cream-2);
  border: 1px dashed var(--l-line-strong);
  border-radius: var(--l-radius-lg);
}
.calc-display .mono-eyebrow{
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--l-mute);
}
.calc-display .calc-value{
  font-family: var(--l-serif);
  font-style: italic;
  font-size: 26px;
  color: var(--l-navy);
  margin-top: 4px;
  font-weight: 500;
}
.calc-display .calc-currency{
  font-family: var(--l-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--l-mute);
  margin-inline-start: 6px;
}

/* ==================================================
   PHOTO UPLOAD
   ================================================== */
.dropzone{
  position: relative;
  border: 2px dashed var(--l-line-strong);
  border-radius: var(--l-radius-lg);
  background: var(--l-cream-2);
  padding: 52px 28px;
  text-align: center;
  transition: all .3s var(--l-t);
  cursor: pointer;
}
.dropzone:hover,
.dropzone.drag-over{
  border-color: var(--l-sky-deep);
  background: rgba(56,189,248,.06);
}
.dropzone input[type="file"]{
  position: absolute; inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.dz-illu{
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  color: var(--l-sky-deep);
}
.dz-illu svg{ width: 100%; height: 100%; stroke-width: 1.1; }
.dz-title{
  font-family: var(--l-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 24px;
  color: var(--l-navy);
  margin: 0 0 8px;
  letter-spacing: -0.005em;
}
.dz-sub{
  font-family: var(--l-sans);
  font-size: 13px;
  color: var(--l-mute);
  margin: 0;
  line-height: 1.55;
}
.dz-sub b{ color: var(--l-navy); font-weight: 500; }

.dropzone.has-files{
  padding: 24px 20px;
}
.dropzone.has-files .dz-illu{ width: 42px; height: 42px; margin-bottom: 10px; }
.dropzone.has-files .dz-title{ font-size: 17px; margin-bottom: 4px; }
.dropzone.has-files .dz-sub{ font-size: 12px; }

/* Photo grid */
.photo-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.photo-card{
  position: relative;
  aspect-ratio: 4/3;
  background: var(--l-cream-2);
  overflow: hidden;
  border: 1px solid var(--l-line-2);
  border-radius: var(--l-radius);
  cursor: grab;
  transition: all .25s var(--l-t);
  animation: photoIn .4s var(--l-t);
}
@keyframes photoIn{
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
.photo-card.dragging{ opacity: .3; }
.photo-card.drop-target{ border: 2px dashed var(--l-sky-deep); }
.photo-card img{
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--l-t);
}
.photo-card:hover img{ transform: scale(1.04); }
.pc-num{
  position: absolute;
  top: 8px; inset-inline-start: 8px;
  background: var(--l-navy);
  color: var(--l-cream);
  font-family: var(--l-mono);
  font-size: 10px;
  letter-spacing: .14em;
  padding: 3px 8px;
  text-transform: uppercase;
  z-index: 2;
}
.photo-card.primary .pc-num{ background: var(--l-sky-deep); }
.pc-remove{
  position: absolute;
  top: 8px; inset-inline-end: 8px;
  width: 28px; height: 28px;
  background: rgba(10,25,41,.85);
  border: 0;
  color: var(--l-cream);
  cursor: pointer;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.8);
  transition: all .2s var(--l-t);
  z-index: 3;
}
.photo-card:hover .pc-remove{ opacity: 1; transform: scale(1); }
.pc-remove:hover{ background: var(--l-red); }

.photo-card.uploading{ cursor: default; }
.photo-card.uploading::before{
  content: "";
  position: absolute; inset: 0;
  background: rgba(10,25,41,.55);
  z-index: 1;
}
.pc-progress{
  position: absolute; inset: auto 0 0 0;
  height: 2px;
  background: rgba(255,255,255,.25);
  z-index: 2;
}
.pc-progress::after{
  content: "";
  position: absolute; inset: 0 auto 0 0;
  width: var(--pc-progress, 0%);
  background: var(--l-sky);
  transition: width .2s var(--l-t);
}
[dir="rtl"] .pc-progress::after{ inset: 0 0 0 auto; }
.pc-status{
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--l-cream);
  font-family: var(--l-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  z-index: 2;
  gap: 8px;
  padding: 10px;
  text-align: center;
}
.pc-status .pc-status-row{ display: inline-flex; align-items: center; gap: 8px; }
.photo-card.failed::before{ background: rgba(185,28,28,.75); }
.pc-retry{
  margin-top: 6px;
  background: var(--l-cream);
  color: var(--l-red);
  border: 0;
  padding: 5px 12px;
  font-family: var(--l-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
}
.mini-spinner{
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: var(--l-cream);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin{ to { transform: rotate(360deg); } }

/* Honeypot */
.hp-field{
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  width: 1px; height: 1px;
  pointer-events: none;
}

/* ==================================================
   STAGE NAV
   ================================================== */
.stage-nav{
  margin-top: 52px;
  padding-top: 26px;
  border-top: 1px solid var(--l-line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.lbtn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--l-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .3s var(--l-t);
  background: transparent;
  color: var(--l-navy);
  border-radius: var(--l-radius-pill);
}
.lbtn svg{ width: 14px; height: 14px; transition: transform .25s var(--l-t); }

.lbtn-ghost{
  color: var(--l-mute);
  font-family: var(--l-italic);
  font-style: italic;
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0;
  padding: 14px 6px;
  font-weight: 400;
}
.lbtn-ghost:hover{ color: var(--l-navy); }
.lbtn-ghost:hover svg{ transform: translateX(-3px); }
[dir="rtl"] .lbtn-ghost:hover svg{ transform: translateX(3px); }

.lbtn-next,
.lbtn-submit{
  background: var(--l-navy);
  color: var(--l-cream);
  padding: 15px 32px;
  font-size: 12.5px;
  border-radius: var(--l-radius-pill);
  box-shadow: 0 1px 2px rgba(10,25,41,.18), 0 8px 18px -6px rgba(10,25,41,.4), inset 0 0 0 1px rgba(255,255,255,.1);
}
.lbtn-next:hover,
.lbtn-submit:hover{
  background: var(--l-sky-deep);
  box-shadow: 0 6px 18px -6px rgba(3,105,161,.55);
}
.lbtn-next:hover svg{ transform: translateX(4px); }
[dir="rtl"] .lbtn-next:hover svg{ transform: translateX(-4px); }
.lbtn-submit{ background: var(--l-sky-deep); }
.lbtn-submit:hover{ background: var(--l-navy); }
.lbtn-submit[disabled]{ opacity: .6; cursor: progress; }
.lbtn-submit .btn-spin{ display: none; }
.lbtn-submit.loading .btn-text{ display: none; }
.lbtn-submit.loading .btn-spin{ display: inline-flex; align-items: center; gap: 10px; }

/* ==================================================
   PORTAL DROPDOWN
   ================================================== */
.ledger-dropdown{
  position: fixed;
  z-index: 99999;
  background: #fff;
  border: 1px solid var(--l-navy);
  box-shadow: 0 20px 50px -20px rgba(10,25,41,.4), 0 4px 8px rgba(10,25,41,.08);
  max-height: 360px;
  overflow-y: auto;
  min-width: 280px;
  display: none;
  border-radius: var(--l-radius-lg);
  font-family: var(--l-sans);
}
.ledger-dropdown.open{ display: block; animation: ddOpen .22s var(--l-t); }
@keyframes ddOpen{
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dd-item{
  padding: 12px 18px;
  font-size: 14px;
  color: var(--l-navy);
  cursor: pointer;
  border-bottom: 1px solid var(--l-line);
  transition: all .15s var(--l-t);
  font-weight: 500;
}
.dd-item:last-child{ border-bottom: 0; }
.dd-item:hover,
.dd-item.highlighted{
  background: var(--l-navy);
  color: var(--l-cream);
}
.dd-empty{
  padding: 22px;
  text-align: center;
  font-family: var(--l-italic);
  font-style: italic;
  color: var(--l-mute);
  font-size: 15px;
}
.dd-loading{
  padding: 20px;
  text-align: center;
  color: var(--l-mute);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.dd-loading .mini-spinner{
  border-color: var(--l-line-2);
  border-top-color: var(--l-sky-deep);
}

/* Project badge */
.proj-badge{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--l-navy);
  color: var(--l-cream);
  border-radius: var(--l-radius-lg);
  font-family: var(--l-sans);
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
}
.proj-clear{
  background: transparent; border: 0;
  color: var(--l-cream);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  padding: 0; opacity: .7;
}
.proj-clear:hover{ opacity: 1; color: #FCA5A5; }

/* ==================================================
   SUCCESS SCREEN
   ================================================== */
.ledger-success{
  text-align: center;
  padding: 32px 20px 48px;
  animation: successIn .75s var(--l-t);
}
@keyframes successIn{
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.success-seal{
  width: 150px; height: 150px;
  border: 2px solid var(--l-green);
  border-radius: 50%;
  margin: 0 auto 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: var(--l-mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--l-green);
  position: relative;
}
.success-seal::before{
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px dashed var(--l-green);
  border-radius: 50%;
  opacity: .45;
}
.seal-big{
  font-family: var(--l-serif);
  font-style: italic;
  font-size: 48px;
  letter-spacing: -0.01em;
  color: var(--l-green);
  font-weight: 500;
  line-height: 1;
  margin: 6px 0 2px;
}
.success-title{
  font-family: var(--l-serif);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1;
  color: var(--l-navy);
  margin: 0 0 14px;
  letter-spacing: -0.015em;
}
.success-title em{ font-style: italic; color: var(--l-sky-deep); font-weight: 400; }
.success-message{
  font-family: var(--l-italic);
  font-style: italic;
  font-size: 19px;
  color: var(--l-mute);
  max-width: 520px;
  margin: 0 auto 28px;
  line-height: 1.5;
}
.success-ref-label{
  font-family: var(--l-mono);
  font-size: 10.5px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--l-mute);
  margin-bottom: 8px;
}
.success-ref-code{
  font-family: var(--l-mono);
  font-size: 22px;
  color: var(--l-navy);
  letter-spacing: .14em;
  border: 1px solid var(--l-line-strong);
  padding: 10px 24px;
  display: inline-block;
  margin-bottom: 28px;
  background: var(--l-cream-2);
}
.success-actions{
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.success-actions a{
  padding: 13px 28px;
  font-family: var(--l-sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all .25s var(--l-t);
  border: 1px solid var(--l-navy);
  color: var(--l-navy);
  background: transparent;
  border-radius: var(--l-radius-lg);
}
.success-actions a.primary{
  background: var(--l-navy);
  color: var(--l-cream);
}
.success-actions a:hover{
  background: var(--l-sky-deep);
  color: var(--l-cream);
  border-color: var(--l-sky-deep);
}

/* ==================================================
   TOAST
   ================================================== */
.ledger-toast{
  position: fixed;
  top: calc(var(--ee-header-h, 64px) + 20px);
  inset-inline-end: 20px;
  background: var(--l-navy);
  color: var(--l-cream);
  padding: 14px 22px;
  font-family: var(--l-sans);
  font-size: 14px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.4);
  z-index: 99999;
  max-width: 380px;
  transform: translateX(120%);
  transition: transform .35s var(--l-t);
  border-inline-start: 3px solid var(--l-sky-deep);
  border-radius: var(--l-radius-lg);
}
[dir="rtl"] .ledger-toast{ transform: translateX(-120%); }
.ledger-toast.show{ transform: translateX(0); }
.ledger-toast.error{ border-inline-start-color: var(--l-red); }
.ledger-toast.success{ border-inline-start-color: var(--l-green); }

/* ==================================================
   RESPONSIVE
   ================================================== */
@media (max-width: 1100px){
  .ledger-canvas{ grid-template-columns: 260px 1fr; gap: 44px; }
  .utype-grid{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px){
  .ledger-page{
    padding-top: max(72px, calc(var(--ee-header-h, 64px) + 10px));
    padding-bottom: 112px; /* room for mobile bottom nav */
  }
  .ledger-canvas{
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 0 clamp(16px, 4vw, 28px);
  }
  .ledger-rail{
    position: static;
    padding: 0 0 18px;
    border-inline-end: 0 !important;
    border-bottom: 1px solid var(--l-line-2);
  }
  .ledger-brand .mono-eyebrow{ margin-bottom: 10px; }
  .ledger-title{ font-size: clamp(24px, 6.5vw, 32px); margin-bottom: 10px; }
  .ledger-sub{ font-size: 14.5px; line-height: 1.45; margin-bottom: 16px; max-width: 100%; }
  .ledger-chapters{ margin: 12px 0; }
  .chap{ padding: 10px 2px; grid-template-columns: 28px 1fr auto; gap: 8px; }
  .chap .folio{ font-size: 20px; }
  .chap-name{ font-size: 14px; line-height: 1.35; }
  .chap-meta{ display: none; } /* hide step descriptions to save space */
  .lcomp{ padding-top: 12px; padding-bottom: 4px; }
  .lcomp-pct{ font-size: 14px; }
  .ledger-help{ display: none; }
  .stage-head{ margin-bottom: 22px; padding-bottom: 16px; }
  .stage-folio{ font-size: 10px; }
  .stage-title{ font-size: clamp(26px, 7vw, 34px); }
  .stage-sub{ font-size: 15px; }
  .field{ margin-bottom: 24px; }
  .field-row-2{ grid-template-columns: 1fr; gap: 20px; margin-bottom: 24px; }
  .utype-grid{ grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .utype{ min-height: 96px; padding: 14px 6px; gap: 6px; }
  .utype-icon{ width: 28px; height: 28px; }
  .utype-label{ font-size: 11.5px; line-height: 1.25; }
  .input-line input, .input-line select, .input-line textarea{ font-size: 16px; } /* ≥16 prevents iOS zoom */
  .stage-nav{ margin-top: 28px; padding-top: 18px; }
  .lbtn-next, .lbtn-submit{ padding: 13px 22px; font-size: 12px; }
  .dropzone{ padding: 32px 16px; }
  .dz-illu{ width: 52px; height: 52px; }
  .dz-title{ font-size: 18px; }
}
@media (max-width: 560px){
  .ledger-page{ padding-top: max(64px, calc(var(--ee-header-h, 56px) + 8px)); }
  .ledger-title{ font-size: clamp(22px, 6.4vw, 28px); }
  .ledger-sub{ font-size: 14px; margin-bottom: 14px; }
  .chap{ padding: 9px 2px; grid-template-columns: 26px 1fr auto; gap: 6px; }
  .chap .folio{ font-size: 18px; }
  .chap-name{ font-size: 13.5px; }
  .stage-head{ margin-bottom: 18px; padding-bottom: 14px; }
  .stage-title{ font-size: clamp(24px, 6.4vw, 30px); }
  .stage-sub{ font-size: 14px; }
  .utype-grid{ grid-template-columns: repeat(2, 1fr); }
  .utype{ min-height: 92px; }
  .utype-label{ font-size: 12.5px; }
  .photo-grid{ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
  .num-pill{ min-width: 44px; height: 44px; font-size: 17px; padding: 0 10px; }
  .ledger-canvas{ padding: 0 14px; }
}
@media (max-width: 380px){
  .ledger-title{ font-size: 20px; }
  .stage-title{ font-size: 22px; }
  .utype{ min-height: 84px; padding: 12px 4px; }
  .utype-label{ font-size: 11.5px; }
  .lbtn-next, .lbtn-submit{ padding: 12px 18px; font-size: 11.5px; }
}

.sr-only{
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
