/* ═══════════════════════════════════════════════════════════════
   Lekhne Sathi — Web aligned with Flutter app (lib/app_colors.dart)
   Nepal flag blue (#003893) + crimson (#DC143C) · Material 3 surfaces
═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens (match mobile app) ─────────────────────── */
:root {
  /* Primary — Nepal flag deep blue */
  --p900:  #002266;
  --p800:  #003893;
  --p700:  #003893;
  --p600:  #1A5DC8;
  --p500:  #2563EB;
  --p100:  #E3ECF7;
  --p50:   #F0F4FA;

  /* Accent — flag crimson */
  --v700:  #B91C1C;
  --v600:  #DC143C;
  --v500:  #DC143C;
  --v100:  #FCE8EB;

  --rose:  #AD1457; /* mic active (AppColors.micActive) */
  --gold:  #D97706;
  --green: #059669;
  --teal:  #0F766E;

  /* Surfaces — AppColors.surface / surfaceContainer */
  --bg:         #F0F2F5;
  --surface:    #FFFFFF;
  --surface-2:  #F0F2F5;
  --text:       #1C1917;
  --text-sec:   #57534E;
  --text-muted: #78716C;
  --border:     #E4E6EB;
  --border-2:   #D1D5DB;

  /* Bottom nav selected pill (NavigationBar indicator) */
  --nav-indicator: #BDD3EE;

  /* Gradients — header + UI echo LekhneSathiHeaderSurface */
  --grad-header: linear-gradient(135deg, #1A5DC8 0%, #003893 45%, #002266 100%);
  --grad:    linear-gradient(135deg, #003893 0%, #1A5DC8 52%, #003893 100%);
  --grad-b:  linear-gradient(135deg, #002266 0%, #003893 100%);
  --grad-v:  linear-gradient(135deg, #B91C1C 0%, #DC143C 55%, #E85D75 100%);
  --grad-sky: linear-gradient(180deg, #1A5DC8 0%, #003893 42%, #002266 100%);
  --grad-sunrise: linear-gradient(135deg, #002266 0%, #003893 40%, #1A5DC8 72%, #DC143C 100%);
  --grad-mountain: linear-gradient(180deg, #F0F2F5 0%, #E3ECF7 55%, #FFFFFF 100%);

  /* Elevation — soft, app-like (Material elevation 1–3) */
  --sh-xs:  0 1px 2px rgba(0, 0, 0, .05);
  --sh-sm:  0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 56, 147, .04);
  --sh-md:  0 2px 6px rgba(0, 0, 0, .08), 0 4px 14px rgba(0, 56, 147, .06);
  --sh-lg:  0 4px 12px rgba(0, 0, 0, .1), 0 8px 28px rgba(0, 56, 147, .07);

  /* Radius — more rounded for modern feel */
  --r-xs:   10px;
  --r-sm:   14px;
  --r:      18px;
  --r-lg:   22px;
  --r-xl:   28px;

  /* Layout */
  --hdr-h:     68px;
  --bnav-h:    68px;
  --sidebar-w: 240px;
}

/* Dark theme — deep Nepal blue night + crimson accents */
html[data-theme="dark"] {
  --p900:  #000814;
  --p800:  #002654;
  --p700:  #5B9BD9;
  --p600:  #7CB9E8;
  --p500:  #93C5FD;
  --p100:  rgba(91, 155, 217, 0.16);
  --p50:   rgba(0, 56, 147, 0.12);

  --v700:  #F87171;
  --v600:  #FB7185;
  --v500:  #FCA5A5;
  --v100:  rgba(220, 20, 60, 0.12);

  --rose:  #f472b6;
  --gold:  #fbbf24;
  --green: #34d399;
  --teal:  #2dd4bf;

  --nav-indicator: rgba(91, 155, 217, 0.35);

  --bg:         #0c1220;
  --surface:    #161d2e;
  --surface-2:  #1e2738;
  --text:       #F1F5F9;
  --text-sec:   #CBD5E1;
  --text-muted: #94A3B8;
  --border:     #2a3a52;
  --border-2:   #3d4f6a;

  --grad-header: linear-gradient(135deg, #0d3d82 0%, #002654 48%, #000814 100%);
  --grad:    linear-gradient(135deg, #003893 0%, #1A5DC8 50%, #2563EB 100%);
  --grad-b:  linear-gradient(135deg, #000814 0%, #002654 100%);
  --grad-v:  linear-gradient(135deg, #DC143C 0%, #FB7185 55%, #FCA5A5 100%);
  --grad-sky: linear-gradient(180deg, #000814 0%, #002654 55%, #0d3d82 100%);
  --grad-sunrise: linear-gradient(135deg, #000814 0%, #003893 45%, #DC143C 88%, #B91C1C 100%);
  --grad-mountain: linear-gradient(180deg, #0c1220 0%, #161d2e 100%);

  --sh-xs:  0 1px 2px rgba(0, 0, 0, 0.5);
  --sh-sm:  0 1px 3px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.4);
  --sh-md:  0 2px 8px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.45);
  --sh-lg:  0 4px 16px rgba(0, 0, 0, 0.65), 0 16px 40px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(0, 56, 147, .08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(220, 20, 60, .05) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 50% 100%, rgba(0, 38, 102, .06) 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
}

html[data-theme="dark"] .ls-header {
  background: var(--grad-header);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .ls-header-glow {
  background: rgba(220, 20, 60, 0.65);
}

html[data-theme="dark"] .ls-bottom-nav {
  background: var(--surface);
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.45), 0 -4px 20px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .ls-overlay {
  background: rgba(0, 0, 0, 0.62);
}

html[data-theme="dark"] .ls-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--sh-sm);
}
html[data-theme="dark"] .ls-msg-card {
  background: var(--surface);
  border-color: var(--border);
}
html[data-theme="dark"] .ls-topic-tile {
  background: var(--surface-2);
  border-color: var(--border);
}
html[data-theme="dark"] .ls-topic-popover {
  background: var(--surface);
  border-color: var(--border);
}
html[data-theme="dark"] .ls-topic-overflow-btn:hover {
  background: var(--p50);
}
/* Dark — drawer (hamburger) nav: higher contrast text & surfaces */
html[data-theme="dark"] .ls-drawer {
  background: #1a2336;
  border-right-color: rgba(147, 197, 253, 0.18);
  box-shadow: 8px 0 36px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .ls-dnav-btn {
  color: #e8edf5;
}
html[data-theme="dark"] .ls-dnav-icon {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #93c5fd;
}
html[data-theme="dark"] .ls-dnav-btn:hover {
  color: #fff;
  background: rgba(96, 165, 250, 0.18);
}
html[data-theme="dark"] .ls-dnav-btn:hover .ls-dnav-icon {
  background: rgba(96, 165, 250, 0.28);
  border-color: rgba(147, 197, 253, 0.35);
  color: #fff;
}
html[data-theme="dark"] .ls-dnav-btn.active {
  color: #fff;
  background: rgba(96, 165, 250, 0.22);
}
html[data-theme="dark"] .ls-dnav-btn.active .ls-dnav-icon {
  border-color: transparent;
}
html[data-theme="dark"] .ls-drawer-footer {
  border-top-color: rgba(147, 197, 253, 0.15);
  color: #c5d0e0;
}
html[data-theme="dark"] .ls-drawer-footer .ls-footer-link {
  color: #93c5fd;
}
html[data-theme="dark"] .ls-drawer-footer .ls-footer-link:hover {
  color: #bfdbfe;
}
html[data-theme="dark"] .ls-drawer-ver {
  color: #7eb8f0;
}

html[data-theme="dark"] .ls-kbd-toggle {
  border-color: rgba(147, 197, 253, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}
html[data-theme="dark"] .ls-kbd-toggle:hover,
html[data-theme="dark"] .ls-kbd-toggle.open {
  background: rgba(96, 165, 250, 0.2);
  border-color: rgba(147, 197, 253, 0.45);
  color: #fff;
}
html[data-theme="dark"] .ls-share-input-btn {
  background: var(--surface-2);
  border-color: rgba(147, 197, 253, 0.28);
  color: #93c5fd;
}
html[data-theme="dark"] .ls-share-input-btn:hover {
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(147, 197, 253, 0.45);
  color: #fff;
}

html[data-theme="dark"] .ls-input:focus,
html[data-theme="dark"] .ls-textarea:focus,
html[data-theme="dark"] .ls-select:focus {
  border-color: var(--p600);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

html[data-theme="dark"] .ls-kbd {
  background: var(--surface-2);
  border-color: var(--border);
}
html[data-theme="dark"] .ls-kbd-tab:hover {
  background: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .ls-kbd-close {
  background: var(--surface);
  border-color: var(--border-2);
  color: var(--text-sec);
}
html[data-theme="dark"] .ls-kbd-close:hover {
  background: rgba(244, 114, 182, 0.12);
  color: var(--rose);
  border-color: rgba(244, 114, 182, 0.35);
}
html[data-theme="dark"] .ls-kbd-key {
  background: var(--surface);
  border-color: var(--border-2);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .ls-kbd-key:hover {
  background: var(--p50);
  border-color: var(--p500);
  color: var(--text);
}
html[data-theme="dark"] .ls-kbd-key.matra {
  background: rgba(220, 20, 60, 0.14);
  border-color: rgba(220, 20, 60, 0.45);
  color: #FCA5A5;
}
html[data-theme="dark"] .ls-kbd-key.matra:hover {
  background: rgba(220, 20, 60, 0.22);
  border-color: #FB7185;
  color: #FECDD3;
}
html[data-theme="dark"] .ls-kbd-act {
  background: var(--surface);
  border-color: var(--border-2);
  color: var(--text-sec);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .ls-kbd-del {
  background: rgba(244, 114, 182, 0.1);
  border-color: rgba(244, 114, 182, 0.35);
  color: #fda4af;
}
html[data-theme="dark"] .ls-kbd-del:hover {
  background: rgba(244, 114, 182, 0.18);
}

html[data-theme="dark"] .ls-modal-overlay {
  background: rgba(0, 0, 0, 0.72);
}

html[data-theme="dark"] .ls-msg-act {
  color: var(--text-sec);
  border-color: rgba(147, 197, 253, 0.22);
  background: rgba(30, 39, 56, 0.65);
}
html[data-theme="dark"] .ls-msg-act:hover {
  border-color: rgba(147, 197, 253, 0.45);
  background: rgba(96, 165, 250, 0.14);
  color: #e2e8f0;
}
html[data-theme="dark"] .ls-msg-act.liked {
  border-color: rgba(244, 114, 182, 0.35);
  background: rgba(244, 114, 182, 0.1);
  color: #fda4af;
}
html[data-theme="dark"] .ls-msg-toolbar-sep {
  background: rgba(147, 197, 253, 0.2);
}

html[data-theme="dark"] .ls-edit-kbd-open:hover {
  color: var(--text);
}

html[data-theme="dark"] .ls-bnav-btn {
  color: var(--text-muted);
}

html[data-theme="dark"] .ls-bnav-btn.active {
  color: var(--p600);
  font-weight: 700;
  background: rgba(91, 155, 217, 0.2);
}
html[data-theme="dark"] .ls-bnav-btn.active i {
  color: var(--p600);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; height: 100%; }

body {
  font-family: 'Poppins', 'Noto Sans Devanagari', 'Nirmala UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  /* Cool gray scaffold like Flutter Material surface */
  background:
    radial-gradient(ellipse 85% 55% at 12% -10%, rgba(0, 56, 147, .06) 0%, transparent 55%),
    radial-gradient(ellipse 55% 40% at 88% 0%, rgba(220, 20, 60, .04) 0%, transparent 48%),
    var(--bg);
  background-attachment: fixed;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
.hidden { display: none !important; }

/* ── Overlay ──────────────────────────────────────────────── */
.ls-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 34, 102, 0.42);
  z-index: 290;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  backdrop-filter: blur(6px);
}
.ls-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Drawer ───────────────────────────────────────────────── */
.ls-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: 290px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
  box-shadow: 8px 0 40px rgba(0,0,0,.12);
  border-right: 1px solid rgba(255,255,255,.3);
}
.ls-drawer.open { transform: translateX(0); }

.ls-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 16px;
  background: var(--grad-header);
  position: relative;
  overflow: hidden;
}
/* Mini mountain silhouette in drawer header */
.ls-drawer-head::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 20px;
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 280 25' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 25 L30 10 L60 18 L100 3 L140 15 L170 6 L210 18 L250 8 L280 16 L280 25Z' fill='rgba(255,255,255,0.08)'/%3E%3C/svg%3E") repeat-x bottom/280px 25px;
  pointer-events: none;
}
.ls-drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
a.ls-drawer-brand-link {
  text-decoration: none;
  color: inherit;
  min-width: 0;
  border-radius: var(--r-xs);
  flex: 1;
  margin-right: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
a.ls-drawer-brand-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}
.ls-drawer-logo {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
  pointer-events: none;
  user-select: none;
}
.ls-drawer-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.ls-drawer-sub {
  font-size: .6rem;
  color: rgba(255,255,255,.65);
  letter-spacing: .04em;
}
.ls-drawer-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  transition: background .18s;
}
.ls-drawer-close:hover { background: rgba(255,255,255,.28); }

.ls-drawer-nav {
  flex: 1;
  padding: 12px 12px;
  overflow-y: auto;
}
.ls-dnav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  color: var(--text-sec);
  font-size: .9rem;
  font-weight: 500;
  transition: all .18s;
  position: relative;
}
.ls-dnav-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all .18s;
}
.ls-dnav-btn:hover { color: var(--p700); background: var(--p50); }
.ls-dnav-btn:hover .ls-dnav-icon { background: var(--p100); color: var(--p700); }
.ls-dnav-btn.active {
  color: var(--p700);
  background: var(--p50);
  font-weight: 600;
}
.ls-dnav-btn.active .ls-dnav-icon {
  background: var(--grad);
  color: #fff;
}
.ls-dnav-btn.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--grad);
  border-radius: 0 3px 3px 0;
}

.ls-drawer-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  font-size: .72rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.ls-drawer-ver {
  display: block;
  margin-top: 4px;
  font-size: .66rem;
  color: var(--p500);
  font-weight: 600;
}

/* ── Header — Frosted Glass ───────────────────────────────── */
.ls-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  background: var(--grad-header);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,.1);
  height: var(--hdr-h);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 34, 102, .22), 0 1px 3px rgba(0, 0, 0, .08);
}
/* Crimson accent stripe — matches app header bottom edge */
.ls-header-glow {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(220, 20, 60, 0.72);
  z-index: 1;
}
.ls-header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  height: var(--hdr-h);
  padding: 0 12px;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.ls-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

/* Hamburger */
.ls-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  border-radius: var(--r-xs);
  padding: 8px;
  transition: background .18s;
}
.ls-hamburger:hover { background: rgba(255,255,255,.12); }
.ls-hamburger span {
  display: block;
  height: 2px;
  background: rgba(255,255,255,.9);
  border-radius: 2px;
  transition: transform .25s, opacity .25s, width .25s;
}
.ls-hamburger span:nth-child(2) { width: 80%; }
.ls-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ls-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.ls-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Brand */
.ls-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--r-xs);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ls-brand:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}
.ls-brand .ls-logo {
  pointer-events: none;
  user-select: none;
}
.ls-logo { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.ls-brand-text { display: flex; flex-direction: column; min-width: 0; }
.ls-brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 38vw;
}
.ls-brand-sub  { font-size: .55rem; color: rgba(255,255,255,.6); letter-spacing: .04em; }

/* App store badges — Play wider/taller for legibility; App Store matched height */
.ls-header-stores {
  --hdr-slot-h: 42px;
  --hdr-play-w: 128px;
  --hdr-ios-w: 102px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 6px;
}
.ls-header-store-slot {
  box-sizing: border-box;
  height: var(--hdr-slot-h);
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ls-header-play {
  width: var(--hdr-play-w);
  line-height: 0;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.25));
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}
.ls-header-play:hover {
  transform: scale(1.03);
  background: rgba(255, 255, 255, 0.22);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.32));
}
.ls-header-play:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}
.ls-header-play img {
  max-width: calc(100% - 2px);
  max-height: calc(100% - 2px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.ls-header-ios {
  width: var(--hdr-ios-w);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.38) 0%, rgba(0, 0, 0, 0.55) 100%);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 0 6px;
}
.ls-header-ios-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
}
.ls-header-ios-icon {
  font-size: clamp(0.95rem, 3vw, 1.45rem);
  color: rgba(255, 255, 255, 0.98);
  line-height: 1;
  flex-shrink: 0;
}
.ls-header-ios-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.08;
  min-width: 0;
  text-align: left;
}
.ls-header-ios-l1 {
  font-size: clamp(0.58rem, 2vw, 0.78rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.96);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.ls-header-ios-l2 {
  font-size: clamp(0.52rem, 1.75vw, 0.68rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
}

@media (max-width: 360px) {
  .ls-brand-sub { display: none; }
  .ls-header-inner { padding: 0 8px 0 10px; gap: 5px; }
  .ls-header-stores {
    gap: 5px;
    margin-left: 3px;
    --hdr-slot-h: 36px;
    --hdr-play-w: 108px;
    --hdr-ios-w: 86px;
  }
  .ls-header-store-slot { border-radius: 7px; }
  .ls-header-ios-inner { gap: 4px; }
}

@media (min-width: 400px) {
  .ls-header-stores {
    gap: 9px;
    --hdr-slot-h: 44px;
    --hdr-play-w: 138px;
    --hdr-ios-w: 110px;
  }
}

@media (min-width: 768px) {
  .ls-header-inner {
    padding: 0 16px;
    gap: 12px;
  }
  .ls-header-stores {
    gap: 12px;
    --hdr-slot-h: 50px;
    --hdr-play-w: 158px;
    --hdr-ios-w: 124px;
  }
  .ls-header-store-slot { border-radius: 9px; }
  .ls-brand-name { max-width: none; }
}

/* Header actions */
.ls-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 2px;
}

.ls-theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-xs);
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.05rem;
  transition: background 0.18s, color 0.18s;
}
.ls-theme-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.ls-theme-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}

