/* Lagnacha Biodata – app shell.
   Every selector is scoped under .lb-app (two classes deep) so theme
   styles cannot override our components. Layout responds to the width the
   theme gives us (container queries), not just the screen width. */

.lb-app {
  --lb-bg: #FFFDF9;
  --lb-panel: #FFF7EC;
  --lb-text: #2A1A14;
  --lb-muted: #6B5A50;
  --lb-border: #EADFD3;
  --lb-accent: #7B1E2E;
  --lb-gold: #B8862B;
  --lb-gold-ink: #85601C; /* darker gold for small text, keeps contrast */
  --lb-success: #1F6B43;
  --lb-radius: 16px;
  --lb-radius-sm: 12px;
  --lb-touch: 44px;
  --lb-top-offset: calc(var(--wp-admin--admin-bar--height, 0px) + 16px);
  --lb-font-ui: 'Mukta', 'Noto Sans Devanagari', system-ui, sans-serif;
  --lb-font-bio: 'Tiro Devanagari Marathi', 'Noto Serif Devanagari', serif;

  box-sizing: border-box;
  background: var(--lb-bg);
  color: var(--lb-text);
  font-family: var(--lb-font-ui);
  font-size: 17px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

/* Hold the space the app will fill, so content below doesn't jump when it
   starts (slow connections). The boot-failure box still shows inside it. */
#lagnacha-biodata.lb-app:not([data-booted]) { min-height: 100vh; }

/* The theme's ".alignfull" sets overflow-x: hidden, which turns the app wrapper into a scroll
   container (overflow-y becomes auto) – and position: sticky inside it then never sticks.
   "clip" still stops sideways overflow (100vw width) without creating a scroll container. */
#lagnacha-biodata.lb-app.alignfull { overflow-x: clip; overflow-y: visible; }

/* ---------- Light reset against theme styles ---------- */
.lb-app *, .lb-app *::before, .lb-app *::after { box-sizing: inherit; }
.lb-app :where(h1, h2, h3, p, ol, ul, li, fieldset, legend, figure) {
  margin: 0;
  padding: 0;
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
}
.lb-app :where(ol, ul) { list-style: none; }
.lb-app :where(button, input, select, textarea) {
  font: inherit;
  color: inherit;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: none;
}
.lb-app :where(button) { background: none; border: 0; border-radius: 0; padding: 0; cursor: pointer; white-space: normal; text-align: inherit; transition: none; }
/* Themes style bare elements with one class/attribute + element or pseudo-class
   (Hello: button:hover → pink; Elementor kit: .elementor-kit-N h2 → kit font).
   These are one step stronger than that, yet still lose to our component
   rules, which come later in the cascade with the same or higher specificity. */
.lb-app.lb-app :where(h1, h2, h3, h4) { font-family: var(--lb-font-ui); color: inherit; font-size: inherit; line-height: 1.3; }
.lb-app :where(button):hover,
.lb-app :where(button):focus { background-color: transparent; color: inherit; text-decoration: none; }
.lb-app.lb-app :where(a) { color: inherit; }
.lb-app [id] { scroll-margin-top: var(--lb-top-offset); }
.lb-app [hidden] { display: none !important; }
.lb-app :focus-visible { outline: 2px solid var(--lb-accent); outline-offset: 2px; }

.lb-app .lb-icon { width: 22px; height: 22px; flex: none; }
.lb-app .lb-icon--sm { width: 18px; height: 18px; }
.lb-app .lb-muted { color: var(--lb-muted); font-size: 15px; }

/* "दोन्ही" mode: English line under the Marathi text (inherits colour so it
   stays readable on maroon buttons too). */
.lb-app .lb-alt { display: block; font-size: 0.82em; font-weight: 400; line-height: 1.35; opacity: 0.8; }
.lb-app .lb-badge .lb-alt { display: inline; }
.lb-app .lb-badge .lb-alt::before { content: ' / '; }

/* ---------- Loading skeleton (rendered by PHP before JS runs) ---------- */
.lb-app .lb-boot { display: grid; gap: 14px; max-width: 1200px; min-height: 70vh; margin: 0 auto; padding: 24px 16px; }
.lb-app .lb-boot__bar { display: block; height: 22px; width: 40%; border-radius: 8px; background: var(--lb-panel); }
.lb-app .lb-boot__bar--wide { width: 70%; height: 34px; }
.lb-app .lb-boot__card { display: block; height: 320px; border-radius: var(--lb-radius); background: var(--lb-panel); }

/* Shown by the PHP boot guard when the app could not start (old browser, no network). */
.lb-app .lb-boot-fail {
  max-width: 560px;
  margin: 24px auto;
  padding: 20px;
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius);
  background: var(--lb-panel);
  text-align: center;
}
.lb-app .lb-boot-fail p { margin: 0 0 8px; }
.lb-app .lb-boot-fail__title { font-size: 19px; font-weight: 600; color: var(--lb-accent); }
.lb-app .lb-boot-fail__en { color: var(--lb-muted); font-size: 15px; }
.lb-app .lb-boot-fail__btn {
  min-height: var(--lb-touch);
  margin-top: 8px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--lb-radius-sm);
  background: var(--lb-accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Page container ---------- */
.lb-app .lb-main {
  container: lb / inline-size;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

/* ---------- Header ---------- */
.lb-app .lb-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--lb-border);
}
.lb-app .lb-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--lb-accent);
  font-size: 20px;
  font-weight: 700;
}
.lb-app .lb-header__mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--lb-gold);
  border-radius: 50%;
}
.lb-app .lb-header__mark::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lb-accent);
}
/* Without the brand line (site header shows it): trust text left, languages right. */
.lb-app .lb-header__trust:first-child { order: 0; width: auto; flex: 1 1 200px; }
.lb-app .lb-header__trust {
  order: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  color: var(--lb-success);
  font-size: 15px;
  font-weight: 600;
}

