:root {
  --green: #14956a;
  --green-deep: #0e7a56;
  --ink: #1c3b32;
  --muted: #7b8b86;
  --line: #e5eeea;
  --paper: #f4fbf8;
  --card: #ffffff;
  --mint: #e7f7ef;
  --amber: #f6a23a;
  --violet: #7b61c9;
  --lilac: #8b74d6;
  --font: "Vazirmatn", "Vazir Matn", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font);
  background: var(--paper);
}

button, input { font-family: var(--font); }

[hidden] { display: none !important; }

button { cursor: pointer; }

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  border-inline-start: 1px solid var(--line);
  padding: 22px 16px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
}

.brand strong { display: block; font-size: 1.05rem; }
.brand small { display: block; color: var(--muted); font-size: 0.72rem; margin-top: 2px; }

.pulse {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--mint);
  flex: 0 0 auto;
}

.pulse svg { width: 26px; height: 26px; }

nav { display: flex; flex-direction: column; gap: 4px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #3e534c;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 0.92rem;
}

.nav svg { width: 18px; height: 18px; color: #8aa097; }
.nav.on {
  background: #e9f8f1;
  color: var(--green-deep);
  font-weight: 700;
}
.nav.on svg { color: var(--green); fill: var(--green); stroke: none; }
.nav:hover { background: #f4fbf8; }

.history {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  flex: 1;
  overflow: auto;
}
#new-chat {
  border: 1px solid #dcebe3;
  background: #f4fbf8;
  color: var(--green-deep);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 700;
  text-align: right;
}
.session-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 10px;
}
.session-row.on, .session-row:hover { background: #e9f8f1; }
.session {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #3e534c;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: right;
  line-height: 1.5;
}
.session-del {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #9a4038;
  padding: 6px 8px;
  font-size: 0.78rem;
}
.ad-chat { margin-top: 8px; display: flex; flex-direction: column; gap: 12px; }
.ad-chat-title { margin: 18px 0 0; font-weight: 800; color: var(--green-deep); }
.account {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: right;
  padding: 12px 6px 4px;
}

.account strong { display: block; font-size: 0.92rem; }
.account small { display: block; color: var(--muted); font-size: 0.75rem; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.avatar svg { stroke: white; }
.chev { margin-inline-start: auto; color: #9aabb4; }

main {
  min-width: 0;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(900px 280px at 70% 8%, rgba(120, 214, 176, 0.28), transparent 60%),
    radial-gradient(700px 240px at 20% 0%, rgba(186, 230, 210, 0.45), transparent 55%),
    linear-gradient(180deg, #f7fcfa 0%, #f3faf7 100%);
  position: relative;
}

main::before,
main::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  height: 180px;
  pointer-events: none;
  background: radial-gradient(60% 80% at 50% 50%, rgba(170, 224, 201, 0.35), transparent 70%);
  border-radius: 50%;
}
main::before { top: -40px; transform: rotate(-6deg); }
main::after { top: 70px; transform: rotate(5deg); opacity: 0.7; }

.stage {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 36px 12px;
}

.home {
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}

.glow {
  width: 92px;
  height: 92px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, #fff 0 46%, rgba(255,255,255,.72) 47%, rgba(210, 240, 226, 0.2) 70%, transparent 72%);
  box-shadow: 0 0 70px rgba(46, 184, 130, 0.18);
  color: var(--green);
}

.glow svg { width: 40px; height: 40px; fill: var(--green); stroke: none; }

h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h1 em { font-style: normal; color: var(--green); }

.intro {
  margin: 12px auto 0;
  max-width: 640px;
  color: #60726c;
  line-height: 1.9;
  font-size: 0.95rem;
}

.abilities {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.ability {
  background: #fff;
  border: 1px solid rgba(226, 236, 231, 0.9);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(40, 90, 70, 0.04);
  padding: 22px 14px 18px;
  text-align: center;
  color: inherit;
}

.ability:hover { border-color: #cfe5da; }

.ability strong { display: block; margin-top: 12px; font-size: 0.92rem; }
.ability small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.7; font-size: 0.78rem; }

.ico {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.ico svg { width: 20px; height: 20px; }
.ico.mint { background: #e7f8ef; color: #1aa36a; }
.ico.amber { background: #fff4e4; color: #e59a2b; }
.ico.violet { background: #f1eaff; color: #7a5cc4; }
.ico.lilac { background: #f3eeff; color: #8a6ad4; }

.thread, .detail { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

.user {
  align-self: flex-start;
  max-width: 70%;
  margin: 0;
  background: #e7f6ef;
  color: var(--green-deep);
  border-radius: 14px 14px 4px 14px;
  padding: 10px 14px;
  line-height: 1.8;
}

.slip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 14px;
  box-shadow: 0 8px 24px rgba(40, 90, 70, 0.04);
}

.lead.rich p { margin: 0 0 8px; font-weight: 700; line-height: 1.9; }
.lead.rich ul, .lead.rich ol {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lead.rich a, .org-page {
  color: var(--green-deep);
  font-weight: 700;
  text-decoration: underline;
  unicode-bidi: isolate;
  direction: ltr;
}
.org-page { display: inline-block; margin-top: 10px; }
.lead.rich li {
  background: #f7fbf9;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 500;
  line-height: 1.7;
}
.lead.rich.typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-inline-start: 3px;
  background: var(--green);
  vertical-align: text-bottom;
  animation: blink 0.8s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.lead { margin: 0; font-weight: 700; line-height: 1.9; font-size: 1.02rem; }
.ask { margin: 6px 0 0; color: #60746d; line-height: 1.8; }

.choices, .ads { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.choices { flex-direction: row; flex-wrap: wrap; }

.choice, .ad, .back {
  border: 1px solid var(--line);
  background: #fff;
  color: inherit;
  border-radius: 12px;
}

.choice {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
}
.choice b { color: var(--green); font-weight: 700; }
.choice:hover, .ad:hover { border-color: #b7dfcc; }

.chart { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.chart-head strong { font-size: 0.92rem; }
.chart-head span { color: var(--green-deep); font-weight: 800; font-size: 1.05rem; }
.bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: right;
  padding: 0;
}
.bar-top { display: flex; justify-content: space-between; gap: 12px; font-size: 0.86rem; }
.bar-top b { color: var(--green-deep); font-weight: 800; }
.bar, .track { direction: rtl; }
.track {
  display: flex;
  justify-content: flex-start;
  height: 9px;
  border-radius: 999px;
  background: #e7f3ee;
  overflow: hidden;
}
.fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(270deg, #128a62, #7dceae);
  transition: width 0.7s ease;
}
.bar:hover .fill { filter: brightness(0.95); }

.ad {
  width: 100%;
  text-align: right;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 28px 18px 1fr;
  gap: 8px;
  align-items: start;
}
.ad-no {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green-deep);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}
.ad strong { display: block; font-weight: 650; line-height: 1.7; }
.ad span { display: block; margin-top: 4px; color: var(--muted); font-size: 0.84rem; line-height: 1.7; }
.ad svg { margin-top: 4px; color: var(--green); }

.lead, .ask, .user, .ad strong, .ad span, .detail-body { overflow-wrap: anywhere; }

.steps-card { padding: 12px 16px; }
.step { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.step b { font-weight: 700; }
.mark {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 0.85rem;
}
.spin {
  width: 14px;
  height: 14px;
  border: 2px solid #d7ebe3;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: turn 0.7s linear infinite;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #d5e3de;
}
@keyframes turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spin { animation: none; border-top-color: var(--green); }
  .fill { transition: none; }
}

.detail-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(40, 90, 70, 0.06);
}
.back {
  padding: 6px 10px;
  color: var(--green-deep);
  margin-bottom: 12px;
}
.kind {
  display: inline-block;
  background: var(--mint);
  color: var(--green-deep);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}
.detail-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-top .back { margin: 0; }
.detail-card h2 { margin: 14px 0 8px; font-size: 1.25rem; line-height: 1.85; }
.detail-line { margin: 0 0 16px; color: #60746c; line-height: 1.8; }
.insights { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.org-card {
  margin-top: 12px;
  background: #f4fbf8;
  border: 1px solid #dcebe3;
  border-radius: 16px;
  padding: 14px;
}
.org-card > strong { display: block; font-size: 1rem; margin-bottom: 10px; }
.org-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.org-metrics div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
}
.org-metrics b { display: block; color: var(--green-deep); font-size: 1.05rem; }
.org-metrics small { display: block; margin-top: 4px; color: var(--muted); font-size: 0.72rem; }
.org-contact { margin: 12px 0 0; }
.org-contact div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #e5eeea;
}
.org-contact dt { color: var(--muted); font-size: 0.8rem; }
.org-contact dd { margin: 0; line-height: 1.7; }
.nudge {
  margin-top: 12px;
  background: #f4fbf8;
  border: 1px solid #dcebe3;
  border-radius: 16px;
  padding: 14px 16px;
}
.nudge p { margin: 0; line-height: 1.8; font-weight: 700; color: var(--ink); }
.nudge > button {
  margin-top: 10px;
  border: 0;
  background: var(--green);
  color: white;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
}
.reveal { margin-top: 10px !important; font-weight: 500 !important; color: #243f36 !important; }
.deals { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.deal-note { font-weight: 500 !important; color: #60746c !important; margin: 0 0 4px !important; }
.deal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
}
.deal strong { grid-column: 1; line-height: 1.6; }
.deal span { grid-column: 1; color: var(--muted); font-size: 0.82rem; }
.deal b { grid-row: 1 / span 2; align-self: center; color: var(--green-deep); white-space: nowrap; }
.insight-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.insight-stats div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.insight-stats small { display: block; color: var(--muted); font-size: 0.75rem; }
.insight-stats b { display: block; margin-top: 4px; color: var(--green-deep); line-height: 1.5; }
.insight {
  background: #f4fbf8;
  border: 1px solid #dcebe3;
  border-radius: 16px;
  padding: 12px 14px;
}
.insight strong { display: flex; align-items: center; gap: 8px; color: var(--green-deep); font-size: 0.92rem; }
.insight p { margin: 8px 0 0; line-height: 1.85; color: #243f36; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
.facts li { background: #f7fbf9; border-radius: 12px; padding: 10px 12px; }
.facts small { display: block; color: var(--muted); font-size: 0.75rem; }
.facts b { display: block; margin-top: 3px; font-weight: 600; line-height: 1.6; }
.story { margin: 14px 0 0; line-height: 1.9; color: #314740; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.links a {
  color: white;
  background: var(--green);
  text-decoration: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
}
.save {
  border: 1px solid #b7dfcc;
  background: #fff;
  color: var(--green-deep);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
}

.fav-page { width: 100%; }
.fav-head h2 { margin: 0; font-size: 1.4rem; }
.fav-head p { margin: 6px 0 0; color: var(--muted); }
.fav-empty {
  margin-top: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 16px;
  text-align: center;
  color: #60746c;
}
.fav-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.fav {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
}
.fav-main {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: right;
  padding: 8px 10px;
  color: inherit;
}
.fav-main .kind { margin-bottom: 8px; }
.fav-main strong { display: block; line-height: 1.75; font-size: 0.98rem; }
.fav-main .meta { display: block; margin-top: 6px; color: var(--muted); font-size: 0.84rem; line-height: 1.7; }
.fav-remove {
  flex: 0 0 auto;
  align-self: center;
  border: 0;
  background: #f7fbf9;
  color: #9a4038;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
}
.fav-main:hover { color: var(--green-deep); }

.dock {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 8px 0 16px;
  background: linear-gradient(180deg, rgba(243, 250, 247, 0), #f4fbf8 16px);
}

.guide {
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #d7ebe3;
  border-radius: 16px;
  padding: 10px 12px 8px;
}
.guide p {
  margin: 0 0 8px;
  color: var(--green-deep);
  font-weight: 800;
  line-height: 1.7;
}
.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.guide-actions button {
  border: 1px solid #b7dfcc;
  background: #f4fbf8;
  color: var(--green-deep);
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 0.84rem;
}
.guide-actions button:hover { background: #e7f6ef; }

.composer {
  background: #fff;
  border: 1px solid #e7f0ec;
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(50, 110, 80, 0.06);
  padding: 14px 14px 10px;
}

.composer-row { display: flex; align-items: center; gap: 12px; }

.field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #9aabb0;
}

.field input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.98rem;
  padding: 8px 0;
  min-width: 0;
}
.field input:focus { outline: none; }

.send {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: 0 8px 16px rgba(20, 149, 106, 0.28);
}
.send svg { width: 22px; height: 22px; fill: white; stroke: none; }
.send:disabled { opacity: 0.6; }

.composer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-inline: 4px;
}

.samples-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-weight: 700;
  font-size: 0.9rem;
}
.samples-title svg { width: 16px; height: 16px; fill: var(--green); stroke: none; }

.menus { display: flex; gap: 8px; position: relative; }
.menu { position: relative; }

.ghost, .pop button {
  border: 1px solid var(--line);
  background: #fff;
  color: #4d635c;
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}
.ghost svg { width: 15px; height: 15px; }
.caret { width: 14px; height: 14px; }

.pop {
  position: absolute;
  bottom: 36px;
  inset-inline-start: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(40, 90, 70, 0.08);
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 150px;
  z-index: 3;
}
.pop button { border: 0; border-radius: 8px; justify-content: flex-start; }
.pop button:hover, .pop .picked { background: var(--mint); color: var(--green-deep); }
#pop-model {
  max-height: 320px;
  overflow: auto;
  min-width: 250px;
}
[data-toggle="model"] .menu-label {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.samples {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow: auto;
}
#samples-ad { display: none; }
.app.is-chat #samples-home,
.app.is-fav #samples-home,
.app.is-ad #samples-home { display: none; }
.app.is-ad #samples-ad { display: flex; }

.samples button {
  flex: 0 0 auto;
  border: 1px solid #d7ebe3;
  background: rgba(255,255,255,.8);
  color: #4d635c;
  border-radius: 999px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}
.samples button svg { width: 14px; height: 14px; color: #9aabb4; }

.send:focus-visible, .nav:focus-visible, .ability:focus-visible, .ad:focus-visible, .choice:focus-visible, .field input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.topbar, .menu-btn { display: none; }
.scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  border: 0;
  padding: 0;
  background: rgba(18, 46, 36, 0.38);
}

@media (max-width: 1100px) {
  .abilities { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.7rem; }
  .stage { padding: 22px 18px 8px; }
  .dock { width: min(980px, calc(100% - 24px)); }
  .org-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    position: relative;
    z-index: 2;
  }
  .topbar strong { font-size: 1rem; }
  .menu-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: var(--mint);
    color: var(--green-deep);
  }
  .side {
    position: fixed;
    z-index: 40;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(300px, 88vw);
    height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
    transform: translateX(105%);
    transition: transform 0.2s ease;
    box-shadow: -12px 0 32px rgba(20, 50, 40, 0.12);
    overflow: auto;
  }
  .app.menu-open .side { transform: none; }
  .app.menu-open .scrim { display: block; }
  .brand small, .nav span, .account strong, .account small, .chev { display: block; }
  .nav { justify-content: space-between; }
  .stage { padding: 16px 12px 8px; }
  .home { margin-top: 0; }
  .glow { width: 92px; height: 92px; margin-bottom: 12px; }
  .glow svg { width: 40px; height: 40px; }
  h1 { font-size: 1.35rem; }
  .intro br { display: none; }
  .abilities { grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
  .ability { padding: 14px 12px; display: grid; grid-template-columns: 42px 1fr; text-align: right; column-gap: 10px; }
  .ability .ico { margin: 0; grid-row: 1 / span 2; }
  .ability strong, .ability small { margin-top: 0; }
  .user { max-width: 92%; }
  .slip, .detail-card { padding: 12px; border-radius: 16px; }
  .facts, .insights { grid-template-columns: 1fr; }
  .insight-stats { grid-template-columns: 1fr 1fr; }
  .org-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .org-contact div { grid-template-columns: 64px minmax(0, 1fr); }
  .deal { grid-template-columns: 1fr; }
  .deal b { grid-row: auto; grid-column: 1; white-space: normal; }
  .detail-top { flex-wrap: wrap; }
  .choices { flex-direction: column; align-items: stretch; }
  .choice { width: 100%; justify-content: space-between; }
  .fav { flex-direction: column; }
  .fav-remove { align-self: stretch; }
  .dock {
    width: 100%;
    margin: 0;
    padding: 8px 10px max(10px, env(safe-area-inset-bottom));
    background: #f4fbf8;
  }
  .composer { border-radius: 18px; padding: 10px; }
  .send { width: 46px; height: 46px; }
  .field input { font-size: 16px; }
  .menus { flex-wrap: wrap; }
  .ghost { max-width: 100%; }
  [data-toggle="model"] .menu-label { max-width: 42vw; }
  #pop-model, .pop { max-width: min(280px, calc(100vw - 28px)); }
  .samples { margin-top: 8px; padding-bottom: 2px; }
  .chart-head, .bar-top { align-items: flex-start; }
  .chart-head strong, .bar-top span { min-width: 0; overflow-wrap: anywhere; }
}

@media (max-width: 380px) {
  .insight-stats, .org-metrics { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.2rem; }
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0, #dff6ec, transparent 46%),
    var(--paper);
}
.gate-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px 24px 24px;
  box-shadow: 0 18px 50px rgba(40, 90, 70, 0.08);
  text-align: center;
}
.gate-card .pulse { margin: 0 auto 14px; }
.gate-card h1 { margin: 0 0 8px; font-size: 1.45rem; }
.gate-card p { margin: 0 0 16px; color: #60746c; line-height: 1.9; }
.gate-card input {
  width: 100%;
  border: 1px solid #d7ebe3;
  background: var(--paper);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 1rem;
  text-align: center;
}
.gate-card button {
  width: 100%;
  margin-top: 12px;
  border: 0;
  background: var(--green);
  color: #fff;
  border-radius: 999px;
  padding: 12px;
  font-weight: 700;
}
.gate-card button:disabled { opacity: 0.6; }
.gate-error { color: #a33d3d !important; font-weight: 700; }
.fav-start {
  width: min(760px, 100%);
  margin: 8px auto 18px;
  text-align: right;
}
.fav-start strong { display: block; margin-bottom: 4px; }
.fav-start p { margin: 0 0 10px; color: #60746c; }
.fav-start .choice { text-align: right; }