/* Roman→Nepali switch (under textarea + optional compact) */
.ls-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.ls-switch-sm {
  width: 36px;
  height: 20px;
}
.ls-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}
.ls-switch-track {
  position: absolute;
  inset: 0;
  background: var(--border-2);
  border-radius: 50px;
  transition: background 0.2s;
}
.ls-switch:has(input:checked) .ls-switch-track {
  background: linear-gradient(135deg, var(--p700) 0%, var(--p500) 100%);
}
.ls-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: left 0.2s;
}
.ls-switch-sm .ls-switch-thumb {
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
}
.ls-switch:has(input:checked) .ls-switch-thumb {
  left: 21px;
}
.ls-switch-sm:has(input:checked) .ls-switch-thumb {
  left: 18px;
}

.ls-input-hint-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-top: 8px;
  padding: 0 2px;
}
.ls-input-hint {
  flex: 1;
  min-width: min(100%, 200px);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.ls-input-hint-tail {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ls-roman-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}
.ls-roman-inline-txt {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-sec);
  white-space: nowrap;
}

/* Hide hamburger on desktop */
@media (min-width: 768px) {
  .ls-hamburger { display: none; }
  .ls-roman-inline-txt { font-size: 0.7rem; }
}

/* ── Layout ───────────────────────────────────────────────── */
.ls-layout {
  display: flex;
  padding-top: var(--hdr-h);
  padding-bottom: var(--bnav-h);
  min-height: 100vh;
}

.ls-sidebar { display: none; }

.ls-main {
  flex: 1;
  min-width: 0;
  padding: 16px 14px 28px;
}

@media (min-width: 768px) {
  .ls-layout {
    padding-bottom: 0;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
  }

  /* Show sidebar on desktop */
  .ls-sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: rgba(255,255,255,.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(0,56,147,.06);
    padding: 20px 12px 24px;
    position: sticky;
    top: var(--hdr-h);
    height: calc(100vh - var(--hdr-h));
    overflow-y: auto;
    align-self: flex-start;
  }

  .ls-sidebar-nav {
    padding-top: 4px;
  }

  .ls-sidebar-section {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    padding: 2px 10px 8px;
  }

  .ls-snav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    color: var(--text-sec);
    font-size: .86rem;
    font-weight: 500;
    transition: all .18s;
    position: relative;
  }
  .ls-snav-btn i { font-size: 1.05rem; flex-shrink: 0; }
  .ls-snav-btn:hover { color: var(--p700); background: var(--p50); }
  .ls-snav-btn.active {
    color: var(--p700);
    background: linear-gradient(90deg, var(--p50), var(--v100) 120%);
    font-weight: 600;
  }
  .ls-snav-btn.active::before {
    content: '';
    position: absolute;
    left: 0; top: 22%; bottom: 22%;
    width: 3px;
    background: var(--grad);
    border-radius: 0 3px 3px 0;
  }

  .ls-sidebar-info {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }
  .ls-sidebar-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .7rem;
    color: var(--green);
    background: #ECFDF5;
    padding: 8px 10px;
    border-radius: var(--r-xs);
    font-weight: 500;
  }
  .ls-sidebar-badge i { font-size: .85rem; }

  .ls-main {
    padding: 24px 28px 40px;
    max-width: 800px;
  }

  .ls-bottom-nav { display: none !important; }

  body {
    background:
      radial-gradient(ellipse 80% 50% at 20% 0%, rgba(0,56,147,.07) 0%, transparent 60%),
      radial-gradient(ellipse 60% 40% at 85% 15%, rgba(220,20,60,.05) 0%, transparent 50%),
      radial-gradient(ellipse 50% 50% at 50% 100%, rgba(0,56,147,.04) 0%, transparent 50%),
      #E8F4FD;
    background-attachment: fixed;
  }
}

/* Dark — desktop left sidebar (same nav as drawer, clearer contrast) */
@media (min-width: 768px) {
  /* Desktop layout forced a light body background; restore dark scaffold */
  html[data-theme="dark"] body {
    background:
      radial-gradient(ellipse 80% 50% at 20% 0%, rgba(0, 56, 147, .08) 0%, transparent 60%),
      radial-gradient(ellipse 60% 40% at 80% 10%, rgba(220, 20, 60, .05) 0%, transparent 50%),
      radial-gradient(ellipse 50% 50% at 50% 100%, rgba(0, 38, 102, .06) 0%, transparent 50%),
      var(--bg);
    background-attachment: fixed;
  }
  html[data-theme="dark"] .ls-sidebar {
    background: rgba(26, 35, 54, 0.97);
    border-right-color: rgba(147, 197, 253, 0.16);
  }
  html[data-theme="dark"] .ls-snav-btn {
    color: #e8edf5;
  }
  html[data-theme="dark"] .ls-snav-btn i {
    color: #93c5fd;
  }
  html[data-theme="dark"] .ls-snav-btn:hover {
    color: #fff;
    background: rgba(96, 165, 250, 0.16);
  }
  html[data-theme="dark"] .ls-snav-btn:hover i {
    color: #bfdbfe;
  }
  html[data-theme="dark"] .ls-snav-btn.active {
    color: #fff;
    background: rgba(96, 165, 250, 0.22);
  }
  html[data-theme="dark"] .ls-snav-btn.active i {
    color: #fff;
  }
  html[data-theme="dark"] .ls-sidebar-section {
    color: #9fb0c6;
  }
  html[data-theme="dark"] .ls-sidebar-info {
    border-top-color: rgba(147, 197, 253, 0.15);
  }
  html[data-theme="dark"] .ls-sidebar-badge {
    background: rgba(52, 211, 153, 0.14);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.28);
  }
  html[data-theme="dark"] .ls-sidebar-privacy {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(147, 197, 253, 0.22);
    color: #dbeafe;
  }
  html[data-theme="dark"] .ls-sidebar-privacy:hover {
    background: rgba(96, 165, 250, 0.18);
    border-color: rgba(147, 197, 253, 0.38);
    color: #fff;
  }
}

@media (min-width: 1100px) {
  .ls-main { padding: 28px 36px 48px; max-width: 880px; }
}

/* Wider main only on Home (app screenshot column) */
@media (min-width: 900px) {
  .ls-main.ls-main--home-split {
    max-width: 1180px;
  }
}
@media (min-width: 1100px) {
  .ls-main.ls-main--home-split {
    max-width: 1220px;
  }
}

/* ── Home: Android promo (desktop right column) + mobile tip banner ─ */
.ls-home-split {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: stretch;
}

@media (min-width: 900px) {
  .ls-home-split {
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
  }
  .ls-home-split-main {
    flex: 1;
    min-width: 0;
  }
  .ls-home-split-aside {
    width: min(300px, 34vw);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--hdr-h) + 20px);
  }
}

.ls-home-app-promo {
  margin: 0;
  padding: 16px 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  text-align: center;
}

.ls-home-app-figure-link {
  display: block;
  margin: 0 0 14px;
  padding: 0;
  border: none;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: var(--sh-md);
  background: var(--surface-2);
  -webkit-tap-highlight-color: transparent;
}
.ls-home-app-figure-link:hover {
  transform: translateY(-4px);
  box-shadow:
    0 14px 40px rgba(0, 56, 147, 0.2),
    0 6px 18px rgba(0, 34, 102, 0.12);
}
.ls-home-app-figure-link:focus-visible {
  outline: 2px solid var(--p500);
  outline-offset: 3px;
}
html[data-theme="dark"] .ls-home-app-figure-link:hover {
  box-shadow:
    0 14px 44px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(147, 197, 253, 0.2);
}

.ls-home-app-figure {
  margin: 0;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: none;
  line-height: 0;
  background: transparent;
}

.ls-home-app-shot {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.ls-home-app-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 4px 14px rgba(0, 56, 147, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ls-home-app-play:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 56, 147, 0.32);
}

.ls-home-app-note {
  margin: 12px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: left;
}

.ls-mobile-app-banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--p50) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-xs);
}
html[data-theme="dark"] .ls-mobile-app-banner {
  background: linear-gradient(135deg, rgba(0, 56, 147, 0.22) 0%, var(--surface) 100%);
  border-color: var(--border-2);
}

.ls-mobile-app-banner-inner {
  max-width: 720px;
  margin: 0 auto;
}

.ls-mobile-app-banner-text {
  margin: 0 0 10px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
}

.ls-mobile-app-banner-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ls-mobile-app-banner-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 2px 10px rgba(0, 56, 147, 0.2);
}
.ls-mobile-app-banner-btn:hover {
  color: #fff;
  filter: brightness(1.05);
}

.ls-mobile-app-banner-dismiss {
  margin-left: auto;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ls-mobile-app-banner-dismiss:hover {
  background: var(--border);
  color: var(--text);
}

/* ── Pages ────────────────────────────────────────────────── */
.ls-page { display: none; }
.ls-page.active { display: block; animation: pageIn .35s cubic-bezier(.22,1,.36,1); }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Homepage SEO intro (hidden visually, crawlable by bots) ─ */
.ls-seo-intro {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ls-seo-h1 {
  font-family: 'Noto Sans Devanagari', 'Poppins', sans-serif;
  font-size: clamp(1.05rem, 2.8vw, 1.28rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.ls-seo-h2 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--p700);
  margin: 16px 0 8px;
}
.ls-seo-h3 {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: 'Noto Sans Devanagari', 'Poppins', sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  margin: 14px 0 6px;
  line-height: 1.4;
}
.ls-seo-ico {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}
.ls-seo-lead,
.ls-seo-p {
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--text-sec);
}
.ls-seo-list {
  margin: 0 0 4px 1.1rem;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--text-sec);
}
.ls-seo-list li { margin-bottom: 6px; }
.ls-seo-faq {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-sec);
}
.ls-seo-faq dt {
  font-weight: 700;
  color: var(--text);
  margin-top: 10px;
}
.ls-seo-faq dd { margin: 4px 0 0; }
.ls-seo-links {
  margin: 14px 0 0;
  font-size: 0.8rem;
  font-weight: 600;
}
.ls-seo-links a { color: var(--p700); }
.ls-seo-links a:hover { text-decoration: underline; }
html[data-theme="dark"] .ls-seo-h2 { color: var(--p600); }