.lb-app .lb-lang {
  display: inline-flex;
  border: 1px solid var(--lb-border);
  border-radius: 999px;
  background: var(--lb-panel);
  overflow: hidden;
}
.lb-app .lb-lang__btn {
  min-width: 64px;
  min-height: var(--lb-touch);
  padding: 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--lb-muted);
}
/* The group clips overflow, so draw focus rings inside the buttons. */
.lb-app .lb-lang__btn:focus-visible { outline-offset: -4px; border-radius: 999px; }
.lb-app .lb-lang__btn[aria-pressed="true"]:focus-visible { outline-color: #fff; }
.lb-app #lb-preview:focus-visible { outline-offset: -2px; }
.lb-app .lb-lang__btn[aria-pressed="true"] {
  background: var(--lb-accent);
  color: #fff;
  border-radius: 999px;
}

/* ---------- Hero ---------- */
.lb-app .lb-hero { padding: 24px 0 8px; }
.lb-app .lb-hero__title {
  font-size: 30px; /* fallback for browsers without container units */
  font-size: clamp(26px, 5cqi, 40px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--lb-text);
}
.lb-app .lb-hero__subtitle { max-width: 640px; margin-top: 8px; color: var(--lb-muted); font-size: 18px; }
.lb-app .lb-hero__start { margin: 24px 0 12px; font-size: 18px; font-weight: 600; }

.lb-app .lb-start-grid { display: grid; gap: 12px; }

.lb-app .lb-start {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius);
  background: var(--lb-panel);
  text-align: left;
}
.lb-app .lb-start__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--lb-touch);
  height: var(--lb-touch);
  border-radius: 50%;
  background: var(--lb-bg);
  border: 1px solid var(--lb-border);
  color: var(--lb-gold-ink);
}
.lb-app .lb-start__text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.lb-app .lb-start__title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.lb-app .lb-start__desc { color: var(--lb-muted); font-size: 15px; line-height: 1.4; }

