/* Nano AI — Mobile Experience Layer v1.0.1 */

/* ── layer widgets (always styled; JS mounts them on phones only) ── */
  /* ── 🧰 tools button (floats above the bottom nav, left side) ── */
.nm-tools-btn {
    position: fixed;
    left: 14px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    z-index: 9000;
    width: 52px; height: 52px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #7c5cff, #d152c8);
    color: #fff; font-size: 24px; line-height: 1;
    box-shadow: 0 6px 20px rgba(124, 92, 255, .45);
    cursor: pointer;
  }
html[data-nano-desktop] .nm-tools-btn { bottom: 18px; }

  /* ── bottom sheet ── */
.nm-overlay {
    position: fixed; inset: 0; z-index: 9100;
    background: rgba(5, 5, 15, .62);
    backdrop-filter: blur(3px);
    display: flex; align-items: flex-end; justify-content: center;
  }
.nm-sheet {
    direction: rtl;
    width: 100%; max-height: 78vh; overflow-y: auto;
    background: #14121f;
    border-radius: 22px 22px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .09);
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
    animation: nm-up .22s ease-out;
  }
@keyframes nm-up { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
.nm-grip { width: 42px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.22); margin: 4px auto 12px; }
.nm-title { color: #fff; font-size: 18px; font-weight: 700; margin: 0 0 14px; text-align: right; }
.nm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.nm-tile {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 14px 6px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    color: #e6e4f0; font-size: 13.5px; font-weight: 600;
    text-decoration: none; text-align: center;
  }
.nm-tile:active { background: rgba(124,92,255,.25); }
.nm-tile.nm-here { border-color: #7c5cff; background: rgba(124,92,255,.16); }
.nm-ico { font-size: 26px; line-height: 1; }

.nm-desktop-toggle {
    display: block; width: 100%; margin-top: 16px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
    background: rgba(255,255,255,.05); color: #fff;
    font-size: 15px; font-weight: 700; cursor: pointer;
  }
.nm-desktop-toggle small { display: block; font-weight: 400; color: #9a95b5; margin-top: 3px; }
.nm-desktop-toggle.nm-on { border-color: #52d18a; color: #52d18a; }

  /* ── lightbox preview ── */
.nm-lightbox { align-items: center; }
.nm-lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 12px; }


@media (max-width: 1099px) {

  /* ── template tiles: show the filled image properly ── */
  .m-image-tile { position: relative; overflow: hidden; }
  .m-image-tile > img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .m-image-tile .m-src {
    position: absolute; top: 6px; left: 6px;
    background: rgba(0,0,0,.62); color: #fff;
    padding: 2px 8px; border-radius: 8px; font-size: 11px;
    max-width: 85%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* ── addon floating pills: collapsed behind the ✨ toggle ── */
  .nm-fab-toggle {
    position: fixed;
    left: 14px;
    bottom: calc(148px + env(safe-area-inset-bottom));
    z-index: 9000;
    width: 52px; height: 52px;
    border-radius: 50%; border: none;
    background: #241f38; color: #fff; font-size: 22px;
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 6px 18px rgba(0,0,0,.5);
    cursor: pointer;
  }
  html.nm-fabs-collapsed .nm-addon-fab {
    opacity: 0 !important; pointer-events: none !important;
    transition: opacity .18s ease, bottom .18s ease;
  }

  /* ── general m-app polish ── */
  /* horizontal chip/filter rows: scroll instead of overflowing off-screen */
  .m-chips, .m-tabs, [class*="m-filter"] {
    display: flex !important; flex-wrap: nowrap !important;
    overflow-x: auto !important; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 4px;
  }
  .m-chips::-webkit-scrollbar, .m-tabs::-webkit-scrollbar { display: none; }

  /* minimum touch-target size */
  .m-tab, .m-chip, button.m-btn { min-height: 44px; }

  /* keep content clear of our floating buttons */
  body { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
}

/* ── forced-desktop mode: gentle readability bumps ── */
html[data-nano-desktop] body { font-size: 17px; }
html[data-nano-desktop] button,
html[data-nano-desktop] input,
html[data-nano-desktop] select { min-height: 40px; }

/* ══ v1.1.0 — full mobile page shell (.nmp) + native-mobile form language ══ */
.nmp {
  position: fixed; z-index: 8000;
  top: 0; left: 0; right: 0;
  bottom: calc(64px + env(safe-area-inset-bottom));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  direction: rtl;
  background: #0b0a14;
  padding: 74px 18px 120px;
}
.nmp-head h1 { color: #fff; font-size: 26px; font-weight: 800; margin: 8px 0 4px; }
.nmp-head p { color: #9a95b5; font-size: 15px; margin: 0 0 18px; }
.nmp-label { display: block; color: #c9c5dd; font-size: 14px; font-weight: 600; margin: 16px 0 8px; }
.nmp-label small { color: #6f6a8a; font-weight: 400; }
.nmp-input {
  width: 100%; box-sizing: border-box;
  background: #17142a; color: #fff;
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 15px 16px; font-size: 16px;
  outline: none;
}
.nmp-input:focus { border-color: #7c5cff; box-shadow: 0 0 0 3px rgba(124,92,255,.18); }
.nmp-ta { min-height: 88px; resize: vertical; }
.nmp-chips { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.nmp-chips::-webkit-scrollbar { display: none; }
.nmp-chip {
  flex: 0 0 auto;
  background: #17142a; color: #d8d4ea;
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 999px;
  padding: 11px 16px; font-size: 15px; font-weight: 600;
  min-height: 44px; cursor: pointer; white-space: nowrap;
}
.nmp-chip.nmp-on {
  background: linear-gradient(135deg, #7c5cff, #d152c8);
  border-color: transparent; color: #fff;
}
.nmp-chip.nmp-sm { padding: 9px 13px; font-size: 13.5px; min-height: 40px; }
.nmp-row { display: flex; gap: 12px; }
.nmp-box { flex: 1; min-width: 0; }
.nmp-step {
  display: flex; align-items: center; justify-content: space-between;
  background: #17142a; border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 16px; padding: 6px;
}
.nmp-step button {
  width: 44px; height: 44px; border-radius: 12px; border: none;
  background: #262040; color: #fff; font-size: 22px; cursor: pointer;
}
.nmp-step b { color: #fff; font-size: 19px; }
.nmp-cta {
  display: block; width: 100%; margin-top: 22px;
  background: linear-gradient(135deg, #7c5cff, #d152c8);
  color: #fff; border: none; border-radius: 18px;
  padding: 17px; font-size: 17px; font-weight: 800; cursor: pointer;
  box-shadow: 0 8px 26px rgba(124,92,255,.35);
}
.nmp-cta:disabled { opacity: .65; }
.nmp-progress {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding: 14px 16px;
  background: #17142a; border-radius: 16px; color: #c9c5dd; font-size: 15px;
}
.nmp-spin {
  width: 22px; height: 22px; flex: 0 0 auto;
  border: 3px solid rgba(124,92,255,.25); border-top-color: #7c5cff;
  border-radius: 50%; animation: nmp-rot .8s linear infinite;
}
@keyframes nmp-rot { to { transform: rotate(360deg); } }
.nmp-results { margin-top: 20px; }
.nmp-res-head {
  color: #52d18a; font-size: 15px; font-weight: 700;
  margin: 14px 0 10px;
}
.nmp-res-head small { display: block; color: #6f6a8a; font-weight: 400; margin-top: 2px; }
.nmp-err {
  background: rgba(220,60,60,.12); border: 1px solid rgba(220,60,60,.4);
  color: #ff9d9d; border-radius: 14px; padding: 12px 14px; margin: 10px 0; font-size: 14.5px;
}
.nmp-card {
  background: #17142a; border-radius: 18px; overflow: hidden;
  margin-bottom: 16px; border: 1px solid rgba(255,255,255,.07);
}
.nmp-card img { width: 100%; display: block; }
.nmp-card-btns { display: flex; gap: 10px; padding: 12px; }
.nmp-card-btns button {
  flex: 1; padding: 12px; border-radius: 12px; border: none;
  background: #262040; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}

/* native-mobile feel for ALL form fields in the bundled m-app too */
@media (max-width: 1023px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]),
  select, textarea {
    font-size: 16px !important;      /* prevents iOS zoom-on-focus */
    min-height: 48px;
    border-radius: 14px !important;
  }
  textarea { min-height: 84px; }
}

/* ══ v1.2.0 — campaign work surface ══ */
.nmc-gen-btn {
  position: fixed; z-index: 8990;
  right: 14px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  background: linear-gradient(135deg, #7c5cff, #d152c8);
  color: #fff; border: none; border-radius: 999px;
  padding: 15px 20px; font-size: 15.5px; font-weight: 800;
  box-shadow: 0 8px 26px rgba(124,92,255,.5);
  cursor: pointer;
}
.nmc-sheet { max-height: 92vh; }
.nmc-sheet .nmp-label { margin-top: 12px; }
.nmc-adv { margin-top: 14px; }
.nmc-adv summary {
  color: #b9b3d6; font-size: 14.5px; font-weight: 600; cursor: pointer;
  padding: 10px 0;
}
.nmc-adv .nmp-input { margin-top: 10px; }
.nmc-reload { margin-top: 6px; }

/* ══ v1.3.0 — app-grade polish pass (from Dror's phone screenshots) ══ */

/* one FAB only: slightly smaller, and rises above the app's sticky CTA bar */
.nm-tools-btn { width: 48px; height: 48px; font-size: 22px; }
html.nm-has-sticky .nm-tools-btn { bottom: calc(170px + env(safe-area-inset-bottom)); }

/* sheet: section title + page-action rows */
.nm-title-sec { font-size: 14px; color: #9a95b5; margin: 18px 0 10px; }
.nm-acts { display: flex; flex-direction: column; gap: 9px; }
.nm-act {
  width: 100%; text-align: right;
  padding: 15px 16px; border-radius: 15px;
  background: rgba(124,92,255,.13);
  border: 1px solid rgba(124,92,255,.4);
  color: #fff; font-size: 15.5px; font-weight: 700; cursor: pointer;
}
.nm-act:active { background: rgba(124,92,255,.3); }

/* form pages: grouped section cards */
.nmp-sec {
  background: #141127;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 20px;
  padding: 16px;
  margin-top: 14px;
}
.nmp-sec > .nmp-label:first-child { margin-top: 0; }
.nmp-sec.nmp-row { display: flex; }
.nmp-input { background: #1d1936; }

@media (max-width: 1023px) {
  /* ── list & card rows: taller, clearer, real touch targets ── */
  .m-card-row { padding: 16px !important; border-radius: 20px !important; gap: 14px !important; }
  .m-card-row:active { transform: scale(.985); transition: transform .08s; }
  .m-card-row-title { font-size: 17px !important; }
  .m-card-row-sub { font-size: 13.5px !important; margin-top: 4px !important; }
  .m-card-row-icon { width: 48px !important; height: 48px !important; border-radius: 15px !important; }

  /* ── typography scale up ── */
  .m-section-head h2 { font-size: 22px !important; }
  .m-topbar-title { font-size: 17px !important; }
  .m-tab { font-size: 15px !important; min-height: 46px !important; }
  .m-search-input { min-height: 54px !important; font-size: 16px !important; }

  /* pills/badges a touch bigger */
  .m-pill { font-size: 12.5px !important; padding: 4px 10px !important; }
}

/* ══════════════ NANO MOBILE 2.0 (approved sketches) ══════════════ */
html.n2 .m-bottomnav, html.n2 nav[class*="bottomnav"] { display: none !important; }
html.n2 body { padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
html.n2 .nm-tools-btn, html.n2 .nm-fab-toggle { display: none !important; }

/* ── bottom nav with raised center ✨ ── */
.n2-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8800;
  display: flex; align-items: flex-end; justify-content: space-around;
  background: rgba(12,10,19,.96); backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 10px 6px calc(14px + env(safe-area-inset-bottom));
  direction: rtl;
}
.n2-it {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 62px; border: none; background: none; cursor: pointer;
  font-size: 11.5px; color: #6E6790; font-weight: 600;
}
.n2-it i { font-size: 22px; font-style: normal; }
.n2-it.n2-on { color: #C4B5FD; }
.n2-mid {
  width: 58px; height: 58px; border-radius: 50%; border: 4px solid #0C0A13;
  background: linear-gradient(135deg,#8B5CF6,#EC4899);
  color: #fff; font-size: 24px; margin-top: -28px; cursor: pointer;
  box-shadow: 0 10px 26px rgba(236,72,153,.45);
}

/* ── create sheet rows ── */
.n2-crow {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px; padding: 15px 16px; margin-bottom: 11px;
  color: #F2EFFA; text-align: right; cursor: pointer;
}
.n2-crow-ic {
  width: 50px; height: 50px; border-radius: 15px; flex: 0 0 auto;
  background: #241F38; display: flex; align-items: center; justify-content: center; font-size: 23px;
}
.n2-crow:first-of-type .n2-crow-ic { background: linear-gradient(135deg,#8B5CF6,#EC4899); }
.n2-crow-tx b { display: block; font-size: 16.5px; }
.n2-crow-tx small { color: #A69FC4; font-size: 13px; }
.n2-ch { margin-inline-start: auto; color: #6E6790; font-size: 18px; }

/* ── page shell 2.0 ── */
.n2-ah { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 4px; }
.n2-ah-t { font-size: 19px; font-weight: 800; color: #F2EFFA; }
.n2-back {
  width: 44px; height: 44px; border-radius: 14px; border: 1px solid rgba(255,255,255,.1);
  background: #16131F; color: #A69FC4; font-size: 19px; cursor: pointer;
}
.n2-step { font-size: 14.5px; font-weight: 800; color: #C4B5FD; letter-spacing: .02em; margin: 20px 0 9px; }
.n2-lbl { font-size: 14px; font-weight: 700; color: #A69FC4; margin: 14px 0 7px; }
.n2-fld { position: relative; }
.n2-in {
  width: 100%; box-sizing: border-box; background: #16131F; color: #F2EFFA;
  border: 1.5px solid rgba(255,255,255,.1); border-radius: 18px;
  min-height: 58px; padding: 15px 17px; font-size: 16.5px; outline: none;
  font-family: inherit;
}
.n2-in:focus { border-color: #8B5CF6; box-shadow: 0 0 0 4px rgba(139,92,246,.16); }
.n2-ta { min-height: 92px; resize: vertical; margin-top: 10px; }
.n2-paste {
  position: absolute; left: 8px; top: 8px; bottom: 8px;
  background: #2A2440; border: none; border-radius: 12px; cursor: pointer;
  padding: 0 15px; font-size: 14.5px; font-weight: 700; color: #C4B5FD;
}

/* visual style cards */
.n2-stg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.n2-st {
  position: relative; border-radius: 18px; padding: 14px; min-height: 88px;
  border: 1.5px solid rgba(255,255,255,.1); background: #16131F;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  text-align: right; cursor: pointer; overflow: hidden; color: #F2EFFA;
}
.n2-st i { font-size: 26px; font-style: normal; position: absolute; top: 12px; right: 13px; }
.n2-st b { font-size: 15.5px; position: relative; }
.n2-st small { font-size: 12px; color: #A69FC4; position: relative; }
.n2-st-bg { position: absolute; inset: 0; opacity: .16; }
.cb1 { background: linear-gradient(135deg,#F59E0B,#EF4444); }
.cb2 { background: linear-gradient(135deg,#8B5CF6,#EC4899); }
.cb3 { background: linear-gradient(135deg,#64748B,#94A3B8); }
.cb4 { background: linear-gradient(135deg,#B45309,#FCD34D); }
.n2-st.n2-sel { border-color: #8B5CF6; box-shadow: 0 0 0 3px rgba(139,92,246,.25); }
.n2-st.n2-sel::after {
  content: "✓"; position: absolute; top: 10px; left: 10px; width: 25px; height: 25px;
  border-radius: 50%; background: linear-gradient(135deg,#8B5CF6,#EC4899);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800;
}
.n2-disc { display: block; width: 100%; text-align: right; border: none; background: none; color: #A69FC4; font-size: 15px; font-weight: 600; padding: 14px 4px; cursor: pointer; }

/* stepper + segmented */
.n2-duo { display: flex; gap: 11px; }
.n2-duo > * { flex: 1; min-width: 0; }
.n2-stepper {
  display: flex; align-items: center; justify-content: space-between;
  background: #16131F; border: 1.5px solid rgba(255,255,255,.1); border-radius: 16px; padding: 6px;
}
.n2-stepper button { width: 46px; height: 46px; border-radius: 12px; border: none; background: #2A2440; color: #F2EFFA; font-size: 22px; cursor: pointer; }
.n2-stepper b { font-size: 20px; color: #F2EFFA; }
.n2-seg { display: flex; background: #16131F; border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 5px; gap: 5px; }
.n2-seg-it { flex: 1; text-align: center; padding: 13px 0; border-radius: 12px; font-size: 15px; font-weight: 700; color: #A69FC4; border: none; background: none; cursor: pointer; }
.n2-seg-it.n2-on { background: #2A2440; color: #F2EFFA; box-shadow: inset 0 0 0 1.5px #8B5CF6; }

/* destination row */
.n2-dest {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 16px;
  background: #16131F; border: 1.5px solid rgba(255,255,255,.1); border-radius: 18px;
  min-height: 56px; padding: 0 17px; cursor: pointer; color: #F2EFFA; text-align: right;
}
.n2-dest span { color: #A69FC4; font-size: 14px; }
.n2-dest b { font-size: 15.5px; }
.n2-dest i { margin-inline-start: auto; color: #6E6790; font-style: normal; }

/* sticky CTA */
.n2-ctasp { height: 8px; }
.n2-cta { position: sticky; bottom: 0; padding: 14px 0 10px; background: linear-gradient(transparent, #0A0910 30%); z-index: 5; }
.n2-btn {
  display: flex; align-items: center; justify-content: center; width: 100%;
  background: linear-gradient(135deg,#8B5CF6,#EC4899); color: #fff;
  border: none; border-radius: 20px; min-height: 60px; font-size: 17.5px; font-weight: 800;
  cursor: pointer; box-shadow: 0 10px 30px rgba(139,92,246,.4);
}
.n2-btn:disabled { opacity: .65; }
.n2-btn-dim { background: #2A2440; box-shadow: none; border: 1.5px solid rgba(255,255,255,.1); margin-top: 10px; }

/* results rail (swipe) */
.n2-results { margin-top: 14px; }
.n2-rail { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 0 10px; scrollbar-width: none; }
.n2-rail::-webkit-scrollbar { display: none; }
.n2-res {
  flex: 0 0 86%; scroll-snap-align: center;
  background: #16131F; border: 1px solid rgba(255,255,255,.08); border-radius: 24px; overflow: hidden;
}
.n2-res img { width: 100%; display: block; cursor: pointer; }
.n2-res-bar { display: flex; gap: 8px; padding: 12px; }
.n2-res-bar button {
  flex: 1; background: #2A2440; border: none; border-radius: 14px; min-height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; color: #A69FC4; cursor: pointer;
}
.n2-res-bar i { font-size: 19px; font-style: normal; }
.n2-res-msg { text-align: center; color: #34D399; font-size: 13.5px; font-weight: 700; padding: 0 0 10px; min-height: 14px; }

/* pickers + history */
.n2-picklist { max-height: 52vh; overflow-y: auto; }
.n2-pick {
  display: block; width: 100%; text-align: right; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 14px 16px;
  margin-bottom: 9px; color: #F2EFFA; cursor: pointer;
}
.n2-pick b { display: block; font-size: 16px; }
.n2-pick small { color: #A69FC4; font-size: 13px; }
.n2-dim { color: #6E6790; font-size: 14.5px; padding: 14px 4px; }
.n2-strip { display: flex; gap: 9px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.n2-strip::-webkit-scrollbar { display: none; }
.n2-thumb {
  flex: 0 0 84px; height: 84px; border-radius: 15px; border: 1px solid rgba(255,255,255,.1);
  background-size: cover; background-position: center; background-color: #16131F; cursor: pointer;
}

/* gfu page container refresh */
.nmp { padding: 70px 18px calc(120px + env(safe-area-inset-bottom)); bottom: 0; }

/* v2.0.2 — hard overflow guard: nothing may widen the layout viewport */
html.n2, html.n2 body { max-width: 100vw; overflow-x: hidden; }
html.n2 #root { max-width: 100vw; overflow-x: clip; }

/* desktop-site trap banner — must be readable even on a 980px canvas */
.n2-uawarn {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9500;
  background: #B45309; color: #fff; direction: rtl;
  padding: 22px 26px; font-size: 26px; line-height: 1.5;
  border-bottom: 3px solid #FBBF24;
}
.n2-uawarn b { display: block; font-size: 30px; margin-bottom: 6px; }

/* install row + guide */
.nm-install { margin-top: 14px; background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.45); }
.n2-install-guide p { color: #F2EFFA; font-size: 16px; line-height: 1.65; margin: 0 0 14px; }
.n2-install-guide b { color: #7EE7B8; }