html[data-theme="dark"] .ls-card-title {
  background: linear-gradient(135deg, #7CB9E8 0%, #BFDBFE 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html[data-theme="dark"] .ls-page-title {
  color: var(--text);
}

html[data-theme="dark"] .ls-bottom-nav {
  border-top-color: var(--border);
}

html[data-theme="dark"] .ls-gen-card::before {
  background: linear-gradient(90deg, #003893 0%, #1A5DC8 35%, #DC143C 70%, #B91C1C 100%);
}

html[data-theme="dark"] .ls-seo-intro { /* visually hidden */ }

/* Dark hero — compact strip */
html[data-theme="dark"] .ls-hero-card {
  background: linear-gradient(155deg, #000814 0%, #002654 40%, #003893 78%, #1a4a7a 100%);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .ls-hero-card::after {
  background: radial-gradient(circle, rgba(220,20,60,.18) 0%, rgba(185,28,28,.06) 45%, transparent 68%);
}

/* Page hero row */
.ls-page-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ls-page-hero-icon {
  width: 48px; height: 48px;
  border-radius: var(--r-sm);
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  flex-shrink: 0;
}
.ls-page-hero-icon.ls-icon-purple { background: linear-gradient(135deg, #003893, #1A5DC8); }
.ls-page-hero-icon.ls-icon-rose   { background: linear-gradient(135deg, #B91C1C, #DC143C); }

.ls-page-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  margin-bottom: 2px;
}
.ls-page-sub { font-size: 0.83rem; line-height: 1.55; color: var(--text-sec); }

/* ── Bottom Nav — Frosted Dock ────────────────────────────── */
.ls-bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 200;
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 1px solid var(--border);
  height: var(--bnav-h);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  justify-items: center;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, .08), 0 -4px 18px rgba(0, 56, 147, .05);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.ls-bnav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: .58rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 20px;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  position: relative;
  width: 100%;
  max-width: 72px;
  min-height: 46px;
  justify-content: center;
}
.ls-bnav-btn i { font-size: 1.25rem; transition: all .25s cubic-bezier(.4,0,.2,1); }
.ls-bnav-btn.active {
  color: var(--p700);
  font-weight: 700;
  background: rgba(189, 211, 238, 0.55);
}
.ls-bnav-btn.active i { transform: scale(1.12); color: var(--p700); }
.ls-bnav-btn.active::before {
  display: none;
}
.ls-bnav-btn:active { transform: scale(.92); }

/* ── Daily Thought Hero — compact banner (app-style strip) ─── */
.ls-hero-card {
  background: linear-gradient(145deg, #002266 0%, #003893 38%, #1A5DC8 72%, #5B9BD9 100%);
  border-radius: var(--r-lg);
  padding: 12px 16px 14px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 6px 24px rgba(0, 34, 102, .22),
    0 2px 8px rgba(0, 56, 147, .1),
    inset 0 1px 0 rgba(255,255,255,.1);
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
/* Shallow wave band — keeps decoration without tall padding */
.ls-hero-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ls-hero-pattern::before {
  content: '';
  position: absolute;
  bottom: 0; left: -5%; right: -5%;
  height: 44px;
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 1000 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='snow1' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='white' stop-opacity='0.14'/%3E%3Cstop offset='0.35' stop-color='white' stop-opacity='0.06'/%3E%3Cstop offset='1' stop-color='white' stop-opacity='0.03'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 120 L70 55 L120 75 L200 22 L280 58 L350 12 L440 52 L500 18 L570 60 L650 8 L730 48 L800 25 L880 55 L950 15 L1000 45 L1000 120Z' fill='url(%23snow1)'/%3E%3C/svg%3E") no-repeat bottom center/110% auto;
  opacity: 0.85;
}
.ls-hero-pattern::after {
  content: '';
  position: absolute;
  bottom: 0; left: -3%; right: -3%;
  height: 26px;
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 800 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 60 L50 38 L110 48 L180 22 L240 40 L300 16 L370 36 L440 20 L520 42 L580 18 L650 38 L720 28 L800 42 L800 60Z' fill='rgba(0,34,102,0.28)'/%3E%3C/svg%3E") no-repeat bottom center/106% auto;
}
/* Subtle crimson bloom */
.ls-hero-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -8%;
  width: min(42%, 140px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(220, 20, 60, .2) 0%,
    rgba(220, 20, 60, .08) 45%,
    transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: sunGlow 8s ease-in-out infinite alternate;
  filter: blur(12px);
}
@keyframes sunGlow {
  from { opacity: .5; transform: scale(0.96); }
  to   { opacity: .85; transform: scale(1.04); }
}
/* Light star dust — smaller, softer */
.ls-hero-card::before {
  content: '';
  position: absolute;
  top: 8px; left: 14px;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  box-shadow:
    28px 4px 0 0 rgba(255,255,255,.25),
    72px 12px 0 rgba(255,255,255,.15),
    120px 3px 0 rgba(255,255,255,.2),
    200px 10px 0 rgba(255,255,255,.12),
    52px 20px 0 rgba(255,255,255,.18);
  animation: twinkle 5s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}
@keyframes twinkle {
  0%   { opacity: .35; }
  50%  { opacity: .85; }
  100% { opacity: .45; }
}
.ls-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 20px;
}
.ls-hero-deco {
  position: absolute;
  right: 10px;
  bottom: 18px;
  font-size: 1.35rem;
  color: rgba(255,255,255,.06);
  z-index: 1;
  line-height: 1;
  pointer-events: none;
}
.ls-hero-eyebrow {
  font-size: .56rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.82);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  background: rgba(0, 0, 0, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.ls-hero-eyebrow i { font-size: 0.95em; opacity: 0.9; }
.ls-hero-quote {
  font-size: clamp(0.8rem, 2.8vw, 0.9rem);
  line-height: 1.55;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  max-width: 100%;
  margin: 0;
}
@media (min-width: 480px) {
  .ls-hero-card {
    padding: 14px 20px 16px;
  }
  .ls-hero-content { padding-bottom: 22px; }
  .ls-hero-quote {
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 36rem;
  }
}

/* ── Cards — Glassmorphism ────────────────────────────────── */
.ls-card {
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 16px;
  box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 18px;
  transition: box-shadow .3s ease, transform .3s ease;
}
.ls-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

.ls-gen-card {
  border-top: none;
  position: relative;
  /* Popover for अरू श्रेणी must not be clipped */
  overflow: visible;
}
.ls-gen-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #003893 0%, #1A5DC8 38%, #DC143C 72%, #B91C1C 100%);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.ls-card-header {
  padding: 20px 22px 0;
}
.ls-gen-card > .ls-card-header {
  padding-bottom: 4px;
}
.ls-gen-card > .ls-card-header .ls-card-title {
  margin-bottom: 14px;
}
.ls-card-body { padding: 20px 22px; }
.ls-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--p800) 0%, var(--p600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ls-card-desc {
  font-size: 0.84rem;
  color: var(--text-sec);
  margin-bottom: 18px;
  line-height: 1.7;
}

/* ── Category picker — ५ टाइल + अरू श्रेणी (मोबाइल एप जस्तै) ── */
.ls-topic-picker {
  padding: 0 22px 4px;
  position: relative;
}
.ls-topic-picker.ls-topic-picker--no-aama .ls-topic-row {
  grid-template-columns: repeat(4, 1fr);
}
.ls-topic-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
@media (max-width: 420px) {
  .ls-topic-row {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }
  .ls-topic-picker.ls-topic-picker--no-aama .ls-topic-row {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 340px) {
  .ls-topic-row {
    grid-template-columns: repeat(3, 1fr);
  }
}
.ls-topic-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 72px;
  padding: 8px 4px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-sec);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}
.ls-topic-tile:hover {
  border-color: rgba(0, 56, 147, 0.35);
  background: var(--p50);
  color: var(--text);
}
.ls-topic-tile.active {
  background: linear-gradient(160deg, var(--p100) 0%, #fff 100%);
  border-color: var(--p700);
  color: var(--p800);
  box-shadow: 0 2px 10px rgba(0, 56, 147, 0.12);
  font-weight: 700;
}
/* नयाँ वर्ष — overflow tile; use same purple accent when shown as overflow active */
.ls-topic-nayabarsa {
  border-color: rgba(106, 27, 154, 0.35);
  background: linear-gradient(160deg, #F3E5F5 0%, #fff 100%);
  color: #6A1B9A;
}
.ls-topic-nayabarsa:hover {
  border-color: #6A1B9A;
  background: linear-gradient(160deg, #EDE7F6 0%, #F3E5F5 100%);
  color: #4A148C;
}
.ls-topic-nayabarsa.active {
  background: linear-gradient(160deg, #EDE7F6 0%, #F3E5F5 100%);
  border-color: #6A1B9A;
  color: #4A148C;
  box-shadow: 0 2px 12px rgba(106, 27, 154, 0.18);
}
/* आमा औँसी / मातातीर्थ — warm rose accent */
.ls-topic-aama-aunsi {
  border-color: rgba(173, 20, 87, 0.35);
  background: linear-gradient(160deg, #FCE4EC 0%, #fff 100%);
  color: #AD1457;
  animation: aamaAunsiPulse 2.5s ease-in-out infinite;
}
.ls-topic-aama-aunsi:hover {
  border-color: #AD1457;
  background: linear-gradient(160deg, #F8BBD9 0%, #FCE4EC 100%);
  color: #880E4F;
}
.ls-topic-aama-aunsi.active {
  background: linear-gradient(160deg, #F8BBD9 0%, #FCE4EC 100%);
  border-color: #AD1457;
  color: #880E4F;
  box-shadow: 0 2px 12px rgba(173, 20, 87, 0.18);
}
@keyframes aamaAunsiPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(173, 20, 87, 0); }
  50%      { box-shadow: 0 0 0 4px rgba(173, 20, 87, 0.12); }
}
html[data-theme="dark"] .ls-topic-aama-aunsi {
  border-color: rgba(248, 187, 217, 0.45);
  background: rgba(173, 20, 87, 0.18);
  color: #F8BBD9;
}
html[data-theme="dark"] .ls-topic-aama-aunsi:hover {
  border-color: #F48FB1;
  background: rgba(173, 20, 87, 0.26);
  color: #FCE4EC;
}
html[data-theme="dark"] .ls-topic-aama-aunsi.active {
  background: rgba(173, 20, 87, 0.28);
  border-color: #F48FB1;
  color: #FCE4EC;
  box-shadow: 0 2px 12px rgba(173, 20, 87, 0.28);
}
html[data-theme="dark"] .ls-topic-nayabarsa {
  border-color: rgba(206, 147, 255, 0.35);
  background: rgba(106, 27, 154, 0.15);
  color: #CE93FF;
}
html[data-theme="dark"] .ls-topic-nayabarsa:hover {
  border-color: #CE93FF;
  background: rgba(106, 27, 154, 0.22);
  color: #E1BEE7;
}
html[data-theme="dark"] .ls-topic-nayabarsa.active {
  background: rgba(106, 27, 154, 0.25);
  border-color: #CE93FF;
  color: #E1BEE7;
  box-shadow: 0 2px 12px rgba(106, 27, 154, 0.25);
}
.ls-topic-tile-emoji {
  font-size: 1.35rem;
  line-height: 1;
}
.ls-topic-tile-label {
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 400px) {
  .ls-topic-tile-label { font-size: 0.68rem; }
}
/* "अरू श्रेणी" tile wrapper — anchors the popover */
.ls-topic-tile-more-wrap {
  position: relative;
}
.ls-topic-tile-more {
  width: 100%;
  height: 100%;
  border-style: dashed;
}
.ls-topic-tile-more .ls-topic-tile-emoji i {
  font-size: 1.1rem;
}
.ls-topic-tile-more.open,
.ls-topic-tile-more.active {
  border-color: var(--p600);
  background: var(--p100);
  color: var(--p800);
  border-style: solid;
}
.ls-topic-popover {
  position: absolute;
  right: 0;
  left: auto;
  top: calc(100% + 6px);
  min-width: 180px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  max-height: min(52vh, 320px);
  overflow-y: auto;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--sh-lg);
  -webkit-overflow-scrolling: touch;
}
.ls-topic-popover[hidden] {
  display: none !important;
}
.ls-topic-overflow-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.ls-topic-overflow-btn:hover {
  background: var(--p50);
}
.ls-topic-overflow-btn.active {
  background: var(--p100);
  color: var(--p800);
  box-shadow: inset 0 0 0 1.5px var(--p700);
}
.ls-topic-overflow-emoji {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Festival chips (पर्व) — एप जस्तै छान्दा तुरुन्त सन्देश ── */
.ls-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ls-festival-field {
  padding: 0 22px 6px;
  gap: 8px;
}
.ls-festival-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ls-festival-field-title {
  margin: 0;
}
.ls-festival-field-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--p700);
  background: linear-gradient(135deg, var(--p100) 0%, rgba(255, 255, 255, 0.9) 100%);
  border: 1px solid rgba(0, 56, 147, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
}
.ls-festival-field-hint {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-sec);
  line-height: 1.45;
}
.ls-festival-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding: 2px 0 6px;
  max-height: min(38vh, 220px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.ls-festival-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px 9px 11px;
  border-radius: 999px;
  border: 1.5px solid rgba(0, 56, 147, 0.14);
  background: linear-gradient(165deg, var(--surface) 0%, var(--surface-2) 100%);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.ls-festival-chip:hover {
  border-color: rgba(0, 56, 147, 0.35);
  background: linear-gradient(165deg, var(--p50) 0%, var(--surface) 100%);
  box-shadow: 0 4px 14px rgba(0, 56, 147, 0.1);
}
.ls-festival-chip:active {
  transform: scale(0.97);
}
.ls-festival-chip.active {
  border-color: var(--p700);
  background: linear-gradient(155deg, var(--p100) 0%, #fff 55%);
  color: var(--p800);
  box-shadow: 0 4px 16px rgba(0, 56, 147, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.ls-festival-chip-emoji {
  font-size: 1.15rem;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
}
.ls-festival-chip-label {
  white-space: nowrap;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-theme="dark"] .ls-festival-field-badge {
  color: #90caf9;
  background: linear-gradient(135deg, rgba(25, 118, 210, 0.22) 0%, rgba(12, 18, 32, 0.9) 100%);
  border-color: rgba(100, 181, 246, 0.25);
}
html[data-theme="dark"] .ls-festival-chip {
  border-color: rgba(100, 181, 246, 0.2);
  background: linear-gradient(165deg, rgba(22, 28, 42, 0.95) 0%, rgba(12, 18, 32, 0.98) 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .ls-festival-chip:hover {
  border-color: rgba(100, 181, 246, 0.45);
  background: linear-gradient(165deg, rgba(30, 58, 95, 0.5) 0%, rgba(22, 28, 42, 0.95) 100%);
}
html[data-theme="dark"] .ls-festival-chip.active {
  border-color: #64b5f6;
  background: linear-gradient(155deg, rgba(30, 58, 95, 0.65) 0%, rgba(22, 28, 42, 0.98) 100%);
  color: #e3f2fd;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(100, 181, 246, 0.25);
}

/* ── Form elements ────────────────────────────────────────── */
.ls-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ls-field.hidden { display: none; }
.ls-field-full { grid-column: 1/-1; }

.ls-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 540px) { .ls-form-grid { grid-template-columns: 1fr; } }
.ls-divider-full {
  grid-column: 1/-1;
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.ls-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-sec);
  display: flex;
  align-items: center;
  gap: 5px;
}
.ls-req { color: var(--rose); }

.ls-input,
.ls-textarea {
  width: 100%;
  border: 1.5px solid rgba(0,56,147,.12);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 0.92rem;
  color: var(--text);
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  outline: none;
}
.ls-textarea { resize: vertical; min-height: 90px; }
.ls-input:focus, .ls-textarea:focus {
  border-color: var(--p500);
  background: rgba(255,255,255,.9);
  box-shadow: 0 0 0 4px rgba(0,56,147,.1), 0 4px 12px rgba(0,56,147,.06);
}

/* ── Inline input row (e.g., phone/date quick actions) ─────── */
.ls-input-row{
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.ls-input-row .ls-input{ flex: 1 1 auto; }
.ls-input-mini-btn{
  flex: 0 0 auto;
  min-width: 46px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1.5px solid rgba(0,56,147,.18);
  background: rgba(255,255,255,.72);
  color: var(--p700);
  font-weight: 800;
  font-size: 0.82rem;
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
}
.ls-input-mini-btn:hover{
  background: var(--p50);
  border-color: rgba(0,56,147,.32);
  box-shadow: 0 6px 18px rgba(0,56,147,.10);
}
.ls-input-mini-btn:active{ transform: translateY(1px); }
.ls-input-mini-btn:focus-visible{
  outline: 3px solid rgba(0,56,147,.25);
  outline-offset: 2px;
}

.ls-select-wrap { position: relative; }
.ls-select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 36px 10px 14px;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface-2);
  appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s;
}
.ls-select:focus {
  border-color: var(--p600);
  box-shadow: 0 0 0 4px rgba(37,99,235,.1);
}
.ls-select:disabled { opacity: .5; cursor: not-allowed; }
.ls-select-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .75rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Footer: slightly larger icons (incl. social) */
.ls-site-footer-pill i { font-size: 1.05rem; }

/* Textarea + share + voice */
.ls-input-group { padding: 0 22px 16px; display: flex; flex-direction: column; gap: 8px; }

/* Composer — gradient frame + focus ring */
.ls-textarea-shell {
  border-radius: var(--r-lg);
  padding: 2px;
  background: linear-gradient(
    145deg,
    rgba(0, 57, 147, 0.45) 0%,
    rgba(26, 93, 200, 0.35) 42%,
    rgba(220, 20, 60, 0.22) 100%
  );
  box-shadow:
    0 4px 18px rgba(0, 34, 102, 0.07),
    0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.28s ease, transform 0.2s ease;
}
.ls-textarea-shell-inner {
  border-radius: calc(var(--r-lg) - 2px);
  background: var(--surface);
  overflow: hidden;
}
.ls-textarea-shell:focus-within {
  box-shadow:
    0 0 0 3px rgba(0, 57, 147, 0.12),
    0 8px 28px rgba(0, 56, 147, 0.1),
    0 2px 8px rgba(0, 34, 102, 0.06);
}
.ls-textarea-box { position: relative; }
/* Clear / रद्द button — inline in actions column */
.ls-input-clear {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  padding: 0;
}
.ls-input-clear:hover {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: #FCA5A5;
}
html[data-theme="dark"] .ls-input-clear {
  background: var(--surface-2);
  border-color: rgba(147, 197, 253, 0.28);
  color: var(--text-muted);
}
html[data-theme="dark"] .ls-input-clear:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #FCA5A5;
  border-color: rgba(252, 165, 165, 0.35);
}
.ls-textarea--composer {
  padding-right: 54px;
  padding-top: 14px;
  padding-bottom: 14px;
  min-height: 192px;
  border: none !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, #f8fbff 0%, var(--surface) 55%) !important;
  font-size: 0.94rem;
  line-height: 1.65;
  box-shadow: none !important;
}
.ls-textarea--composer:focus {
  background: var(--surface) !important;
  box-shadow: none !important;
}
.ls-textarea--composer::placeholder {
  color: var(--text-muted);
  opacity: 0.88;
}

html[data-theme="dark"] .ls-textarea-shell {
  background: linear-gradient(
    145deg,
    rgba(96, 165, 250, 0.35) 0%,
    rgba(59, 130, 246, 0.22) 45%,
    rgba(248, 113, 113, 0.18) 100%
  );
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .ls-textarea-shell:focus-within {
  box-shadow:
    0 0 0 3px rgba(96, 165, 250, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .ls-textarea--composer {
  background: linear-gradient(180deg, rgba(30, 39, 56, 0.95) 0%, var(--surface) 50%) !important;
}
.ls-textarea-actions {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
}
.ls-share-input-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--p700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 56, 147, 0.1);
  border: 1.5px solid rgba(0, 56, 147, 0.2);
  flex-shrink: 0;
}
.ls-share-input-btn:hover {
  background: var(--p100);
  border-color: var(--p600);
  color: var(--p800);
  transform: scale(1.06);
  box-shadow: 0 3px 12px rgba(0, 56, 147, 0.15);
}
.ls-mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,56,147,.1), rgba(6,182,212,.15));
  color: var(--p600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 8px rgba(0,56,147,.1);
  border: 1px solid rgba(0,56,147,.15);
  flex-shrink: 0;
}
.ls-mic-btn:hover {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,56,147,.3);
  transform: scale(1.08);
  border-color: transparent;
}
.ls-mic-btn.listening {
  background: linear-gradient(135deg, var(--rose), #FB7185);
  color: #fff;
  animation: mic-pulse 1.2s infinite;
}
@keyframes mic-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(225,29,72,.4); }
  50%      { box-shadow: 0 0 0 10px rgba(225,29,72,0); }
}

/* Keyboard toggle (main composer — beside Roman→नेपाली) */
.ls-kbd-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--border-2);
  border-radius: 50px;
  background: var(--surface-2);
  color: var(--text-sec);
  font-size: .73rem;
  font-weight: 500;
  transition: all .18s;
}
.ls-kbd-toggle:hover, .ls-kbd-toggle.open {
  background: var(--p50);
  border-color: var(--p500);
  color: var(--p700);
}
.ls-kbd-toggle-txt { display: none; }
@media (min-width: 480px) { .ls-kbd-toggle-txt { display: inline; } }

/* ── Nepali Soft Keyboard ─────────────────────────────────── */
.ls-kbd {
  margin: 0 22px 16px;
  background: #EDF0F6;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px;
  animation: pageIn .2s ease;
}
.ls-kbd-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.ls-kbd-tab {
  padding: 4px 11px;
  border: 1.5px solid transparent;
  border-radius: 50px;
  background: none;
  color: var(--text-sec);
  font-size: .78rem;
  font-weight: 600;
  font-family: 'Noto Sans Devanagari', inherit;
  transition: all .16s;
}
.ls-kbd-tab:hover { background: rgba(0,0,0,.07); }
.ls-kbd-tab.active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}
.ls-kbd-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-xs);
  background: #fff;
  color: var(--text-muted);
  font-size: .75rem;
  margin-left: auto;
  transition: all .16s;
}
.ls-kbd-close:hover { background: #FFF0F3; color: var(--rose); border-color: #FCA5A5; }

.ls-kbd-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.ls-kbd-key {
  min-width: 34px;
  height: 36px;
  padding: 2px 5px;
  border: 1px solid #C4C9D4;
  border-radius: var(--r-xs);
  background: #fff;
  color: var(--text);
  font-size: .98rem;
  font-family: 'Noto Sans Devanagari', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 #C4C9D4;
  transition: all .1s;
  user-select: none;
  flex: 1 0 auto;
  max-width: 50px;
}
.ls-kbd-key:hover { background: var(--p50); border-color: var(--p500); color: var(--p700); }
.ls-kbd-key:active { transform: scale(.9); background: var(--grad); color: #fff; }
.ls-kbd-key.matra { background: var(--v100); border-color: #F9A8B2; color: #9F1239; }
.ls-kbd-key.matra:hover { background: #FECDD3; border-color: #F43F5E; }
.ls-kbd-key.conjunct { min-width: 50px; font-size: .82rem; }
.ls-kbd-key.cluster { min-width: 44px; font-size: .76rem; padding: 2px 4px; }
.ls-kbd-key.special { min-width: 38px; font-size: .85rem; background: #f0fdf4; border-color: #86efac; color: #14532d; }
html[data-theme="dark"] .ls-kbd-key.special { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.35); color: #6ee7b7; }

.ls-kbd-actions { display: flex; gap: 5px; }
.ls-kbd-act {
  flex: 1;
  padding: 7px 8px;
  border: 1px solid #C4C9D4;
  border-radius: var(--r-xs);
  background: #fff;
  color: var(--text-sec);
  font-size: .77rem;
  font-weight: 600;
  box-shadow: 0 1px 0 #C4C9D4;
  transition: all .14s;
}
.ls-kbd-act:hover { background: var(--p50); color: var(--p700); }
.ls-kbd-del {
  flex: .5;
  background: #FFF5F5;
  border-color: #FECACA;
  color: var(--rose);
  font-size: .92rem;
}
.ls-kbd-del:hover { background: #FEE2E2; }

/* ── Recipient name input ("को लागि") ────────────────────── */
.ls-recipient-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 22px 12px;
}
.ls-recipient-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sec);
  white-space: nowrap;
  flex-shrink: 0;
}
.ls-recipient-label i {
  color: var(--p700);
  margin-right: 2px;
}
html[data-theme="dark"] .ls-recipient-label i {
  color: var(--p600);
}
.ls-recipient-input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  min-width: 0;
}
.ls-recipient-input::placeholder {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.ls-recipient-input:focus {
  border-color: var(--p600);
  box-shadow: 0 0 0 3px rgba(0, 56, 147, 0.1);
}
html[data-theme="dark"] .ls-recipient-input {
  background: var(--surface-2);
  border-color: var(--border);
}
html[data-theme="dark"] .ls-recipient-input:focus {
  border-color: var(--p600);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* ── Generate Button — Vibrant CTA ───────────────────────── */
.ls-btn-gen {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 44px);
  margin: 8px 22px 24px;
  padding: 16px 28px;
  border: none;
  border-radius: 50px;
  background: var(--grad);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .02em;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  box-shadow:
    0 4px 16px rgba(0, 56, 147, .3),
    0 8px 32px rgba(0, 56, 147, .14),
    inset 0 1px 0 rgba(255,255,255,.2);
  min-height: 54px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.ls-btn-gen::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  transition: left .6s ease;
}
.ls-btn-gen:hover::before { left: 100%; }
.ls-btn-gen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 50%);
  pointer-events: none;
}
.ls-btn-gen:hover {
  box-shadow:
    0 6px 24px rgba(0, 56, 147, .34),
    0 12px 48px rgba(0, 56, 147, .18);
  transform: translateY(-2px) scale(1.01);
}
.ls-btn-gen:active { transform: scale(.97); }
.ls-btn-gen:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ── “कसरी सुरु गर्ने” — match Flutter _buildHowToStart ───── */
.ls-howto-panel {
  margin: 0 22px 20px;
  padding: 18px 18px 14px;
  background: var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--border-2) 70%, transparent);
  border-radius: 16px;
  box-shadow: var(--sh-sm);
}
.ls-howto-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.ls-howto-bulb {
  font-size: 1.1rem;
  color: var(--p800);
  flex-shrink: 0;
}
html[data-theme="dark"] .ls-howto-bulb {
  color: var(--p600);
}
.ls-howto-title {
  flex: 1;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}