.lb-app .lb-start--active { border: 1.5px solid var(--lb-accent); background: var(--lb-bg); }
.lb-app .lb-start--active .lb-start__icon { background: var(--lb-accent); border-color: var(--lb-accent); color: #fff; }
.lb-app .lb-start--active:hover { background: var(--lb-panel); }
.lb-app .lb-start__cta { display: inline-flex; align-items: center; gap: 4px; color: var(--lb-accent); font-weight: 700; white-space: nowrap; }

.lb-app .lb-start--soon { cursor: default; }
.lb-app .lb-start--soon .lb-start__title,
.lb-app .lb-start--soon .lb-start__icon { color: var(--lb-muted); }

.lb-app .lb-badge {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 1px 10px;
  border: 1px solid var(--lb-gold);
  border-radius: 999px;
  background: var(--lb-bg);
  color: var(--lb-gold-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.lb-app .lb-badge--free { border-color: var(--lb-success); color: var(--lb-success); }

/* ---------- Step bar ---------- */
.lb-app .lb-steps { margin: 24px 0 16px; }
.lb-app .lb-steps__list { display: flex; align-items: center; }
.lb-app .lb-steps__item { display: flex; align-items: center; flex: 1; }
.lb-app .lb-steps__item:last-child { flex: none; }
.lb-app .lb-steps__item:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 1px;
  margin: 0 8px;
  background: var(--lb-border);
}
.lb-app .lb-steps__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--lb-touch);
  padding: 0 4px;
  color: var(--lb-muted);
  font-weight: 600;
  white-space: nowrap;
}
.lb-app .lb-steps__num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--lb-border);
  border-radius: 50%;
  background: var(--lb-panel);
  font-size: 15px;
}
.lb-app .lb-steps__btn[aria-current="step"] { color: var(--lb-accent); }
.lb-app .lb-steps__btn[aria-current="step"] .lb-steps__num { background: var(--lb-accent); border-color: var(--lb-accent); color: #fff; }

/* ---------- Two columns ---------- */
.lb-app .lb-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }

.lb-app .lb-card {
  padding: 20px 16px;
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius);
  background: var(--lb-panel);
}
.lb-app .lb-card__title { font-size: 22px; font-weight: 700; line-height: 1.3; }
.lb-app .lb-note { margin-top: 4px; color: var(--lb-success); font-size: 15px; }
.lb-app .lb-note.is-error { color: var(--lb-accent); }
.lb-app .lb-preset { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 4px; padding: 10px 14px; border: 1px solid var(--lb-border); border-left: 4px solid var(--lb-gold); border-radius: 10px; background: var(--lb-panel); }
.lb-app .lb-preset[hidden] { display: none; }
.lb-app .lb-preset__text { flex: 1 1 260px; margin: 0; font-size: 15px; line-height: 1.5; }
.lb-app .lb-preset__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lb-app .lb-section-title { font-size: 17px; font-weight: 600; }

/* ---------- Form ---------- */
.lb-app .lb-item__head .lb-field__label { min-width: 0; overflow-wrap: anywhere; }
.lb-app .lb-field__label { font-size: 16px; font-weight: 600; }
.lb-app .lb-input {
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-sm);
  background: var(--lb-bg);
  color: var(--lb-text);
  font-size: 18px; /* 16px+ stops mobile browsers zooming on focus */
  line-height: 1.4;
}
.lb-app .lb-input::placeholder { color: var(--lb-muted); opacity: 1; } /* full opacity keeps 4.5:1 contrast */
/* :focus-within also covers the calendar/clock button inside date and time inputs. */
.lb-app .lb-input:focus,
.lb-app .lb-input:focus-within { border-color: var(--lb-accent); outline: 2px solid var(--lb-accent); outline-offset: 0; }

