/* Aevy phone layer for Scripts and Apps pages, plus phone performance.
   Phones only (max-width:760px). Loaded last. */
@media (max-width: 760px) {

  /* ---------- performance ---------- */
  .ax-orb, .ax-dash-hero .ax-orb { display: none !important; }
  .view.active { animation-duration: .2s !important; }
  .ig-post, .sc, .ap-shelf, .ap-res, .ax-row { content-visibility: auto; contain-intrinsic-size: auto 360px; }
  .ig-post, .sc, .ap-card, .ap-res { animation-delay: 0s !important; transition-delay: 0s !important; }
  *, *::before, *::after { -webkit-tap-highlight-color: transparent; }

  /* ---------- page headers ---------- */
  .page-head { padding: 16px 0 6px !important; background: none !important; border: 0 !important; }
  .page-head h1 { font-size: 1.45rem !important; font-weight: 800 !important; letter-spacing: -.03em !important; color: #172a9a !important; margin: 0 0 4px !important; }
  .page-head p { font-size: 13px !important; line-height: 1.5 !important; color: #5a6fa8 !important; margin: 0 !important; max-width: 46ch; }

  /* ---------- scripts: toolbar and chips ---------- */
  .sc-tools { gap: 10px !important; margin: 10px 0 !important; align-items: center; }
  .sc-count { font-size: 12.5px !important; font-weight: 650; color: #5a6fa8 !important; }
  .sc-sort select, #sort { min-height: 38px !important; height: 38px !important; padding: 0 34px 0 14px !important; font-size: 13px !important; border-radius: 12px !important; border: 1px solid #e3e9fb !important; background-color: #fff !important; }
  #chips, .chips {
    display: flex !important; flex-wrap: nowrap !important; gap: 8px !important; overflow-x: auto; margin: 0 -14px 12px !important; padding: 2px 14px 4px !important;
    scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  #chips::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; height: 34px !important; padding: 0 14px !important; font-size: 13px !important; font-weight: 650 !important; border-radius: 999px !important; border: 1px solid #e3e9fb !important; background: #fff !important; color: #3a4f95 !important; scroll-snap-align: start; }
  .chip.on { background: #2f55e4 !important; border-color: #2f55e4 !important; color: #fff !important; box-shadow: 0 8px 16px -10px rgba(47,85,228,.8); }

  /* ---------- scripts: post cards ---------- */
  #cards, .cards { display: grid !important; grid-template-columns: 1fr !important; gap: 12px !important; }
  .ig-post {
    max-width: none !important; width: 100% !important; margin: 0 !important; border-radius: 20px !important; background: #fff !important; border: 1px solid #e3e9fb !important;
    box-shadow: 0 1px 2px rgba(23,42,154,.05), 0 14px 28px -22px rgba(23,42,154,.45) !important; overflow: hidden;
  }
  .ig-post .ig-head { padding: 12px 14px 4px !important; gap: 10px !important; }
  .ig-post .ig-head .avatar, .ig-post .ig-head img { width: 34px !important; height: 34px !important; font-size: 14px !important; flex: none; }
  .ig-post .post-name { font-size: 14px !important; font-weight: 700 !important; color: #172a9a !important; }
  .ig-post .ig-ago { font-size: 12px !important; color: #7c8cbc !important; }
  .ig-post .ig-more { width: 32px !important; height: 32px !important; border-radius: 10px !important; color: #7c8cbc !important; }
  .ig-post .ig-title { padding: 6px 14px 10px !important; }
  .ig-post .ig-title h3 { font-size: 16px !important; line-height: 1.3 !important; font-weight: 750 !important; letter-spacing: -.015em !important; color: #172a9a !important; }
  .ig-post .ig-desc { margin-top: 4px !important; font-size: 13px !important; line-height: 1.5 !important; color: #5a6fa8 !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ig-post .ig-media { margin: 0 14px !important; height: 104px !important; max-height: 104px !important; border-radius: 14px !important; background: #0f1630 !important; }
  .ig-post .ig-media pre { padding: 12px 14px !important; font-size: 11.5px !important; line-height: 1.5 !important; color: #cfd8ff !important; }
  .ig-post .ig-lang { top: 8px !important; right: 8px !important; padding: 3px 9px !important; font-size: 10.5px !important; font-weight: 700 !important; border-radius: 999px !important; background: rgba(255,255,255,.14) !important; color: #e4ebff !important; }
  .ig-post .ig-dlbtn {
    width: calc(100% - 28px) !important; margin: 12px 14px 0 !important; min-height: 44px !important; height: 44px !important; border-radius: 14px !important;
    font-size: 14px !important; font-weight: 700 !important; background: linear-gradient(110deg, #2f55e4, #5a5de8) !important; box-shadow: 0 12px 22px -14px rgba(47,85,228,.9) !important;
  }
  .ig-post .ig-dlbtn small { font-size: 12px !important; opacity: .85; }
  .ig-post .ig-acts { padding: 6px 8px 2px !important; gap: 2px !important; }
  .ig-post .pact { min-width: 44px; height: 40px !important; font-size: 13px !important; color: #4b5f9e !important; }
  .ig-post .pact svg { width: 20px !important; height: 20px !important; }
  .ig-post .pact.on { color: #e5484d !important; }
  .ig-post .ig-tags { padding: 0 14px 14px !important; margin: 0 !important; display: flex; flex-wrap: wrap; gap: 6px; }
  .ig-post .ig-tags span { font-size: 11.5px !important; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #eef2ff; color: #3a55c9 !important; }

  /* ---------- apps ---------- */
  .apps { padding-top: 8px !important; }
  .ap-search { height: 44px !important; border-radius: 14px !important; background: #fff !important; border: 1px solid #e3e9fb !important; box-shadow: none !important; }
  .ap-tabs { border-bottom: 1px solid #e3e9fb !important; }
  .ap-tabs button { font-size: 13.5px !important; font-weight: 650 !important; color: #6c7fb8 !important; }
  .ap-tabs button.on { color: #2f55e4 !important; }
  .ap-chips { display: flex !important; flex-wrap: nowrap !important; gap: 8px !important; overflow-x: auto; margin: 0 -14px !important; padding: 12px 14px 4px !important; scrollbar-width: none; }
  .ap-chips::-webkit-scrollbar { display: none; }
  .ap-chip { flex: none; height: 34px !important; padding: 0 14px !important; font-size: 13px !important; font-weight: 650 !important; border-radius: 999px !important; border: 1px solid #e3e9fb !important; background: #fff !important; color: #3a4f95 !important; }
  .ap-chip.on { background: #2f55e4 !important; border-color: #2f55e4 !important; color: #fff !important; }

  .ap-hero { border-radius: 24px !important; margin-top: 12px !important; box-shadow: 0 22px 40px -24px rgba(47,43,160,.7) !important; }
  .ap-hero-in { padding: 20px !important; gap: 14px !important; }
  .ap-hero .ap-ic.xl { --s: 72px !important; }
  .ap-hero .ap-kick { font-size: 10px !important; letter-spacing: .14em !important; color: rgba(255,255,255,.78) !important; }
  .ap-hero h1 { font-size: 1.55rem !important; color: #fff !important; margin: 4px 0 6px !important; text-shadow: none !important; }
  .ap-hero p, .ap-hero-t > p { font-size: 13px !important; line-height: 1.5 !important; color: rgba(255,255,255,.86) !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ap-hero-m { font-size: 12px !important; color: rgba(255,255,255,.85) !important; gap: 4px 12px !important; }
  .ap-hero-b { gap: 10px !important; margin-top: 14px !important; }
  .ap-hero .ap-get.big { min-height: 42px !important; padding: 0 28px !important; font-size: 14px !important; background: #fff !important; color: #2f3fb8 !important; border-radius: 999px !important; font-weight: 750; }
  .ap-hero .ap-ghost { min-height: 42px !important; padding: 0 22px !important; font-size: 14px !important; color: #fff !important; border: 1px solid rgba(255,255,255,.45) !important; background: rgba(255,255,255,.12) !important; border-radius: 999px !important; }

  .ap-shelf { margin-top: 22px !important; }
  .ap-shelf > header h2 { font-size: 17px !important; font-weight: 800 !important; letter-spacing: -.02em !important; color: #172a9a !important; }
  .ap-shelf > header p { font-size: 12px !important; color: #7c8cbc !important; }
  .ap-more { font-size: 13px !important; font-weight: 700 !important; color: #2f55e4 !important; }
  .ap-row { gap: 12px !important; scrollbar-width: none; scroll-snap-type: x proximity; }
  .ap-row::-webkit-scrollbar { display: none; }
  .ap-card { width: 108px !important; scroll-snap-align: start; }
  .ap-card .ap-ic { --s: 76px !important; border-radius: 20px !important; box-shadow: 0 12px 22px -14px rgba(23,42,154,.55); }
  .ap-t { font-size: 13px !important; font-weight: 700 !important; color: #172a9a !important; }
  .ap-s { font-size: 11.5px !important; color: #7c8cbc !important; }
  .ap-m { font-size: 11.5px !important; color: #5a6fa8 !important; }

  .ap-res { padding: 12px !important; border-radius: 18px !important; background: #fff !important; border: 1px solid #e3e9fb !important; box-shadow: 0 1px 2px rgba(23,42,154,.04); margin-bottom: 10px; }
  .ap-res .ap-ic { --s: 56px !important; border-radius: 15px !important; }
  .ap-res b { font-size: 14.5px !important; color: #172a9a !important; }
  .ap-get { min-height: 34px !important; padding: 0 18px !important; font-size: 13px !important; font-weight: 750 !important; border-radius: 999px !important; }
}

/* =====================================================================
   Names and badges: never overflow, lighter blue check
   ===================================================================== */
@media (max-width: 760px) {
  /* blue check: smaller, crisp, no glow filter (cheaper to paint) */
  .vbadge { font-size: 15px !important; filter: none !important; flex: none; }
  .vbadge svg { width: 1em !important; height: 1em !important; }
  .rbadge { font-size: 9.5px !important; line-height: 1 !important; padding: 3px 7px !important; letter-spacing: .04em !important; border-radius: 999px !important; flex: none; white-space: nowrap; box-shadow: none !important; }
  .badges { gap: 4px !important; margin-left: 4px !important; flex: none !important; }
  .nm-line .badges { margin-left: 0 !important; }
  .badges.big { gap: 5px !important; margin-left: 5px !important; }
  .badges.big .vbadge { font-size: 22px !important; }
  .badges.big .rbadge { font-size: 10.5px !important; padding: 3px 8px !important; top: 0 !important; }
  .userchip .vbadge { font-size: 15px !important; }
  #dlgSub .vbadge { font-size: 15px !important; }

  /* name rows: name shrinks with an ellipsis, badges stay whole */
  .nm-line { display: inline-flex !important; align-items: center !important; gap: 5px !important; max-width: 100% !important; min-width: 0 !important; }
  .nm-line .post-name, .post-name {
    min-width: 0; max-width: 100%; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; overflow-wrap: normal !important; word-break: normal !important;
  }
  .ig-who { display: flex !important; align-items: center !important; flex-wrap: nowrap !important; gap: 4px !important; min-width: 0 !important; flex: 1 1 auto; overflow: hidden; }
  .ig-who .nm-line { flex: 0 1 auto; max-width: 62%; }
  .ig-who .dot, .ig-who .ig-ago, .ig-who svg { flex: none; white-space: nowrap; }
  .ig-head { min-width: 0; }
  .ig-head .ig-more { flex: none; }

  .sc-by { min-width: 0; max-width: 55%; }
  .sc-by > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .userchip { max-width: 100%; min-width: 0; }
  .userchip > span, .userchip b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #dlgSub .nm-line { max-width: 70%; }
  .cmt .ch { min-width: 0; flex-wrap: nowrap; }
  .cmt .ch .post-name, .cmt .ch b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* profile card: wrap long names cleanly, keep badges beside the name */
  .pp-card h1, .pp-name { min-width: 0; overflow-wrap: anywhere; word-break: normal; line-height: 1.2; }
  .pp-card .pp-ver { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; max-width: 100%; }
}

/* =====================================================================
   Profile page (phones): centered identity card
   ===================================================================== */
@media (max-width: 760px) {
  .pp-card {
    border-radius: 24px !important; overflow: hidden; background: #fff !important; border: 1px solid #e3e9fb !important;
    box-shadow: 0 1px 2px rgba(23,42,154,.05), 0 16px 30px -22px rgba(23,42,154,.5) !important;
  }
  .pp-card .pp-cover { height: 112px !important; border-radius: 0 !important; background-size: cover !important; background-position: center 30% !important; }
  .pp-card .pp-head.ig-head {
    display: flex !important; flex-direction: column !important; align-items: center !important; text-align: center;
    padding: 0 16px 16px !important; gap: 0 !important; grid-template-columns: none !important;
  }
  .pp-card .pp-av { margin: -46px 0 10px !important; position: relative; flex: none; }
  .pp-card .ig-ring { display: inline-flex; padding: 3px !important; border-radius: 50%; background: linear-gradient(135deg, #7aa2ff, #a58bff) !important; box-shadow: 0 10px 22px -10px rgba(47,85,228,.6); }
  .pp-card .ig-ring .avatar, .pp-card .ig-ring img { width: 88px !important; height: 88px !important; font-size: 36px !important; border: 3px solid #fff !important; border-radius: 50% !important; }
  .pp-card .pf-cam { right: -2px !important; bottom: -2px !important; width: 30px !important; height: 30px !important; }
  .pp-card .pf-main { grid-column: auto !important; width: 100% !important; min-width: 0; }
  .pp-card .pf-row { display: flex !important; flex-direction: column !important; align-items: center !important; gap: 12px !important; width: 100%; }
  .pp-card .pp-id { width: 100%; min-width: 0; }
  .pp-card .pp-id h1 {
    font-size: 1.2rem !important; font-weight: 800 !important; letter-spacing: -.025em !important; line-height: 1.25 !important; color: #172a9a !important;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal !important; word-break: normal !important;
  }
  .pp-card .pf-un {
    display: flex !important; align-items: center; justify-content: center; flex-wrap: wrap !important; gap: 4px 6px !important; margin-top: 3px !important;
    font-size: 13.5px !important; color: #5a6fa8 !important; overflow-wrap: anywhere; word-break: normal;
  }
  .pp-card .pf-acts { display: flex !important; gap: 8px !important; width: 100% !important; justify-content: center; }
  .pp-card .pf-acts .btn { min-height: 42px !important; border-radius: 12px !important; font-size: 13.5px !important; font-weight: 700 !important; flex: 1 1 0; }
  .pp-card .pf-acts .btn:first-child { background: #2f55e4 !important; border-color: #2f55e4 !important; color: #fff !important; }
  .pp-card .pf-acts .btn[aria-label="Settings"] { flex: 0 0 44px; padding: 0 !important; }
  .pp-card .pf-stats { display: flex !important; justify-content: center !important; gap: 8px !important; margin: 14px 0 0 !important; padding: 0; list-style: none; }
  .pp-card .pf-stats li { padding: 7px 14px !important; border-radius: 999px; background: #eef2ff; }
  .pp-card .pf-stats b { font-size: 14px !important; color: #172a9a; }
  .pp-card .pf-stats span { font-size: 12.5px !important; color: #5a6fa8; }
  .pp-card .ig-bio { margin-top: 12px !important; text-align: center; max-width: 36ch; margin-inline: auto; }
  .pp-card .ig-bio .ig-name { display: none !important; }
  .pp-card .ig-bio p { font-size: 13.5px !important; line-height: 1.55 !important; color: #3a4f95 !important; overflow-wrap: anywhere; }
  .pp-card .ig-bio .ig-sub { margin-top: 8px !important; font-size: 12px !important; color: #7c8cbc !important; }
  .pp-card .ig-tabs, .pp-card .pp-tabs { display: flex !important; overflow-x: auto; justify-content: stretch !important; border-top: 1px solid #e3e9fb !important; scrollbar-width: none; }
  .pp-card .ig-tabs::-webkit-scrollbar { display: none; }
  .pp-card .ig-tabs button { flex: 1 0 auto !important; padding: 13px 16px !important; font-size: 13.5px !important; font-weight: 700 !important; color: #7c8cbc !important; white-space: nowrap; }
  .pp-card .ig-tabs button.on { color: #2f55e4 !important; box-shadow: inset 0 -2px 0 #2f55e4; }
  .pp-card .ig-tabs small { margin-left: 5px; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #eef2ff; color: #3a55c9; }
  .pp-card .badges.big { margin-left: 2px !important; }

  .pp-body { gap: 12px !important; margin-top: 12px; }
  .pp-about, .pp-complete { padding: 16px !important; border-radius: 20px !important; background: #fff !important; border: 1px solid #e3e9fb !important; box-shadow: none !important; }
  .pp-about h3 { font-size: 15px !important; font-weight: 800 !important; color: #172a9a !important; }
  .pp-bio { font-size: 13.5px !important; line-height: 1.55 !important; color: #3a4f95; overflow-wrap: anywhere; }
  .pp-meta { font-size: 13px; color: #5a6fa8; }
  .pp-ver { display: flex !important; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; font-weight: 650; color: #243a96; }
}

@media (max-width: 760px) {
  .pp-card.ig .ig-av, .pp-card.ig .pp-av { margin: -46px 0 8px !important; justify-self: center !important; padding: 0 !important; background: none !important; width: auto !important; height: auto !important; }
  .pp-card.ig .pp-av::before, .pp-card.ig .pp-av::after, .pp-card.ig .ig-ring::before, .pp-card.ig .ig-ring::after { display: none !important; }
  .pp-card.ig .pf-acts { width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .pp-card.ig .pf-acts .btn { border-radius: 12px !important; }
  .pp-card.ig .pf-acts .btn.btn-sm[aria-label="Settings"], .pp-card.ig .pf-acts a.btn[aria-label="Settings"] { flex: 0 0 44px !important; padding: 0 !important; display: inline-grid !important; place-items: center; }
  .pp-card.ig .pf-acts .btn svg { margin: 0 !important; }
  .pp-card.ig .ig-head .pp-id, .pp-card .pp-id { padding: 0 !important; margin: 0 !important; text-align: center !important; }
  .pp-card.ig .ig-head .pp-id h1 { display: block !important; text-align: center !important; font-size: 1.2rem !important; font-weight: 800 !important; letter-spacing: -.025em !important; color: #172a9a !important; }
  .pp-card.ig .ig-head .pf-row { gap: 12px !important; }
  .pp-card.ig .ig-head .pf-main { margin: 0 !important; padding: 0 !important; }
}

@media (max-width: 760px) {
  .pp-card.ig .pp-av { min-height: 94px !important; min-width: 94px; display: flex !important; justify-content: center; align-items: flex-start; }
  .pp-card .ig-tabs button { font-family: inherit !important; text-transform: none !important; letter-spacing: 0 !important; font-size: 14px !important; }
}

/* =====================================================================
   Ishita AI chat bubble and chat window (phones)
   ===================================================================== */
@media (max-width: 760px) {
  /* floating bubble: compact, tucked above the dock */
  #ishRoot { right: 12px !important; bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important; }
  .ish-fab { width: 46px !important; height: 46px !important; box-shadow: 0 8px 18px -8px rgba(91,110,232,.75), 0 0 0 2px #fff, 0 0 0 3.5px #b9c4ff !important; transition: none !important; }
  .ish-fab::before { display: none !important; }
  .ish-fab::after { font-size: 12px !important; left: -4px !important; bottom: 3px !important; animation: none !important; }
  .ish-on { width: 11px !important; height: 11px !important; border-width: 2px !important; right: 0 !important; bottom: 1px !important; }
  .ish-heart { font-size: 13px !important; top: -6px !important; right: -4px !important; animation: none !important; }
  .ish-badge { min-width: 17px !important; height: 17px !important; top: -5px !important; left: -5px !important; font-size: 10px !important; }
  .ish-tip { width: min(210px, calc(100vw - 90px)) !important; bottom: 58px !important; padding: 10px 26px 10px 13px !important; border-radius: 16px 16px 4px 16px !important; font-size: 12px !important; }
  .ish-tip b { font-size: 13px !important; }

  /* chat window */
  .ish-panel header { padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px 12px !important; gap: 9px !important; }
  .ish-panel header > img { width: 36px !important; height: 36px !important; border-width: 2px !important; }
  .ish-id b { font-size: 15px !important; }
  .ish-id small { font-size: 11px !important; }
  .ish-panel header button, .ish-panel header a { width: 32px !important; height: 32px !important; border-radius: 10px !important; }
  .ish-log { padding: 12px 12px !important; gap: 10px !important; }
  .ish-ph { aspect-ratio: 16/8 !important; border-radius: 16px !important; }
  .ish-say { padding: 7px 14px !important; font-size: 13.5px !important; border-radius: 18px !important; }
  .ish-pills { gap: 6px !important; }
  .ish-m { gap: 6px !important; }
  .ish-m > img { width: 24px !important; height: 24px !important; }
  .ish-b { font-size: 14px !important; line-height: 1.5 !important; }
  .ish-m.me .ish-b { max-width: 82% !important; padding: 8px 12px !important; border-radius: 18px 18px 5px 18px !important; box-shadow: none !important; }
  .ish-m.bot .ish-b { max-width: calc(100% - 32px) !important; padding: 8px 12px !important; border-radius: 18px 18px 18px 5px !important; }
  .ish-time { font-size: 9.5px !important; margin-top: 3px !important; }
  .ish-chips { gap: 5px !important; padding: 0 10px 2px !important; overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none; }
  .ish-chips::-webkit-scrollbar { display: none; }
  .ish-chips button { flex: none; padding: 6px 12px !important; font-size: 12.5px !important; white-space: nowrap; }
  .ish-box { margin: 6px 10px calc(10px + env(safe-area-inset-bottom, 0px)) !important; padding: 4px 4px 4px 14px !important; border-radius: 22px !important; }
  .ish-box textarea { font-size: 16px !important; padding: 6px 0 !important; }
  .ish-box button { width: 36px !important; height: 36px !important; }
  .ish-box svg { width: 18px !important; height: 18px !important; }
}