.ls-howto-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ls-howto-close:hover {
  background: color-mix(in srgb, var(--p800) 12%, transparent);
  color: var(--text);
}
html[data-theme="dark"] .ls-howto-close:hover {
  background: color-mix(in srgb, var(--p600) 18%, transparent);
}
.ls-howto-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ls-howto-steps > li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.ls-howto-steps > li:last-child {
  margin-bottom: 0;
}
.ls-howto-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--p800);
  color: #fff;
  font-size: 0.81rem;
  font-weight: 800;
}
html[data-theme="dark"] .ls-howto-num {
  background: var(--p600);
  color: #0c1220;
}
.ls-howto-txt {
  flex: 1;
  padding-top: 3px;
  font-size: 0.91rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-sec);
}

/* वेब / एप जानकारी — below कसरी सुरु गर्ने */
.ls-gen-context-card {
  position: relative;
  margin: 4px 22px 20px;
  padding: 16px 18px 17px 22px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--border-2) 65%, transparent);
  background:
    linear-gradient(145deg, rgba(227, 236, 247, 0.55) 0%, transparent 42%),
    linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.ls-gen-context-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--grad);
  border-radius: 16px 0 0 16px;
}
.ls-gen-context-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.ls-gen-context-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--p100) 0%, rgba(220, 20, 60, 0.08) 100%);
  color: var(--p800);
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(0, 56, 147, 0.1);
}
.ls-gen-context-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.ls-gen-context-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ls-gen-context-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
}
.ls-gen-context-badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--p50);
  color: var(--p800);
  font-size: 0.95rem;
}
.ls-gen-context-badge--phone {
  background: linear-gradient(135deg, #FCE8EB 0%, #FFF5F5 100%);
  color: var(--v600);
}
.ls-gen-context-txt {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  line-height: 1.62;
  font-weight: 500;
  color: var(--text-sec);
}
html[data-theme="dark"] .ls-gen-context-card {
  border-color: rgba(147, 197, 253, 0.18);
  background:
    linear-gradient(145deg, rgba(0, 56, 147, 0.2) 0%, transparent 45%),
    linear-gradient(180deg, var(--surface) 0%, rgba(30, 39, 56, 0.9) 100%);
}
html[data-theme="dark"] .ls-gen-context-ico {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.2) 0%, rgba(220, 20, 60, 0.12) 100%);
  color: var(--p500);
  box-shadow: none;
}
html[data-theme="dark"] .ls-gen-context-badge {
  background: rgba(96, 165, 250, 0.14);
  color: #93c5fd;
}
html[data-theme="dark"] .ls-gen-context-badge--phone {
  background: rgba(220, 20, 60, 0.14);
  color: #fca5a5;
}
html[data-theme="dark"] .ls-gen-context-txt {
  color: #cbd5e1;
}