/* ---------- Right column: preview, templates, download ---------- */
.lb-app .lb-side { min-width: 0; }
.lb-app .lb-side__sticky { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
/* Design + download: under the preview on phones, under the form on wide screens. */
.lb-app .lb-extras { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
/* Compact actions under the sticky preview – wide screens only (phones have the bottom bar). */
.lb-app .lb-side__actions { display: none; }

.lb-app .lb-preview {
  padding: 14px;
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius);
  background: var(--lb-panel);
}
.lb-app .lb-preview__head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.lb-app .lb-preview__title { margin-right: auto; font-size: 17px; font-weight: 600; }
.lb-app .lb-preview__expand { margin: -6px -8px -6px 0; }
.lb-app #lb-preview .lb-sheets { max-width: 380px; margin: 0 auto; }
@media (max-width: 899px) {
  .lb-app #lb-preview { cursor: zoom-in; }
}

/* Template strip: live thumbnails, swipe sideways on phones. */
.lb-app .lb-templates__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.lb-app .lb-templates__hint { font-size: 14px; }
.lb-app .lb-strip {
  display: flex;
  gap: 10px;
  margin: 8px -4px 0;
  padding: 4px 4px 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.lb-app .lb-thumb {
  display: grid;
  justify-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 4px;
  border-radius: var(--lb-radius-sm);
  scroll-snap-align: start;
  text-align: center;
}
/* 92px page + border; height reserved so nothing jumps when thumbnails appear. */
.lb-app .lb-thumb__sheets.lb-sheets { width: 94px; min-height: 132px; border-radius: 6px; background: var(--lb-panel); --sheet-scale: 0.1159; }
.lb-app .lb-thumb .lb-sheet { border-radius: 6px; }
.lb-app .lb-thumb[aria-pressed="true"] .lb-sheet { outline: 2px solid var(--lb-accent); outline-offset: 2px; }
.lb-app .lb-thumb__name {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100px;
  min-height: 24px;
  color: var(--lb-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}
.lb-app .lb-thumb__check { display: none; }
.lb-app .lb-thumb[aria-pressed="true"] .lb-thumb__name { color: var(--lb-accent); }
.lb-app .lb-thumb[aria-pressed="true"] .lb-thumb__check { display: block; }

.lb-app .lb-design { display: grid; gap: 10px; margin-top: 12px; }

/* Header picture styles (design-options.js): radio buttons shown as small thumbnails. */
.lb-app .lb-styles { min-width: 0; margin: 0; padding: 0; border: 0; }
.lb-app .lb-styles[hidden] { display: none; }
.lb-app .lb-styles__list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.lb-app .lb-style { position: relative; display: grid; justify-items: center; gap: 2px; width: 72px; cursor: pointer; }
.lb-app .lb-style__input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
.lb-app .lb-style__pic {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 64px;
  height: 76px;
  padding: 4px;
  border: 1.5px solid var(--lb-border);
  border-radius: var(--lb-radius-sm);
  background: #FFFFFF;
  color: var(--lb-muted);
}
.lb-app .lb-style__pic img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-app .lb-style__name { color: var(--lb-muted); font-size: 13px; line-height: 1.3; text-align: center; }
.lb-app .lb-style:hover .lb-style__pic { border-color: var(--lb-accent); }
.lb-app .lb-style__input:checked + .lb-style__pic { border: 2.5px solid var(--lb-accent); background: var(--lb-panel); }
.lb-app .lb-style__input:checked ~ .lb-style__name { color: var(--lb-accent); font-weight: 600; }
.lb-app .lb-style__input:focus-visible + .lb-style__pic { outline: 2px solid var(--lb-accent); outline-offset: 2px; }

/* ---------- Full-screen preview (phones) ---------- */
html.lb-no-scroll, html.lb-no-scroll body { overflow: hidden; }
.lb-app .lb-full {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  background: #EFE7DD;
}
.lb-app .lb-full__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 16px;
  border-bottom: 1px solid var(--lb-border);
  background: var(--lb-bg);
}
.lb-app .lb-full__title { margin-right: auto; font-size: 18px; font-weight: 700; }
.lb-app .lb-full__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 12px; }
.lb-app .lb-full__body .lb-sheets { max-width: 640px; margin: 0 auto; }
.lb-app .lb-full__body .lb-sheet { border: 0; }
.lb-app .lb-full__templates {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  overflow-x: auto;
  border-top: 1px solid var(--lb-border);
  background: var(--lb-bg);
}
.lb-app .lb-chip-btn {
  flex: none;
  min-height: var(--lb-touch);
  padding: 0 16px;
  border: 1px solid var(--lb-border);
  border-radius: 999px;
  background: var(--lb-bg);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.lb-app .lb-chip-btn[aria-pressed="true"] { border-color: var(--lb-accent); background: var(--lb-accent); color: #fff; }

.lb-app .lb-download__head { display: flex; align-items: center; gap: 8px; }
.lb-app .lb-download__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.lb-app .lb-download__note { margin-top: 6px; font-size: 14px; }
.lb-app .lb-download__actions .lb-btn { padding: 0 10px; }
.lb-app .lb-download__png { display: grid; gap: 10px; }
.lb-app .lb-download__png .lb-btn { width: 100%; }
.lb-app .lb-download__png.is-multi { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.lb-app .lb-download__wa { width: 100%; margin-top: 8px; border-color: var(--lb-success); color: var(--lb-success); }
.lb-app .lb-btn--share { grid-column: 1 / -1; border-color: var(--lb-success); background: var(--lb-success); color: #fff; }
.lb-app #lb-download-bar.is-busy .lb-btn { cursor: progress; }
.lb-app .lb-download__status { margin-top: 8px; font-size: 15px; font-weight: 600; color: var(--lb-muted); }
.lb-app .lb-download__status:empty { display: none; }
/* "बायोडाटा आवडला?" card after the first download (feedback.js) */
.lb-app .lb-feedback { margin-top: 12px; padding: 12px; border: 1px solid var(--lb-border); border-radius: var(--lb-radius-sm); background: var(--lb-panel); }
.lb-app .lb-feedback__q { margin: 0 0 8px; font-weight: 600; color: var(--lb-text); }
.lb-app .lb-feedback__votes { display: flex; gap: 8px; }
.lb-app .lb-feedback__vote { min-width: var(--lb-touch); min-height: var(--lb-touch); font-size: 22px; }
.lb-app .lb-feedback__vote[aria-pressed="true"] { border-color: var(--lb-accent); box-shadow: inset 0 0 0 1px var(--lb-accent); }
.lb-app .lb-feedback__more { display: grid; gap: 6px; margin-top: 10px; }
.lb-app .lb-feedback__more[hidden], .lb-app .lb-feedback__votes[hidden] { display: none; }
.lb-app .lb-feedback__more label { font-weight: 600; }
.lb-app .lb-feedback__more textarea { width: 100%; box-sizing: border-box; min-height: 72px; padding: 8px 10px; border: 1px solid var(--lb-border); border-radius: var(--lb-radius-sm); font: inherit; font-size: 16px; resize: vertical; }
.lb-app .lb-feedback__warn { margin: 0; color: var(--lb-text); font-size: 14px; }
.lb-app .lb-feedback__count { margin: 0; color: var(--lb-muted); font-size: 13px; text-align: right; }
.lb-app .lb-feedback__status { margin: 8px 0 0; font-weight: 600; }
.lb-app .lb-feedback__status:empty { display: none; }
/* After a 👍: permission to show it on the website + optional first name / city */
.lb-app .lb-feedback__share { display: grid; gap: 6px; }
.lb-app .lb-feedback__share[hidden], .lb-app .lb-feedback__who[hidden] { display: none; }
.lb-app .lb-feedback__consent { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 0; }
.lb-app .lb-feedback__consent input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--lb-accent); }
.lb-app .lb-feedback__who { display: grid; gap: 6px; }
.lb-app .lb-feedback__who p { margin: 0; display: grid; gap: 2px; }
.lb-app .lb-feedback__who input { min-height: var(--lb-touch); padding: 6px 10px; border: 1px solid var(--lb-border); border-radius: var(--lb-radius-sm); font: inherit; font-size: 16px; background: #fff; }
.lb-app .lb-feedback__note { color: var(--lb-muted); font-size: 14px; }
/* "No catch" strip under the start cards and in the download section (trustHtml in app.js) */
.lb-app .lb-trust-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--lb-text); font-size: 15px; font-weight: 600; line-height: 1.4; }
.lb-app .lb-download .lb-trust-strip { justify-content: flex-start; margin: 0 0 12px; }
.lb-app .lb-trust-strip__item { display: inline-flex; align-items: center; gap: 6px; }
.lb-app .lb-trust-strip__item .lb-icon { color: var(--lb-success); }
.lb-app .lb-trust-strip .lb-alt { display: inline; margin-left: 6px; color: var(--lb-muted); font-size: 13px; font-weight: 400; }
.lb-app .lb-feedback__hp, .lb-app .lb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lb-app .lb-download__status.is-ok { color: var(--lb-success); }
.lb-app .lb-download__status.is-error { color: var(--lb-accent); }

/* Off-screen copy of the pages at real size, used only while exporting. */
.lb-app .lb-export.lb-sheets {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 794px;
  contain: none;
  pointer-events: none;
  --sheet-scale: 1;
}
.lb-app .lb-export .lb-sheet { border: 0; border-radius: 0; }

/* ---------- Buttons ---------- */
.lb-app .lb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-sm);
  background: var(--lb-bg);
  color: var(--lb-text);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}