.ls-btn-text, .ls-btn-load {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.ls-ring {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Message Cards — Floating Glass ───────────────────────── */
.ls-msg-card {
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 16px;
  box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  overflow: hidden;
  animation: msgIn .4s cubic-bezier(.22,1,.36,1);
  transition: box-shadow .3s ease, transform .3s ease;
}
.ls-msg-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-3px);
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ls-msg-body { padding: 16px 18px; }
.ls-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ls-msg-badge {
  font-size: .67rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ls-msg-text {
  font-size: 0.96rem;
  line-height: 1.9;
  white-space: pre-wrap;
  color: var(--text);
  margin: 0 0 14px;
  transition: opacity .18s;
}
/* Message card — one toolbar row (इतिहास / मनपर्ने / घर) */
.ls-msg-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border-radius: 14px;
}
.ls-msg-toolbar-group {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
}
.ls-msg-toolbar-group:last-child {
  margin-left: auto;
  flex: 0 0 auto;
}
.ls-msg-toolbar-sep {
  width: 1px;
  height: 28px;
  flex-shrink: 0;
  background: var(--border-2);
  border-radius: 1px;
  opacity: 0.9;
}
.ls-msg-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--border-2) 70%, transparent);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-sec);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  min-height: 36px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 1px 2px rgba(0, 56, 147, 0.04);
}

/* Toolbar: compact, single-row layout on phones */
@media (max-width: 560px) {
  .ls-msg-toolbar {
    gap: 6px;
    justify-content: space-between;
    padding: 8px 8px;
  }
  .ls-msg-toolbar-sep {
    display: none;
  }
  .ls-msg-toolbar-group {
    flex: 1 1 auto;
    justify-content: flex-start;
  }
  .ls-msg-toolbar-group + .ls-msg-toolbar-group {
    justify-content: flex-end;
  }
  .ls-msg-act {
    padding: 8px 10px;
    min-height: 34px;
    border-radius: 12px;
  }
  /* Hide labels to fit everything in one row */
  .ls-msg-act span { display: none; }
  .ls-msg-act { min-width: 40px; padding-left: 10px; padding-right: 10px; }
}
.ls-msg-act:hover {
  border-color: var(--p500);
  color: var(--p800);
  background: var(--p50);
  box-shadow: 0 2px 8px rgba(0, 56, 147, 0.08);
}
.ls-msg-act i {
  font-size: 0.95rem;
  opacity: 0.92;
}
.ls-msg-act.liked {
  color: var(--rose);
  border-color: rgba(173, 20, 87, 0.28);
  background: linear-gradient(135deg, #fff5f7 0%, #fff 100%);
}
.ls-msg-act.liked:hover {
  background: #ffeef2;
  border-color: rgba(173, 20, 87, 0.45);
}
.ls-msg-act--danger.liked {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.35);
  background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
}
.ls-msg-act--danger.liked:hover {
  background: #fee2e2;
  border-color: rgba(185, 28, 28, 0.5);
  color: #991b1b;
}
.ls-msg-act--pdf {
  border-color: rgba(185, 28, 28, 0.22);
}
.ls-msg-act--pdf:hover {
  border-color: var(--v600);
  color: var(--v700);
  background: var(--v100);
}
.ls-msg-act--spin:hover i {
  transform: rotate(-35deg);
}
.ls-msg-act--spin i {
  transition: transform 0.2s ease;
}

/* ── Cookie consent bar ───────────────────────────────────── */
.ls-cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 950;
  padding: 12px 14px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  background: rgba(15,23,42,.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,.1);
  animation: cookieSlide .35s ease;
}
@keyframes cookieSlide {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.ls-cookie-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.ls-cookie-text {
  font-size: .76rem;
  line-height: 1.55;
  color: rgba(255,255,255,.88);
  flex: 1;
  min-width: 220px;
}
.ls-cookie-privacy-link {
  background: none;
  border: none;
  color: #93C5FD;
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.ls-cookie-accept {
  padding: 10px 20px;
  border: none;
  border-radius: 50px;
  background: var(--grad);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s, opacity .15s;
}
.ls-cookie-accept:hover { opacity: .92; transform: scale(1.02); }

@media (max-width: 767px) {
  .ls-cookie-bar:not(.hidden) {
    bottom: var(--bnav-h);
  }
}

/* ── Modals ───────────────────────────────────────────────── */
.ls-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 980;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .2s ease;
}
.ls-modal {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  animation: pageIn .25s ease;
}
.ls-modal-wide { max-width: 520px; }
.ls-modal-edit { max-width: 560px; }

.ls-edit-lead {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-sec);
  margin-bottom: 12px;
}
.ls-edit-textarea-box {
  position: relative;
}
.ls-edit-textarea-box .ls-modal-textarea {
  padding-right: 52px;
  min-height: 200px;
}
.ls-edit-mic-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 40px;
  height: 40px;
  border-radius: var(--r-xs);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--p700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  box-shadow: var(--sh-xs);
}
.ls-edit-mic-btn:hover {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--sh-sm);
}
.ls-edit-mic-btn.listening {
  background: linear-gradient(135deg, var(--rose), #fb7185);
  color: #fff;
  border-color: transparent;
  animation: mic-pulse 1.2s infinite;
}
.ls-edit-toolbar {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ls-edit-kbd-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.ls-edit-kbd-open:hover {
  background: var(--p50);
  border-color: var(--p500);
  color: var(--p800);
}
.ls-edit-kbd-open i { font-size: 1.05rem; color: var(--p600); }
.ls-edit-kbd-open.open {
  border-color: var(--p500);
  background: var(--p50);
  color: var(--p700);
}
.ls-edit-kbd-open.open i { color: var(--p700); }

/* Edit modal floating keyboard — above overlay backdrop */
.ls-kbd-edit.ls-kbd-wk--float {
  z-index: 1010 !important;
}
.ls-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.ls-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.ls-modal-x {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.ls-modal-x:hover { background: var(--border); color: var(--text); }
.ls-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
}
.ls-modal-foot {
  padding: 12px 18px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.ls-modal-foot-split { justify-content: space-between; }
.ls-modal-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.7;
  resize: vertical;
  min-height: 180px;
  font-family: 'Noto Sans Devanagari', 'Poppins', sans-serif;
  background: var(--surface-2);
  color: var(--text);
}
.ls-modal-textarea:focus {
  outline: none;
  border-color: var(--p600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

html[data-theme="dark"] .ls-modal-textarea:focus {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}
.ls-btn-modal-primary {
  padding: 10px 22px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: .86rem;
  cursor: pointer;
  transition: opacity .15s;
}
.ls-btn-modal-primary:hover { opacity: .9; }
.ls-btn-modal-secondary {
  padding: 10px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-sec);
  font-weight: 600;
  font-size: .86rem;
  cursor: pointer;
}
.ls-btn-modal-secondary:hover { background: var(--surface-2); }

.ls-privacy-body {
  font-size: .82rem;
  line-height: 1.75;
  color: var(--text-sec);
}
.ls-privacy-body p { margin-bottom: 12px; }
.ls-privacy-body ul {
  margin: 8px 0 14px 1.1rem;
  padding: 0;
}
.ls-privacy-body li { margin-bottom: 8px; }
.ls-privacy-body a { color: var(--p700); font-weight: 600; }
.ls-privacy-muted {
  font-size: .76rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.ls-contact-mail-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--p700);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  vertical-align: baseline;
}
.ls-contact-mail-btn:hover {
  color: var(--p800);
}
html[data-theme="dark"] .ls-contact-mail-btn {
  color: #93c5fd;
}
html[data-theme="dark"] .ls-contact-mail-btn:hover {
  color: #bfdbfe;
}

.ls-footer-link {
  display: block;
  margin-top: 10px;
  background: none;
  border: none;
  padding: 0;
  color: var(--p500);
  font-size: .72rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.ls-sidebar-privacy {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--p700);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.ls-sidebar-privacy:hover { background: var(--p50); }

/* ── Nibedan preview ──────────────────────────────────────── */
.ls-nibedan-preview {
  background: #FFFDF7;
  border: 1px solid #E8E0CE;
  border-radius: var(--r-sm);
  padding: 20px;
  font-size: .85rem;
  line-height: 2;
  white-space: pre-wrap;
  color: var(--text);
  margin-bottom: 14px;
}

/* ── Expandable details ───────────────────────────────────── */
.ls-details { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.ls-details-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--p700);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
}
.ls-details-toggle::-webkit-details-marker { display: none; }
.ls-details-toggle i { transition: transform .2s; }
.ls-details[open] .ls-details-toggle i { transform: rotate(45deg); }

/* ── Skeleton ─────────────────────────────────────────────── */
.ls-sk {
  display: block;
  background: linear-gradient(90deg, #E8EDFA 25%, #F3F6FC 50%, #E8EDFA 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Empty state ──────────────────────────────────────────── */
.ls-empty {
  text-align: center;
  padding: 64px 28px;
}
.ls-empty-illo {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: .5;
  filter: grayscale(30%);
}
.ls-empty-title { font-size: .95rem; font-weight: 700; color: var(--text-sec); margin-bottom: 6px; }
.ls-empty-hint  { font-size: 0.82rem; line-height: 1.55; color: var(--text-muted); }

/* ── Patro (calendar) ───────────────────────────────────────── */

/* Add-event button: keep title + button on same row at tablet/desktop */
#page-patro .ls-page-hero {
  flex-wrap: nowrap;
}
#page-patro .ls-page-hero > div {
  min-width: 0;          /* allow title/sub to shrink so button stays inline */
}
#page-patro .ls-page-hero .ls-btn-gen {
  width: fit-content;    /* never expand beyond content width */
  margin: 0 0 0 auto;   /* push right, strip default CTA margins */
  padding: 10px 18px;
  flex-shrink: 0;
  white-space: nowrap;
}

.ls-patro-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: nowrap;   /* keep nav on one row */
}
.ls-patro-nav {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-sec);
  transition: transform .12s, background .15s, border-color .15s, color .15s;
}
.ls-patro-nav:hover { background: var(--p50); border-color: var(--p500); color: var(--p700); }
.ls-patro-nav:active { transform: translateY(1px); }
.ls-patro-title { flex: 1 1 auto; min-width: 160px; text-align: center; }
.ls-patro-month { font-size: 1.05rem; font-weight: 900; color: var(--text); letter-spacing: -0.02em; }
.ls-patro-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.ls-patro-todayline{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255,255,255,0.7);
  color: var(--text-sec);
  font-size: 0.82rem;
  font-weight: 700;
}
html[data-theme="dark"] .ls-patro-todayline{
  background: rgba(2,6,23,0.35);
  border-color: rgba(148, 163, 184, 0.20);
}
.ls-patro-todayline .bs{ color: var(--text); }
.ls-patro-todayline .sep{ opacity: 0.65; }

/* Patro: grid wrapper so popover can be positioned */
.ls-patro-gridwrap{
  position: relative;
}

/* Patro: floating day popover above clicked cell */
.ls-patro-pop{
  position: absolute;
  z-index: 5;
  width: min(360px, calc(100% - 12px));
  max-width: 360px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.16);
  backdrop-filter: blur(10px);
}
html[data-theme="dark"] .ls-patro-pop{
  background: rgba(2,6,23,0.62);
  border-color: rgba(148, 163, 184, 0.20);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.40);
}
.ls-patro-pop-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.ls-patro-pop-title{
  font-weight: 900;
  color: var(--text);
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}
.ls-patro-pop-x{
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ls-patro-pop-x:hover{ background: rgba(148, 163, 184, 0.22); color: var(--text); }
.ls-patro-pop-body{
  padding: 12px;
  max-height: 240px;
  overflow: auto;
}
.ls-patro-pop-arrow{
  position: absolute;
  width: 14px;
  height: 14px;
  background: inherit;
  border-right: 1px solid rgba(148, 163, 184, 0.22);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  transform: rotate(45deg);
  bottom: -8px;
  left: var(--arrow-left, 24px);
}
html[data-theme="dark"] .ls-patro-pop-arrow{
  border-right-color: rgba(148, 163, 184, 0.20);
  border-bottom-color: rgba(148, 163, 184, 0.20);
}
.ls-patro-today {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.78rem;
  transition: transform .12s, background .15s, border-color .15s, color .15s;
}
.ls-patro-today:hover { background: var(--p50); border-color: var(--p500); color: var(--p700); }
.ls-patro-today:active { transform: translateY(1px); }
.ls-patro-grid {
  display: grid;
  /* minmax(0,1fr) lets columns shrink below content min-width so all 7 fit */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  padding: 10px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.ls-patro-dow {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 2px 8px;
  letter-spacing: 0.02em;
  user-select: none;
}
/* Sunday + Saturday headers in red */
.ls-patro-dow:first-child,
.ls-patro-dow:last-child { color: #B91C1C; }

/* ── Day cells ── */
.ls-patro-cell {
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: var(--surface);
  min-height: 74px;
  min-width: 0;
  padding: 7px 7px 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.ls-patro-cell:hover {
  border-color: rgba(0,56,147,0.3);
  background: rgba(0,56,147,0.04);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,56,147,0.10);
  z-index: 1;
}
.ls-patro-cell:focus-visible {
  outline: 2px solid rgba(0,56,147,0.5);
  outline-offset: 1px;
}
.ls-patro-cell--blank {
  visibility: hidden;
  pointer-events: none;
  background: transparent;
  box-shadow: none;
}

/* BS date — the primary large number */
.ls-patro-day {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  flex: 1;
}
.ls-patro-bs {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
}
.ls-patro-ad {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0.8;
}

/* Tithi (when available) */
.ls-patro-tithi{
  margin-top: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.72);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.14);
  border-radius: 10px;
  padding: 4px 6px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-theme="dark"] .ls-patro-tithi{
  color: rgba(226, 232, 240, 0.82);
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.22);
}

/* Event dots */
.ls-patro-dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 1px; }
.ls-patro-dot  { width: 5px; height: 5px; border-radius: 50%; background: rgba(0,56,147,0.5); flex-shrink: 0; }
.ls-patro-dot.warn    { background: rgba(220,20,60,0.6); }
.ls-patro-dot.fest    { background: #6366f1; }
.ls-patro-dot.holiday { background: #DC143C; }

/* ── Weekend (Sat red, Sun red) ── */
.ls-patro-cell.weekend { background: rgba(185,28,28,0.03); }
.ls-patro-cell.weekend .ls-patro-bs { color: #B91C1C; }
.ls-patro-cell.weekend .ls-patro-ad { color: rgba(185,28,28,0.65); }

/* ── Public holiday ── */
.ls-patro-cell.holiday {
  background: rgba(220,20,60,0.05);
  border-color: rgba(220,20,60,0.18);
}
.ls-patro-cell.holiday .ls-patro-bs { color: #B91C1C; }

/* ── Selected ── */
.ls-patro-cell.selected {
  border-color: rgba(220,20,60,0.5);
  background: rgba(220,20,60,0.07);
  box-shadow: 0 0 0 3px rgba(220,20,60,0.12), 0 2px 8px rgba(220,20,60,0.1);
}

/* ── TODAY — bold filled highlight ── */
.ls-patro-cell.today {
  background: linear-gradient(135deg, #003893 0%, #1A5DC8 100%);
  border-color: #003893;
  box-shadow: 0 4px 16px rgba(0,56,147,0.40), 0 1px 4px rgba(0,56,147,0.25);
  transform: translateY(-1px);
}
.ls-patro-cell.today .ls-patro-bs { color: #fff; font-size: 1.2rem; }
.ls-patro-cell.today .ls-patro-ad { color: rgba(255,255,255,0.75); opacity: 1; }
.ls-patro-cell.today .ls-patro-dot { background: rgba(255,255,255,0.7); }
.ls-patro-cell.today .ls-patro-tithi{
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.26);
}
.ls-patro-cell.today:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,56,147,0.45);
  background: linear-gradient(135deg, #002f7a 0%, #1750b8 100%);
  border-color: #002f7a;
}

/* Today + selected → today wins */
.ls-patro-cell.today.selected {
  border-color: #003893;
  box-shadow: 0 0 0 3px rgba(0,56,147,0.30), 0 4px 16px rgba(0,56,147,0.40);
}

/* Weekend today */
.ls-patro-cell.today.weekend .ls-patro-bs { color: #fff; }

.ls-patro-dayinfo {
  display: grid;
  gap: 10px;
}
.ls-patro-dayinfo-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ls-patro-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255,255,255,0.90);
}
html[data-theme="dark"] .ls-patro-pill{
  background: rgba(2,6,23,0.32);
  border-color: rgba(148, 163, 184, 0.20);
  color: rgba(226,232,240,0.92);
}
.ls-patro-pill.holiday {
  border-color: rgba(185, 28, 28, 0.25);
  background: rgba(254, 226, 226, 0.55);
  color: #991B1B;
}
.ls-patro-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Patro dashboard layout (top row + calendar below) ─────── */
.ls-patro-layout{
  display: grid;
  gap: 16px;
}
.ls-patro-layout .ls-card{ margin-bottom: 0; } /* gap handles spacing */
.ls-patro-card-body{ padding-bottom: 12px; }

.ls-patro-toprow{
  display: grid;
  gap: 16px;
}

@media (min-width: 920px){
  .ls-patro-toprow{
    grid-template-columns: 1.05fr 0.95fr;
    align-items: stretch;
  }
  .ls-patro-events-card .ls-card-body{
    max-height: 360px;
    overflow: auto;
  }
  .ls-patro-info-card .ls-card-body{
    max-height: 360px;
    overflow: auto;
  }
  .ls-patro-grid { gap: 6px; padding: 12px; }
  .ls-patro-cell { min-height: 90px; border-radius: 12px; padding: 9px 8px 7px; }
  .ls-patro-bs   { font-size: 1.25rem; }
  .ls-patro-cell.today .ls-patro-bs { font-size: 1.3rem; }
  .ls-patro-month { font-size: 1.15rem; }
}

/* ═══════════════════════════════════════════════════════════════
   Patro: mobile refinements (≤ 599 px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 599px) {

  /* 1 · Tighter grid gaps */
  .ls-patro-grid { gap: 3px; padding: 8px; }

  /* 2 · Compact cells – tithi is hidden so they can shrink */
  .ls-patro-cell {
    min-height: 52px;
    padding: 5px 4px 3px;
    border-radius: 8px;
    box-shadow: none;
  }
  .ls-patro-bs { font-size: 1rem; }
  .ls-patro-cell.today { transform: none; }         /* no lift on small screens */
  .ls-patro-cell.today .ls-patro-bs { font-size: 1.05rem; }

  /* 3 · Hide tithi text in cells – too cramped on narrow widths */
  .ls-patro-tithi { display: none; }
}

/* Hide tithi on tablet too — cells not wide enough until desktop */
@media (max-width: 859px) {
  .ls-patro-tithi { display: none; }

  /* 4 · Smaller event dots */
  .ls-patro-dot { width: 4px; height: 4px; }
  .ls-patro-dots { gap: 2px; }

  /* 5 · Month navigation header */
  .ls-patro-month { font-size: 0.95rem; }
  .ls-patro-sub   { font-size: 0.7rem;  }
  .ls-patro-nav   { width: 36px; height: 36px; }

  /* 6 · Day-of-week column labels */
  .ls-patro-dow { font-size: 0.65rem; padding: 3px 0 7px; letter-spacing: 0; }

  /* 7 · Today line strip */
  .ls-patro-todayline { font-size: 0.76rem; gap: 6px; padding: 7px 12px; }

  /* 8 · Hero: CTA button full-width on mobile (override nowrap from base rule) */
  #page-patro .ls-page-hero { flex-wrap: wrap; gap: 8px; }
  #page-patro .ls-page-hero > div { min-width: unset; }
  #page-patro .ls-page-hero .ls-btn-gen {
    width: 100%;
    margin: 0 !important;
    padding: 12px 16px;
    font-size: 0.9rem;
    border-radius: 14px;
    white-space: normal;
  }

  /* 9 · Floating day-detail popover → bottom sheet */
  /*    CSS !important overrides the inline styles set by patroPositionDayPopover() */
  .ls-patro-pop {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: 68px !important;   /* sits above the 60 px bottom nav */
    top: auto !important;
    width: auto !important;
    max-height: 52vh;
    overflow: hidden;
    border-radius: 22px 22px 16px 16px;
    z-index: 210;              /* above bottom nav z-index: 200 */
    box-shadow:
      0 -4px 40px rgba(2, 6, 23, 0.18),
      0 0 0 1px rgba(148, 163, 184, 0.14);
    animation: patroSheetIn 0.26s cubic-bezier(0.34, 1.2, 0.64, 1) both;
  }
  /* Drag-handle pill (standard mobile bottom-sheet indicator) */
  .ls-patro-pop::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.45);
    margin: 8px auto 0;
  }
  html[data-theme="dark"] .ls-patro-pop::before {
    background: rgba(226, 232, 240, 0.22);
  }
  /* Scrollable body region inside the sheet */
  .ls-patro-pop-body { max-height: calc(52vh - 62px); overflow-y: auto; }
  /* Hide the caret arrow – not meaningful for a bottom sheet */
  .ls-patro-pop-arrow { display: none !important; }

  /* 10 · Events list below calendar: tighter header */
  .ls-patro-events-table-card .ls-card-header {
    padding: 14px 16px 10px;
  }
}

/* Bottom-sheet slide-up animation (used by .ls-patro-pop on mobile) */
@keyframes patroSheetIn {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Patro legend ─────────────────────────────────────────── */
.ls-patro-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 4px 0;
  margin-top: 4px;
}
.ls-patro-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Day info enhancements ────────────────────────────────── */
.ls-patro-day-headline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.ls-patro-dow-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--p50);
  color: var(--p700);
  border: 1px solid rgba(0,56,147,0.15);
}
.ls-patro-dow-badge.sat,
.ls-patro-dow-badge.sun { background: rgba(185,28,28,0.08); color: #B91C1C; border-color: rgba(185,28,28,0.18); }
.ls-patro-dow-badge.holiday { background: rgba(185,28,28,0.10); color: #991B1B; border-color: rgba(185,28,28,0.22); }
.ls-patro-pill.tithi { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.22); color: #4338ca; }
.ls-patro-event-icon { font-size: 1rem; line-height: 1; flex-shrink: 0; }
.ls-patro-eventline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255,255,255,0.92);
}
.ls-patro-eventline strong { font-weight: 900; color: var(--text); }
html[data-theme="dark"] .ls-patro-eventline{
  background: rgba(2,6,23,0.38);
  border-color: rgba(148, 163, 184, 0.20);
}

/* ── Day info: two scrollable lists ────────────────────────── */
.ls-patro-day-sections{
  display: grid;
  gap: 12px;
  margin-top: 10px;
}
.ls-patro-day-section{
  display: grid;
  gap: 8px;
}
.ls-patro-day-section-h{
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* Patro: add-event title field should support long dictation */
#patroEventInput{
  min-height: 78px;
  line-height: 1.35;
  resize: vertical;
  padding-right: 46px; /* space for mic button inside input group */
  overflow-y: auto;
}
.ls-patro-events-scroll{
  max-height: 180px;
  overflow: auto;
  padding-right: 6px;
}
@media (min-width: 920px){
  .ls-patro-events-scroll{ max-height: 220px; }
}