.lb-app .lb-btn--primary { border-color: var(--lb-accent); background: var(--lb-accent); color: #fff; }
.lb-app .lb-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Mobile sticky bottom bar ---------- */
.lb-app .lb-mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--lb-border);
  background: var(--lb-bg);
}
@media (max-width: 899px) {
  .lb-app { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  /* While typing, the keyboard is up: hide the bar so it never covers the field. */
  .lb-app:has(.lb-main :is(input, textarea, select):focus) .lb-mobile-bar { display: none; }
  /* Feedback card: the bar must not pop back up under the finger when "पाठवा" is tapped right after
     typing, and the form is scrolled to sit above the bar's area (iOS does not focus tapped buttons). */
  .lb-app:has(.lb-feedback:focus-within) .lb-mobile-bar { display: none; }
  .lb-app .lb-feedback__more { scroll-margin-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .lb-app *, .lb-app *::before, .lb-app *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media (min-width: 900px) {
  .lb-app .lb-mobile-bar { display: none; }
}

/* ---------- Wider containers ---------- */
@container lb (min-width: 560px) {
  .lb-app .lb-start-grid { grid-template-columns: 1fr 1fr; }
  .lb-app .lb-card { padding: 24px; }
}

@container lb (min-width: 720px) {
  .lb-app .lb-header__trust { order: 0; width: auto; }
}

@container lb (min-width: 900px) {
  .lb-app .lb-start-grid { grid-template-columns: repeat(4, 1fr); }
  .lb-app .lb-start { flex-direction: column; align-items: flex-start; min-height: 0; padding: 18px; }
  .lb-app .lb-start__cta { margin-top: auto; }
  .lb-app .lb-start--soon .lb-badge { position: absolute; top: 14px; right: 14px; }

  /* Form + design/download on the left; the preview column spans both rows, so it stays
     beside the user from the first field down to the download buttons. */
  .lb-app .lb-columns {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
    grid-template-areas: "form side" "extras side";
    align-items: start;
  }
  .lb-app .lb-form { grid-area: form; }
  .lb-app .lb-extras { grid-area: extras; }
  .lb-app .lb-side { grid-area: side; align-self: stretch; }
  /* Sticky preview: fits the screen (whole A4 page visible); never taller than the viewport. */
  .lb-app .lb-side__sticky {
    position: sticky;
    top: var(--lb-top-offset);
    max-height: calc(100vh - var(--lb-top-offset) - 16px);
    gap: 12px;
  }
  /* The preview box: visible height minus its heading, the card padding and the action row.
     Page 2+ scroll inside this box (the live highlight scrolls it to the edited line). */
  .lb-app #lb-preview {
    max-height: calc(100vh - var(--lb-top-offset) - 16px - 140px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .lb-app #lb-preview .lb-sheets { max-width: max(220px, min(100%, calc((100vh - var(--lb-top-offset) - 166px) * 0.7071))); }
  .lb-app .lb-side__actions { display: flex; gap: 10px; }
  .lb-app .lb-side__actions .lb-btn { flex: 1 1 0; min-width: 0; justify-content: center; }
}

/* ---------- Live highlight (preview-highlight.js) ---------- */
.lb-app .lb-page__row,
.lb-app .lb-page__name,
.lb-app .lb-page__photo { transition: background-color 0.6s ease, box-shadow 0.6s ease; border-radius: 4px; }
.lb-app .lb-page [data-field].is-highlight { background-color: rgba(184, 134, 43, 0.22); box-shadow: 0 0 0 4px rgba(184, 134, 43, 0.22); }
.lb-app .lb-page__photo.is-highlight { box-shadow: 0 0 0 6px rgba(184, 134, 43, 0.45); }
@media (prefers-reduced-motion: reduce) {
  .lb-app .lb-page__row,
  .lb-app .lb-page__name,
  .lb-app .lb-page__photo { transition: none; }
}
/* Never in downloads: the export renders fresh pages, but be explicit. */
.lb-app .lb-export [data-field].is-highlight { background-color: transparent; box-shadow: none; transition: none; }