/* Panchangam */
.ls-patro-panchangam {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ls-patro-panch-item {
  font-size: 0.74rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.ls-patro-event {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.ls-patro-event-title { font-weight: 800; color: var(--text); }
.ls-patro-event-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.ls-patro-event-del {
  border: 1px solid rgba(220, 20, 60, 0.35);
  color: #B91C1C;
  background: rgba(220, 20, 60, 0.08);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}
.ls-patro-event-del:hover { background: rgba(220, 20, 60, 0.12); }

/* Patro: events table/list under calendar */
.ls-patro-events-table-card .ls-card-body{ padding-top: 10px; }
.ls-patro-etable{
  display: grid;
  gap: 8px;
}
.ls-patro-erow{
  display: grid;
  grid-template-columns: 128px 78px 1fr 44px;
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255,255,255,0.92);
}
html[data-theme="dark"] .ls-patro-erow{
  background: rgba(2,6,23,0.38);
  border-color: rgba(148, 163, 184, 0.22);
}
.ls-patro-erow.head{
  background: transparent;
  border: none;
  padding: 0 10px;
}
.ls-patro-erow.head .c{
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ls-patro-erow .c{
  font-size: 0.88rem;
  color: var(--text);
}
.ls-patro-erow .c.date,
.ls-patro-erow .c.time{
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--text);
}
.ls-patro-etitle{
  font-weight: 900;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ls-patro-emeta{
  display: none;
  margin-top: 3px;
  font-size: 0.80rem;
  color: var(--text-sec);
  font-weight: 700;
}
.ls-patro-erow .c.act{
  display: flex;
  justify-content: flex-end;
}
@media (max-width: 720px){
  .ls-patro-erow{
    grid-template-columns: 1fr 44px;
    grid-template-areas:
      "title act"
      "title act";
    align-items: start;
  }
  .ls-patro-erow.head{ display:none; }
  .ls-patro-erow .c.date,
  .ls-patro-erow .c.time{ display:none; }
  .ls-patro-erow .c.title{ grid-area: title; }
  .ls-patro-erow .c.act{ grid-area: act; }
  .ls-patro-emeta{ display: block; }
}

.ls-muted { font-size: 0.82rem; color: var(--text-muted); margin-top: 8px; }
.ls-patro-conflict {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(220, 20, 60, 0.25);
  background: rgba(220, 20, 60, 0.06);
}
.ls-patro-conflict-title { font-weight: 900; color: var(--text); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }

/* Patro: add-event date/time picker row */
.ls-patro-dt{
  display: grid;
  gap: 12px;
  margin-top: 8px;
}
.ls-patro-dt-col .ls-label{ margin-bottom: 6px; display: inline-flex; align-items: center; gap: 6px; }
.ls-patro-dt-col .ls-muted{ margin-top: 6px; }
@media (min-width: 720px){
  .ls-patro-dt{ grid-template-columns: 1fr 0.7fr; align-items: start; }
}

/* Patro: date mode switch (AD / BS) */
.ls-patro-date-switch{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255,255,255,0.6);
  margin: 6px 0 8px;
}
html[data-theme="dark"] .ls-patro-date-switch{
  background: rgba(2,6,23,0.30);
  border-color: rgba(148, 163, 184, 0.18);
}
.ls-patro-date-tab{
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 900;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.ls-patro-date-tab.active{
  background: rgba(0,56,147,0.10);
  color: var(--p700);
}
html[data-theme="dark"] .ls-patro-date-tab.active{
  background: rgba(37,99,235,0.18);
  color: rgba(226,232,240,0.92);
}

/* Patro: BS date input with calendar picker */
.ls-patro-bsdate-wrap{
  position: relative;
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  align-items: stretch;
}
.ls-patro-bsdate-btn{
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ls-patro-bsdate-btn:hover{ background: var(--surface-2); }

.ls-patro-bspicker{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255,255,255,0.96);
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.18);
  padding: 10px;
}
html[data-theme="dark"] .ls-patro-bspicker{
  background: rgba(2,6,23,0.72);
  border-color: rgba(148, 163, 184, 0.20);
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
}
.ls-patro-bsp-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.ls-patro-bsp-title{
  font-weight: 900;
  color: var(--text);
  font-size: 0.9rem;
  text-align: center;
  flex: 1 1 auto;
}
.ls-patro-bsp-nav{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.10);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ls-patro-bsp-nav:hover{ background: rgba(148, 163, 184, 0.16); }
.ls-patro-bsp-grid{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.ls-patro-bsp-dow{
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 0;
}
.ls-patro-bsp-day,
.ls-patro-bsp-blank{
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255,255,255,0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.ls-patro-bsp-blank{
  visibility: hidden;
  pointer-events: none;
  border: none;
  background: transparent;
}
.ls-patro-bsp-day:hover{
  border-color: rgba(0,56,147,0.30);
  background: rgba(0,56,147,0.08);
}
.ls-patro-bsp-day.sel{
  background: linear-gradient(135deg, #003893 0%, #1A5DC8 100%);
  border-color: #003893;
  color: #fff;
}

/* ── Buttons: secondary/danger ────────────────────────────── */
.ls-btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border: 1.5px solid #FECACA;
  border-radius: var(--r-sm);
  background: #FFF5F5;
  color: var(--rose);
  font-size: .78rem;
  font-weight: 600;
  transition: all .16s;
  white-space: nowrap;
  min-height: 36px;
}
.ls-btn-danger:hover { background: #FEE2E2; border-color: #FCA5A5; }

.ls-voice-stop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border: 2px solid var(--rose);
  border-radius: 50px;
  background: transparent;
  color: var(--rose);
  font-size: .86rem;
  font-weight: 600;
  transition: all .16s;
}
.ls-voice-stop:hover { background: #FFF0F3; }

/* ── Toast ────────────────────────────────────────────────── */
.ls-toast-host {
  position: fixed;
  bottom: calc(var(--bnav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 990;
  pointer-events: none;
}
@media (min-width: 768px) { .ls-toast-host { bottom: 28px; } }

.ls-toast {
  background: linear-gradient(135deg, #003893 0%, #1A5DC8 100%);
  color: #fff;
  padding: 12px 26px;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(16px) scale(.94);
  transition: all .3s cubic-bezier(.22,1,.36,1);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 28px rgba(0, 56, 147, .3), 0 2px 8px rgba(0, 0, 0, .1);
  border: 1px solid rgba(255,255,255,.14);
}
.ls-toast.show { opacity: 1; transform: translateY(0) scale(1); }

/* ── Voice overlay ────────────────────────────────────────── */
.ls-voice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
.ls-voice-modal {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: var(--r-xl);
  padding: 28px 22px 22px;
  max-width: min(340px, 92vw);
  width: 92%;
  box-shadow: 0 16px 64px rgba(0,0,0,.15), 0 4px 16px rgba(0,0,0,.08);
  border: 1px solid rgba(255,255,255,.3);
  text-align: center;
}
.ls-voice-pulse {
  position: relative;
  width: 80px; height: 80px;
  margin: 0 auto 18px;
}
.ls-voice-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(225,29,72,.15);
  animation: vring 2s infinite;
}
.r2 { animation-delay: .5s; }
.r3 { animation-delay: 1s; }
@keyframes vring {
  0%   { transform: scale(1); opacity: .8; }
  100% { transform: scale(1.9); opacity: 0; }
}
.ls-voice-core {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), #FB7185);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  z-index: 1;
}
.ls-voice-status  { font-size: .95rem; font-weight: 700; margin-bottom: 6px; }
.ls-voice-transcript {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  min-height: 24px;
  line-height: 1.5;
  word-break: break-word;
}

.ls-voice-done-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.ls-voice-done-text {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
  text-align: left;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  max-height: 42vh;
  overflow-y: auto;
  word-break: break-word;
}
.ls-voice-done-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ls-voice-done-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.15s;
}
.ls-voice-done-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.ls-voice-done-btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 56, 147, 0.28);
}
.ls-voice-done-btn-primary:hover:not(:disabled) {
  opacity: 0.94;
  transform: translateY(-1px);
}
.ls-voice-done-btn-muted {
  background: var(--surface-2);
  color: var(--text-sec);
  border: 1.5px solid var(--border);
}
.ls-voice-done-btn-muted:hover {
  background: var(--border);
}

/* ═══ लेख्ने ठाउँ — Writing Workspace ═══════════════════════ */
#page-write {
  background: linear-gradient(180deg, #E0F2FE 0%, #F0F9FF 40%, #F8FBFF 100%);
  min-height: calc(100vh - var(--hdr-h) - var(--bnav-h));
  margin: -12px -14px -24px;
  padding: 16px 12px calc(24px + env(safe-area-inset-bottom, 0));
}
@media (min-width: 901px) {
  #page-write {
    margin: 0;
    min-height: calc(100vh - var(--hdr-h));
    padding: 24px 20px 48px;
  }
}
html[data-theme="dark"] #page-write {
  background: linear-gradient(180deg, #0B1120 0%, #141E33 100%);
}
.ls-write-shell {
  max-width: 820px;
  margin: 0 auto;
  position: relative;
}
/* Writing header now uses the shared `.ls-page-hero` pattern. */
.ls-write-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
/* Align write actions to the right inside page hero row */
#page-write .ls-page-hero .ls-write-head-actions { margin-left: auto; }

.ls-write-head-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--sh-xs);
}
.ls-write-head-btn i{ font-size: 1rem; color: var(--p700); }
.ls-write-head-btn:hover{
  border-color: rgba(0,56,147,0.28);
  background: rgba(0,56,147,0.04);
}
.ls-write-head-btn--primary{
  border-color: rgba(0,56,147,0.28);
  background: linear-gradient(135deg, rgba(0, 56, 147, 0.12), rgba(220, 20, 60, 0.06));
}
.ls-write-head-btn--primary i{ color: var(--p700); }

/* Workspace toolbar layout:
   Prefer 2 tidy rows; add more rows only on narrower widths. */
.ls-write-tbar-top{ flex-wrap: nowrap; }
.ls-wkbar{
  display: flex;
  flex-wrap: wrap; /* fill row 1, then row 2, etc. */
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
}
/* Rows are a semantic grouping only; let items flow naturally so
   unused space on row 1 can be filled by later groups. */
.ls-wkbar-r{ display: contents; }
.ls-wkbar-g{ padding: 1px; }
.ls-wkbar::-webkit-scrollbar{ display:none; }
.ls-wkbar-g{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 1px;
  border-radius: 14px;
  background: rgba(0,56,147,0.04);
  border: 1px solid rgba(148,163,184,0.20);
  flex: 0 0 auto;
}
html[data-theme="dark"] .ls-wkbar-g{
  background: rgba(2,6,23,0.22);
  border-color: rgba(148,163,184,0.18);
}
.ls-wkbar-sep{
  width:1px;
  height: 24px;
  background: rgba(148,163,184,0.30);
  margin: 0 2px;
}
.ls-wkbar-spacer{ flex: 1 1 auto; min-width: 12px; }

/* Reusable toolbar button (44x44 min target) */
.ls-tbtn{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.22);
  background: var(--surface);
  color: var(--text);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 0.98rem; /* slightly smaller icons to fit 2 rows */
  cursor:pointer;
  flex: 0 0 auto;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}
.ls-tbtn i{ font-size: 0.98rem; line-height: 1; }
.ls-tbtn:hover{
  background: var(--p50);
  border-color: rgba(0,56,147,0.35);
}
.ls-tbtn:active{ transform: scale(0.98); }
.ls-tbtn:disabled,
.ls-tbtn[aria-disabled="true"]{
  opacity: 0.55;
  cursor: not-allowed;
}
.ls-tbtn:focus-visible{
  outline: 3px solid rgba(0,56,147,0.38);
  outline-offset: 2px;
}
html[data-theme="dark"] .ls-tbtn{
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(147, 197, 253, 0.22);
}
html[data-theme="dark"] .ls-tbtn:hover{
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(147, 197, 253, 0.35);
}

/* Segmented control */
.ls-seg{
  display:inline-flex;
  border-radius: 12px;
  overflow:hidden;
  border: 1px solid rgba(148,163,184,0.22);
  background: var(--surface);
}
.ls-seg-btn{
  min-width: 44px;
  height: 44px;
  border: none;
  border-right: 1px solid rgba(148,163,184,0.18);
  background: transparent;
  color: var(--text-sec);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.ls-seg-btn i{ font-size: 0.95rem; line-height: 1; }
.ls-seg-btn:last-child{ border-right: none; }
.ls-seg-btn[aria-pressed="true"]{
  background: rgba(0,56,147,0.10);
  color: var(--p700);
  font-weight: 900;
}
.ls-seg-btn:focus-visible{
  outline: 3px solid rgba(0,56,147,0.38);
  outline-offset: -3px;
}
html[data-theme="dark"] .ls-seg{
  background: rgba(15,23,42,0.72);
  border-color: rgba(147,197,253,0.22);
}
html[data-theme="dark"] .ls-seg-btn{ color: rgba(226,232,240,0.80); border-right-color: rgba(148,163,184,0.18); }
html[data-theme="dark"] .ls-seg-btn[aria-pressed="true"]{ background: rgba(0,56,147,0.26); color: rgba(147,197,253,0.95); }

/* Select controls in toolbar */
.ls-wk-select{
  height: 44px;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.22);
  background: var(--surface);
}
.ls-wk-select-ic{ opacity: 0.85; color: var(--text-sec); }
.ls-wk-select-sel{
  height: 42px;
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 900;
  outline: none;
}
.ls-wk-select:focus-within{
  outline: 3px solid rgba(0,56,147,0.30);
  outline-offset: 2px;
}
html[data-theme="dark"] .ls-wk-select{
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(147, 197, 253, 0.22);
}

/* Mic state (not color-only: dot + border change) */
.ls-tbtn--mic .ls-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(220,20,60,0.55);
  position: absolute;
  transform: translate(13px, -13px);
}
.ls-tbtn--mic{ position: relative; }
.ls-tbtn--mic.listening .ls-dot{ background: rgba(0,56,147,0.75); }
.ls-tbtn--mic.listening{
  border-color: rgba(0,56,147,0.55);
}

/* Menu (More) */
.ls-wkbar-more{ position: relative; display: inline-flex; align-items: center; }
.ls-menu{
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  z-index: 20;
  background: var(--surface);
  border: 1px solid rgba(148,163,184,0.24);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.18);
  padding: 8px;
}
html[data-theme="dark"] .ls-menu{
  background: rgba(2,6,23,0.94);
  border-color: rgba(148,163,184,0.20);
  box-shadow: 0 18px 60px rgba(0,0,0,0.50);
}
.ls-menu-item{
  width: 100%;
  min-height: 44px;
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}
.ls-menu-item:hover{ background: rgba(0,56,147,0.06); border-color: rgba(0,56,147,0.14); }
.ls-menu-item:focus-visible{ outline: 3px solid rgba(0,56,147,0.38); outline-offset: 2px; }
.ls-menu-row{ display:flex; gap: 8px; }
.ls-menu-row .ls-menu-item{ width: 50%; justify-content:center; font-weight: 900; }
.ls-menu-sep{ height:1px; background: rgba(148,163,184,0.24); margin: 8px 4px; }
.ls-menu-item--danger{ color: #B91C1C; }
html[data-theme="dark"] .ls-menu-item--danger{ color: rgba(248,113,113,0.92); }

/* Hide helper */
.ls-sr{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  white-space:nowrap;border:0;
}

/* Workspace: font size control in top row */
.ls-wk-font{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(0, 56, 147, 0.18);
  background: rgba(255,255,255,0.70);
  box-shadow: 0 4px 14px rgba(0, 56, 147, 0.08);
  flex: 0 0 auto;
}
.ls-wk-font i{ font-size: 1rem; opacity: 0.85; }
.ls-wk-font-sel{
  border: none;
  background: transparent;
  font-weight: 900;
  color: var(--text);
  outline: none;
  padding: 0;
}
html[data-theme="dark"] .ls-wk-font{
  background: rgba(2,6,23,0.30);
  border-color: rgba(148, 163, 184, 0.16);
  color: rgba(226,232,240,0.92);
}
html[data-theme="dark"] .ls-wk-font-sel{ color: rgba(226,232,240,0.92); }

/* Mic state indicator (in the right group) */
.ls-write-tbar-right #wkVoiceBtnTop {
  background: rgba(220, 20, 60, 0.12);
  border-color: rgba(220, 20, 60, 0.26);
  color: #B91C1C;
}
.ls-write-tbar-right #wkVoiceBtnTop:hover {
  background: rgba(220, 20, 60, 0.16);
  border-color: rgba(220, 20, 60, 0.38);
  color: #991B1B;
}
.ls-write-tbar-right #wkVoiceBtnTop.listening {
  background: rgba(0, 56, 147, 0.16);
  border-color: rgba(0, 56, 147, 0.34);
  color: #003893;
}
.ls-write-tbar-right #wkVoiceBtnTop.listening:hover {
  background: rgba(0, 56, 147, 0.22);
  border-color: rgba(0, 56, 147, 0.46);
  color: #003893;
}
html[data-theme="dark"] .ls-write-tbar-right {
  background: linear-gradient(135deg, rgba(0, 56, 147, 0.22), rgba(220, 20, 60, 0.14));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
html[data-theme="dark"] .ls-write-tbar-right .ls-wt-btn {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(147, 197, 253, 0.22);
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
html[data-theme="dark"] .ls-write-tbar-right .ls-wt-btn:hover {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(147, 197, 253, 0.35);
  color: #93C5FD;
}
html[data-theme="dark"] .ls-write-tbar-right #wkVoiceBtnTop {
  background: rgba(220, 20, 60, 0.16);
  border-color: rgba(248, 113, 113, 0.25);
  color: rgba(255, 200, 200, 0.9);
}
html[data-theme="dark"] .ls-write-tbar-right #wkVoiceBtnTop.listening {
  background: rgba(0, 56, 147, 0.26);
  border-color: rgba(147, 197, 253, 0.28);
  color: rgba(147, 197, 253, 0.95);
}

/* Allow wrapping only on small screens */
@media (max-width: 560px) {
  .ls-write-tbar-top { flex-wrap: wrap; }
  .ls-write-tbar-left,
  .ls-write-tbar-right { flex-wrap: wrap; }
  .ls-write-tbar-left { overflow-x: visible; }
}
.ls-write-mic--head {
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.ls-write-kbd-toggle--head {
  padding: 7px 12px;
  font-size: 0.72rem;
  flex-shrink: 0;
}
.ls-write-kbd-toggle--head span {
  display: none;
}
@media (min-width: 420px) {
  .ls-write-kbd-toggle--head span {
    display: inline;
  }
}
.ls-write-save {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green);
  padding: 4px 10px;
  border-radius: 50px;
  background: rgba(5, 150, 105, 0.1);
}
.ls-write-save.wk-saving {
  color: var(--text-muted);
  background: var(--surface-2);
}
.ls-write-share-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 50px;
  border: none;
  background: var(--grad);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--sh-sm);
}
.ls-write-share-head:hover { opacity: 0.94; }

.ls-write-toolbar {
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  box-shadow: var(--sh-xs);
  padding: 8px 10px;
  margin-bottom: 12px;
}
.ls-write-tbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

/* Desktop: keep the write top toolbar on ONE row (no wrap).
   If buttons overflow, the left group scrolls horizontally. */
.ls-write-toolbar .ls-write-tbar-top {
  flex-wrap: nowrap;
}
.ls-write-toolbar .ls-write-tbar-top .ls-write-tbar-left {
  flex: 1 1 auto;
  min-width: 0; /* allow overflow container to shrink */
}
.ls-write-toolbar .ls-write-tbar-top .ls-write-tbar-right {
  flex: 0 0 auto;
}
.ls-write-tbar-sub {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  gap: 10px 14px;
}
.ls-wt-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--text-sec);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ls-wt-btn:hover {
  background: var(--p50);
  border-color: var(--p500);
  color: var(--p700);
}
.ls-wt-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 2px;
}
.ls-wt-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.ls-wt-label-txt { white-space: nowrap; }
.ls-wt-select {
  padding: 5px 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.75rem;
  font-family: inherit;
}
.ls-wk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  color: var(--text-sec);
  cursor: pointer;
  user-select: none;
}
.ls-wk-toggle input { accent-color: var(--p600); }
.ls-write-template-wrap { margin-left: auto; }

/* Workspace: font face selector */
.ls-wk-fontface .ls-wk-font-sel{
  min-width: 118px;
}

/* Workspace: WordArt styles (applied to selected text via span class) */
.wk-wordart{
  font-weight: 900;
  letter-spacing: -0.01em;
}
.wk-wordart--grad{
  background: linear-gradient(90deg, #003893, #DC143C);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 6px 18px rgba(0,56,147,0.18);
}
.wk-wordart--outline{
  color: #003893;
  -webkit-text-stroke: 1px rgba(220,20,60,0.55);
  text-shadow: 0 6px 18px rgba(0,0,0,0.10);
}
html[data-theme="dark"] .wk-wordart--outline{
  color: #93C5FD;
  -webkit-text-stroke: 1px rgba(248,113,113,0.55);
}

.ls-write-voice-hint {
  font-size: 0.78rem;
  color: var(--p700);
  padding: 6px 10px;
  margin-bottom: 8px;
  background: var(--p50);
  border-radius: var(--r-xs);
  border: 1px solid var(--p100);
}
html[data-theme="dark"] .ls-write-voice-hint {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.25);
  color: var(--p500);
}

.ls-write-paper-wrap {
  position: relative;
  margin-bottom: 12px;
}
.ls-write-paper {
  background: #fffef9;
  border-radius: var(--r);
  box-shadow: var(--sh-md), 0 0 0 1px rgba(15, 23, 42, 0.04);
  min-height: 52vh;
  padding: clamp(20px, 4vw, 48px) clamp(18px, 3vw, 56px);
  border: 1px solid rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
}
html[data-theme="dark"] .ls-write-paper {
  background: #2e2e2e;
  border-color: var(--border);
  box-shadow: var(--sh-md);
}

/* Workspace: background image support */
.ls-write-bg{
  position: absolute;
  inset: 0;
  background-size: var(--wk-bg-size, cover);
  background-position: center;
  opacity: var(--wk-bg-opacity, 0.22);
  filter: saturate(1.05) contrast(1.02);
  pointer-events: none;
  z-index: 0;
}
.ls-write-bg.hidden{ display:none; }
.ls-write-bg-overlay{
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.60), rgba(255,255,255,0.78));
  pointer-events: none;
  z-index: 0;
}
.ls-write-bg-overlay.hidden{ display:none; }
html[data-theme="dark"] .ls-write-bg-overlay{
  background: linear-gradient(180deg, rgba(2,6,23,0.62), rgba(2,6,23,0.72));
}

.ls-write-paper-inner{
  position: relative;
  z-index: 1; /* above bg layers */
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.ls-write-paper.side-right .ls-write-paper-inner{ flex-direction: row-reverse; }
.ls-write-sideimg{
  width: var(--wk-side-w, 160px);
  max-width: 38%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.08);
  object-fit: cover;
  align-self: flex-start;
}
.ls-write-sideimg.hidden{ display: none; }

@media (max-width: 720px){
  .ls-write-sideimg{ width: var(--wk-side-w-sm, 120px); }
}
.ls-write-editor {
  min-height: 45vh;
  outline: none;
  font-family: 'Noto Sans Devanagari', 'Nirmala UI', sans-serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  word-wrap: break-word;
}
.ls-write-editor:empty::before,
.ls-write-editor.wk-ph::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  opacity: 0.55;
  pointer-events: none;
}
.ls-write-editor:focus { outline: none; }
.ls-write-editor p { margin: 0 0 0.6em; }
.ls-write-editor ul, .ls-write-editor ol {
  margin: 0.4em 0 0.6em 1.4em;
  padding: 0;
}

.ls-write-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.ls-write-sug {
  padding: 5px 11px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sec);
  font-size: 0.76rem;
  font-family: 'Noto Sans Devanagari', sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ls-write-sug:hover {
  border-color: var(--p500);
  background: var(--p50);
  color: var(--p700);
}

.ls-write-bottom-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 0 8px;
}
.ls-write-mic {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--grad);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--sh-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, opacity 0.15s;
}
.ls-write-mic:hover { transform: scale(1.04); }
.ls-write-mic.listening {
  animation: wkMicPulse 1.2s ease infinite;
  background: linear-gradient(135deg, var(--rose), #fb7185);
}
@keyframes wkMicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(225, 29, 72, 0); }
}
.ls-write-kbd-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  color: var(--text-sec);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}
.ls-write-kbd-toggle.open {
  border-color: var(--p500);
  background: var(--p50);
  color: var(--p700);
}
.ls-write-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
}
.ls-write-ai-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}
@media (min-width: 520px) {
  .ls-write-ai-btns { width: auto; margin-left: 0; }
  .ls-write-count { margin-left: auto; }
}
.ls-write-ai-btn {
  padding: 6px 12px;
  border-radius: 50px;
  border: 1px solid var(--v500);
  background: var(--v100);
  color: var(--v700);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Noto Sans Devanagari', inherit;
}
html[data-theme="dark"] .ls-write-ai-btn {
  background: rgba(220, 20, 60, 0.15);
  color: #FCA5A5;
  border-color: rgba(220, 20, 60, 0.4);
}
.ls-write-ai-btn:hover { opacity: 0.9; }
/* Revert / undo variant — muted secondary look */
.ls-write-ai-btn--revert {
  background: transparent;
  border-color: var(--border, #ccc);
  color: var(--text-muted, #666);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.ls-write-ai-btn--revert:hover {
  background: var(--surface2, #f0f0f0);
  color: var(--text, #333);
  opacity: 1;
}
html[data-theme="dark"] .ls-write-ai-btn--revert {
  background: transparent;
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.45);
}
html[data-theme="dark"] .ls-write-ai-btn--revert:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.8);
}

/* Workspace Nepali keyboard: floated under caret via JS (ls-kbd-wk--float) */
.ls-kbd-wk {
  margin: 0;
}
.ls-kbd-wk.ls-kbd-wk--float {
  position: fixed;
  z-index: 260;
  margin: 0;
  box-shadow: var(--sh-lg), 0 0 0 1px rgba(15, 23, 42, 0.06);
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border-2);
  -webkit-overflow-scrolling: touch;
  animation: wkKbdPop 0.2s ease;
}
@keyframes wkKbdPop {
  from { opacity: 0.85; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
html[data-theme="dark"] .ls-kbd-wk.ls-kbd-wk--float {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  border-color: var(--border-2);
  background: var(--surface-2);
}
html[data-theme="dark"] .ls-kbd-edit.ls-kbd-wk--float {
  background: var(--surface-2);
}
.ls-kbd-float-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.ls-kbd-float-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}
.ls-kbd-close-labeled {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 6px 12px !important;
  width: auto !important;
  height: auto !important;
  margin-left: 0 !important;
  font-size: 0.74rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--r-xs);
  background: #fff;
  color: var(--rose);
  border: 1.5px solid #fecaca;
}
.ls-kbd-close-labeled:hover {
  background: #fff1f2;
  border-color: #f87171;
}
html[data-theme="dark"] .ls-kbd-close-labeled {
  background: var(--surface);
  border-color: rgba(244, 114, 182, 0.45);
  color: #fda4af;
}

.ls-write-fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bnav-h) + 20px);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--grad);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--sh-lg);
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s;
}
.ls-write-fab:hover { transform: scale(1.06); }
@media (min-width: 901px) {
  .ls-write-fab { display: none; }
}

.ls-modal-share { max-width: 400px; }
.ls-wk-share-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}
.ls-wk-share-row,
a.ls-wk-share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-xs);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.ls-wk-share-row:hover {
  border-color: var(--p500);
  background: var(--p50);
}
.ls-wk-share-row i { font-size: 1.15rem; color: var(--p600); }
.ls-wk-share-muted {
  opacity: 0.9;
  font-weight: 500;
  font-size: 0.8rem;
}

/* ── Site footer (पाइताला) ───────────────────────────────── */
.ls-site-footer {
  margin-top: 40px;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.92) 0%, var(--surface-2) 48%, var(--surface) 100%);
  border: 1px solid rgba(0, 56, 147, 0.1);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 12px 40px rgba(0, 56, 147, 0.08);
}
.ls-site-footer-accent {
  height: 4px;
  width: 100%;
  background: linear-gradient(
    90deg,
    #DC143C 0%,
    #DC143C 26%,
    #fff 26%,
    #fff 38%,
    #003893 38%,
    #003893 100%
  );
  opacity: 0.88;
}
.ls-site-footer-inner {
  padding: 22px 20px 20px;
}
.ls-site-footer-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}
.ls-site-footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ls-site-footer-logo {
  flex-shrink: 0;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 56, 147, 0.12);
  background: #fff;
}
.ls-site-footer-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ls-site-footer-name {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.ls-site-footer-name-en {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--p600);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ls-site-footer-lead {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--text-sec);
  max-width: 42rem;
}
.ls-site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.ls-site-footer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--p800);
  background: linear-gradient(180deg, #fff 0%, var(--p50) 100%);
  border: 1.5px solid rgba(0, 56, 147, 0.14);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
button.ls-site-footer-pill {
  background: linear-gradient(180deg, #fff 0%, var(--p50) 100%);
}
.ls-site-footer-pill:hover {
  border-color: rgba(0, 56, 147, 0.35);
  box-shadow: 0 4px 16px rgba(0, 56, 147, 0.1);
}
.ls-site-footer-pill:active {
  transform: scale(0.98);
}
.ls-site-footer-pill i {
  font-size: 0.95rem;
  opacity: 0.9;
}
.ls-site-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 56, 147, 0.08);
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}
.ls-site-footer-sep {
  opacity: 0.45;
}
.ls-site-footer-copy {
  color: var(--text-sec);
}
.ls-site-footer-credit,
.ls-site-footer-ver {
  font-weight: 600;
  color: var(--text-sec);
}

html[data-theme="dark"] .ls-site-footer {
  background: linear-gradient(
    165deg,
    rgba(30, 41, 59, 0.95) 0%,
    rgba(22, 28, 42, 0.98) 55%,
    rgba(15, 20, 32, 1) 100%
  );
  border-color: rgba(147, 197, 253, 0.14);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 16px 48px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .ls-site-footer-logo {
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .ls-site-footer-name {
  color: #f1f5f9;
}
html[data-theme="dark"] .ls-site-footer-name-en {
  color: #93c5fd;
}
html[data-theme="dark"] .ls-site-footer-pill {
  color: #e0f2fe;
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.5) 0%, rgba(30, 41, 59, 0.85) 100%);
  border-color: rgba(147, 197, 253, 0.22);
}
html[data-theme="dark"] .ls-site-footer-pill:hover {
  border-color: rgba(147, 197, 253, 0.45);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .ls-site-footer-bottom {
  border-top-color: rgba(147, 197, 253, 0.1);
}

@media (min-width: 768px) {
  .ls-site-footer {
    margin-top: 48px;
  }
  .ls-site-footer-inner {
    padding: 26px 28px 22px;
  }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .ls-header, .ls-bottom-nav, .ls-sidebar,
  .ls-btn-gen, .ls-howto-panel, .ls-gen-context-card, .ls-mobile-app-banner, .ls-home-app-promo, .ls-hero-card, .ls-topic-picker,
  .ls-page-hero button, .ls-msg-toolbar,
  .ls-cookie-bar, .ls-modal-overlay, .ls-toast-host, .ls-site-footer { display: none !important; }
  body { background: #fff; }
  .ls-nibedan-preview { border: none; padding: 0; font-size: 1rem; }
  .ls-page { display: block !important; }
}

/* ── Small screens ────────────────────────────────────────── */
@media (max-width: 400px) {
  .ls-topic-tile { min-height: 64px; }
  .ls-topic-tile-label { font-size: 0.58rem; }
  .ls-main { padding: 12px 10px 24px; }
  .ls-msg-act span { display: none; }
  .ls-msg-act { padding: 7px 10px; min-width: 38px; }
  .ls-msg-toolbar-sep { height: 24px; }
  .ls-card-header { padding: 16px 16px 0; }
  .ls-card-body, .ls-topic-picker, .ls-input-group, .ls-kbd { padding-left: 16px; padding-right: 16px; }
  .ls-btn-gen { width: calc(100% - 32px); margin-left: 16px; margin-right: 16px; }
  .ls-howto-panel,
  .ls-gen-context-card { margin-left: 16px; margin-right: 16px; }
}
