/* AutoSchools V2.0.5 — approved full-card Hero, responsive density and overflow hardening. */
/* --------------------------------------------------------------------------
   AutoSchools V2.0.5 production visual lock
   - approved hero artwork is a full-card background layer, not a small column
   - copy always remains above the artwork/readability veil
   - typography and responsive constraints are tuned for 320–570px WebViews
   -------------------------------------------------------------------------- */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { -webkit-font-smoothing: antialiased; }

.role-hero {
  --hero-art-width: 72%;
  --hero-art-right: -7%;
  --hero-art-y: 112px;
  --hero-art-scale: 1;
  --hero-copy-width: 58%;
  min-height: 0;
  padding: 21px 17px 16px;
  overflow: hidden;
  contain: paint;
}
.role-hero::before { z-index: 2; }
.role-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(2, 11, 27, .93) 0%, rgba(3, 13, 31, .84) 30%, rgba(3, 13, 31, .48) 54%, rgba(3, 13, 31, .06) 77%, transparent 100%),
    linear-gradient(180deg, transparent 46%, rgba(2, 10, 25, .23) 68%, rgba(2, 10, 25, .68) 100%);
}
.role-hero-aura { z-index: 0; right: -46px; top: -74px; width: 310px; height: 310px; }
.role-hero-top {
  z-index: 3;
  display: block;
  min-height: 214px;
  position: relative;
}
.role-hero-copy {
  position: relative;
  z-index: 4;
  width: var(--hero-copy-width);
  max-width: 310px;
  min-width: 0;
  padding-top: 2px;
}
.role-greeting {
  max-width: 100%;
  margin-bottom: 8px;
  font-size: clamp(13px, 3.25vw, 14.5px);
  line-height: 1.25;
  letter-spacing: -.08px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .34);
}
.role-hero h2 {
  max-width: 100%;
  font-size: clamp(28px, 6.9vw, 34px);
  line-height: 1.025;
  letter-spacing: -1.05px;
  text-wrap: balance;
  overflow-wrap: normal;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .36);
}
.role-identity {
  max-width: 100%;
  margin-top: 13px;
  gap: 9px;
  flex-wrap: nowrap;
}
.role-badge {
  min-width: 0;
  max-width: calc(100% - 49px);
  padding: 6px 11px;
  font-size: 11.5px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(10px) saturate(125%);
}
.role-badge > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.role-avatar { flex: 0 0 40px; }

/* The approved illustration now spans the entire hero and behaves as artwork in
   the card's background plane. It is deliberately independent of the copy flow. */
.role-hero-art-layer,
.role-hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  min-width: 0;
  pointer-events: auto;
  perspective: 1000px;
  transform-origin: 78% 26%;
  transform: translate3d(var(--hero-tx), var(--hero-ty), 0) rotateX(var(--hero-rx)) rotateY(var(--hero-ry));
  transition: transform .26s cubic-bezier(.2,.72,.2,1), filter .26s ease;
}
.role-hero-visual.is-interacting { transition-duration: .09s; }
.approved-role-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transform-style: preserve-3d;
  isolation: isolate;
  overflow: visible;
}
.approved-role-art img,
.approved-role-art--student img,
.approved-role-art--instructor img,
.approved-role-art--director img,
.approved-role-art--franchise img,
.approved-role-art--platform img {
  position: absolute;
  left: auto;
  right: var(--hero-art-right);
  top: var(--hero-art-y);
  width: var(--hero-art-width);
  max-width: none;
  height: auto;
  transform: translate3d(0, -50%, 18px) scale(var(--hero-art-scale));
  transform-origin: 72% 48%;
  opacity: .99;
  filter: drop-shadow(0 18px 30px rgba(0, 48, 140, .48)) saturate(1.11) contrast(1.035);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.16) 9%, rgba(0,0,0,.78) 25%, #000 39%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.16) 9%, rgba(0,0,0,.78) 25%, #000 39%, #000 100%);
  animation: approvedHeroFloat 6.2s ease-in-out infinite;
  will-change: transform, filter, opacity;
}
.role-hero--student { --hero-art-width: 67%; --hero-art-right: -3%; --hero-art-y: 111px; --hero-art-scale: 1.08; --hero-copy-width: 59%; }
.role-hero--instructor { --hero-art-width: 76%; --hero-art-right: -8%; --hero-art-y: 112px; --hero-art-scale: 1.06; --hero-copy-width: 58%; }
.role-hero--director { --hero-art-width: 81%; --hero-art-right: -12%; --hero-art-y: 111px; --hero-art-scale: 1.02; --hero-copy-width: 58%; }
.role-hero--franchise { --hero-art-width: 83%; --hero-art-right: -13%; --hero-art-y: 111px; --hero-art-scale: 1.02; --hero-copy-width: 55%; }
.role-hero--platform { --hero-art-width: 84%; --hero-art-right: -14%; --hero-art-y: 108px; --hero-art-scale: 1.04; --hero-copy-width: 55%; }
.approved-art-grid {
  left: 43%; right: -8%; top: 16px; bottom: auto; height: 192px;
  z-index: -3;
  opacity: .72;
  transform: perspective(340px) rotateX(63deg) translateY(48px);
}
.approved-art-halo {
  right: -2%; top: 24px;
  width: 62%;
  aspect-ratio: 1.35;
  z-index: -2;
}
.approved-art-scan {
  left: 47%; right: 3%; top: 91px;
  z-index: 1;
  opacity: .42;
}
.approved-art-spark-a { right: 14%; top: 50px; }
.approved-art-spark-b { left: 54%; bottom: auto; top: 167px; }
.role-hero-visual.is-energized .approved-role-art img {
  filter: drop-shadow(0 20px 36px rgba(0, 84, 210, .66)) saturate(1.2) brightness(1.09) contrast(1.045);
  opacity: 1;
}

.role-metrics {
  z-index: 4;
  gap: 8px;
  margin-top: 12px;
}
.role-metric {
  min-width: 0;
  min-height: 88px;
  padding: 10px 9px;
  grid-template-columns: 37px minmax(0,1fr);
  gap: 8px;
  overflow: hidden;
  backdrop-filter: blur(12px) saturate(122%);
}
.role-metric-icon { width: 37px; height: 37px; border-radius: 12px; }
.role-metric-copy { min-width: 0; gap: 2px; }
.role-metric-copy small {
  margin: 0 0 2px;
  font-size: 10.5px;
  line-height: 1.18;
  letter-spacing: -.08px;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: pretty;
}
.role-metric-copy strong,
.role-hero--student .role-metric:nth-child(2) .role-metric-copy strong {
  min-width: 0;
  max-width: 100%;
  font-size: 20px;
  line-height: 1.02;
  letter-spacing: -.45px;
  overflow: visible;
  white-space: nowrap;
}
.role-hero--student .role-metric:nth-child(2) { grid-template-columns: 39px minmax(0,1fr); }
.role-hero--student .role-metric-ring { width: 39px; height: 39px; }
.role-hero-primary {
  z-index: 4;
  min-height: 58px;
  margin-top: 13px;
  border-radius: 17px;
  font-size: 16.5px;
  letter-spacing: -.15px;
}

/* Text/card containment hardening: no labels or descriptions can paint outside
   their cards in Russian, Ukrainian or English. */
#home-apps-grid .app-widget { overflow: hidden; min-width: 0; }
#home-apps-grid .app-widget-head { min-width: 0; }
#home-apps-grid .app-widget-head strong {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  text-wrap: balance;
}
#home-apps-grid .app-widget-copy { min-width: 0; }
#home-apps-grid .app-widget-copy small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.role-glance { min-width: 0; overflow: hidden; }
.role-glance > div:nth-child(2) { min-width: 0; }
.role-glance strong, .role-glance small { overflow-wrap: anywhere; }

#role-bottom-nav .nav { overflow: visible; }
#role-bottom-nav .nav-label {
  width: 100%;
  max-width: none;
  padding-inline: 1px;
  font-size: clamp(9px, 2.45vw, 10.5px);
  letter-spacing: -.14px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 430px) {
  .role-hero { padding: 19px 14px 15px; }
  .role-hero-top { display:block; min-height: 208px; }
  .role-hero-copy { width: var(--hero-copy-width); }
  .role-hero h2 { max-width:100%; font-size: clamp(27px, 7.1vw, 30px); }
  .role-hero--student { --hero-art-width: 69%; --hero-art-right: -4%; --hero-art-y: 107px; --hero-copy-width: 59%; }
  .role-hero--instructor { --hero-art-width: 79%; --hero-art-right: -10%; --hero-art-y: 109px; --hero-copy-width: 58%; }
  .role-hero--director { --hero-art-width: 83%; --hero-art-right: -13%; --hero-art-y: 107px; --hero-copy-width: 58%; }
  .role-hero--franchise { --hero-art-width: 85%; --hero-art-right: -15%; --hero-art-y: 106px; --hero-copy-width: 55%; }
  .role-hero--platform { --hero-art-width: 86%; --hero-art-right: -16%; --hero-art-y: 104px; --hero-copy-width: 55%; }
  .role-metric { min-height: 84px; grid-template-columns: 34px minmax(0,1fr); padding: 9px 7px; gap: 6px; }
  .role-metric-icon { width:34px; height:34px; }
  .role-metric-copy small { font-size: 10px; }
  .role-metric-copy strong,
  .role-hero--student .role-metric:nth-child(2) .role-metric-copy strong { font-size: 18px; }
  .role-hero--student .role-metric:nth-child(2) { grid-template-columns:35px minmax(0,1fr); }
  .role-hero--student .role-metric-ring { width:35px; height:35px; }
  #home-apps-grid .app-widget { min-height: 158px; }
}

@media (max-width: 390px) {
  .app { padding-inline: 11px; }
  .role-hero { padding: 18px 13px 14px; border-radius: 23px; }
  .role-hero-top { min-height: 202px; }
  .role-hero h2 { font-size: clamp(25px, 7vw, 28px); letter-spacing: -.82px; }
  .role-greeting { font-size: 12.5px; }
  .role-badge { font-size: 10.8px; padding-inline: 9px; }
  .role-avatar { width: 38px; height: 38px; flex-basis: 38px; }
  .role-hero::after {
    background:
      linear-gradient(90deg, rgba(2,11,27,.95) 0%, rgba(3,13,31,.87) 33%, rgba(3,13,31,.54) 57%, rgba(3,13,31,.08) 81%, transparent 100%),
      linear-gradient(180deg, transparent 44%, rgba(2,10,25,.28) 67%, rgba(2,10,25,.72) 100%);
  }
  .role-hero--student { --hero-art-width: 72%; --hero-art-right: -6%; --hero-copy-width: 61%; }
  .role-hero--instructor { --hero-art-width: 82%; --hero-art-right: -13%; --hero-copy-width: 60%; }
  .role-hero--director { --hero-art-width: 86%; --hero-art-right: -17%; --hero-copy-width: 60%; }
  .role-hero--franchise { --hero-art-width: 87%; --hero-art-right: -18%; --hero-copy-width: 58%; }
  .role-hero--platform { --hero-art-width: 89%; --hero-art-right: -20%; --hero-copy-width: 58%; }
  .role-metrics { gap: 6px; }
  .role-metric { min-height: 82px; grid-template-columns: 31px minmax(0,1fr); padding: 8px 6px; gap: 5px; }
  .role-metric-icon { width:31px; height:31px; }
  .role-metric-icon .as-icon { width:19px; height:19px; }
  .role-metric-copy small { font-size: 9.4px; line-height:1.15; }
  .role-metric-copy strong,
  .role-hero--student .role-metric:nth-child(2) .role-metric-copy strong { font-size:17px; }
  .role-hero--student .role-metric:nth-child(2) { grid-template-columns:32px minmax(0,1fr); }
  .role-hero--student .role-metric-ring { width:32px; height:32px; }
  #home-apps-grid .app-widget { min-height: 156px; padding: 12px; }
  #home-apps-grid .app-widget-head strong { font-size: 16px; }
  #home-apps-grid .app-widget-copy small { font-size: 11.5px; }
}

@media (max-width: 350px) {
  .role-hero-top { display:block; min-height: 192px; }
  .role-hero-visual { display:block !important; opacity:.93; }
  .role-hero-copy { width: 64%; }
  .role-hero h2 { font-size: 24px; line-height:1.03; }
  .role-identity { gap:6px; }
  .role-badge { max-width:calc(100% - 41px); font-size:10px; padding:5px 8px; }
  .role-avatar { width:35px; height:35px; flex-basis:35px; }
  .role-hero--student { --hero-art-width: 76%; --hero-art-right: -10%; --hero-art-y: 102px; }
  .role-hero--instructor { --hero-art-width: 87%; --hero-art-right: -18%; --hero-art-y: 103px; }
  .role-hero--director { --hero-art-width: 91%; --hero-art-right: -22%; --hero-art-y: 102px; }
  .role-hero--franchise { --hero-art-width: 92%; --hero-art-right: -23%; --hero-art-y: 101px; }
  .role-hero--platform { --hero-art-width: 93%; --hero-art-right: -24%; --hero-art-y: 100px; }
  .role-metric { min-height: 82px; grid-template-columns:1fr; text-align:center; padding:7px 4px; gap:4px; }
  .role-metric-icon, .role-metric-ring, .role-hero--student .role-metric-ring { width:29px; height:29px; margin:0 auto; }
  .role-hero--student .role-metric:nth-child(2) { grid-template-columns:1fr; }
  .role-metric-copy small { font-size:8.8px; }
  .role-metric-copy strong,
  .role-hero--student .role-metric:nth-child(2) .role-metric-copy strong { font-size:16px; }
  .role-hero-primary { min-height:54px; font-size:15px; }
  #home-apps-grid.app-widget-grid { grid-template-columns:1fr; }
  #home-apps-grid .app-widget { min-height:136px; }
  #role-bottom-nav .nav-label { font-size:8.6px; }
}

.no-motion .role-hero-art-layer,
.no-motion .approved-role-art img,
.no-motion .approved-art-halo,
.no-motion .approved-art-scan,
.no-motion .approved-art-spark { transition:none!important; animation:none!important; }
@media (prefers-reduced-motion: reduce) {
  .role-hero-art-layer,
  .approved-role-art img,
  .approved-art-halo,
  .approved-art-scan,
  .approved-art-spark { transition:none!important; animation:none!important; }
}

/* Final V2.0.5 title/readability calibration against the approved role boards. */
.role-hero::after {
  background:
    linear-gradient(90deg, rgba(2,11,27,.95) 0%, rgba(3,13,31,.87) 38%, rgba(3,13,31,.60) 62%, rgba(3,13,31,.13) 84%, transparent 100%),
    linear-gradient(180deg, transparent 46%, rgba(2,10,25,.23) 68%, rgba(2,10,25,.68) 100%);
}
.role-hero--student { --hero-copy-width: 74%; }
.role-hero--instructor { --hero-copy-width: 76%; }
.role-hero--director { --hero-copy-width: 74%; }
.role-hero--franchise { --hero-copy-width: 68%; }
.role-hero--platform { --hero-copy-width: 68%; }
.role-greeting {
  width: min(330px, calc(100vw - 64px));
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.role-hero h2 { font-size: clamp(26px, 6.15vw, 31px); }
.role-metric-copy small { font-size: 10px; }
.role-metric-icon { width: 34px; height: 34px; }
.role-metric { grid-template-columns: 34px minmax(0,1fr); gap: 6px; }
.role-hero--student .role-metric:nth-child(2) { grid-template-columns: 36px minmax(0,1fr); }
.role-hero--student .role-metric-ring { width:36px; height:36px; }

@media (max-width:430px) {
  .role-hero--student { --hero-copy-width: 74%; }
  .role-hero--instructor { --hero-copy-width: 76%; }
  .role-hero--director { --hero-copy-width: 74%; }
  .role-hero--franchise { --hero-copy-width: 68%; }
  .role-hero--platform { --hero-copy-width: 68%; }
  .role-hero h2 { font-size: 26px; line-height: 1.04; letter-spacing: -.78px; }
  .role-greeting { font-size: 12.5px; }
  .role-metric-copy small { font-size: 9.6px; }
}
@media (max-width:390px) {
  .role-hero--student { --hero-copy-width: 77%; }
  .role-hero--instructor { --hero-copy-width: 79%; }
  .role-hero--director { --hero-copy-width: 77%; }
  .role-hero--franchise { --hero-copy-width: 72%; }
  .role-hero--platform { --hero-copy-width: 72%; }
  .role-hero h2 { font-size: 24.5px; letter-spacing: -.68px; }
  .role-greeting { width:min(300px,calc(100vw - 54px)); font-size:12px; }
  .role-metric-copy small { font-size: 9.1px; }
}
@media (max-width:350px) {
  .role-hero-copy { width: 78%; }
  .role-hero--franchise .role-hero-copy,
  .role-hero--platform .role-hero-copy { width: 74%; }
  .role-hero h2 { font-size: 22.5px; }
  .role-greeting { width:min(260px,calc(100vw - 46px)); font-size:11.2px; }
}

/* Mobile viewport density: keep the approved large Hero while leaving the first
   action row visible above the fold on common iPhone/Telegram WebViews. */
.role-hero { padding: 17px 16px 14px; }
.role-hero-top { min-height: 156px; }
.role-hero--student { --hero-art-y: 92px; }
.role-hero--instructor { --hero-art-y: 94px; }
.role-hero--director { --hero-art-y: 93px; }
.role-hero--franchise { --hero-art-y: 94px; }
.role-hero--platform { --hero-art-y: 91px; }
.approved-art-grid { top: 8px; height: 166px; }
.approved-art-halo { top: 10px; }
.approved-art-scan { top: 76px; }
.approved-art-spark-a { top: 36px; }
.approved-art-spark-b { top: 144px; }
.role-metrics { margin-top: 9px; }
.role-metric { min-height: 74px; padding: 8px 7px; }
.role-metric-copy small { font-size: 9.6px; }
.role-metric-copy strong,
.role-hero--student .role-metric:nth-child(2) .role-metric-copy strong { font-size: 18px; }
.role-hero-primary { min-height: 53px; margin-top: 10px; }
.role-apps-head { margin-top: 20px; margin-bottom: 9px; }
.role-apps-head .section-link { display: none; }
#home-apps-grid .app-widget { min-height: 142px; padding: 13px; }
#home-apps-grid .app-widget-copy { margin-top: 10px; }
#home-apps-grid .app-widget-copy small { -webkit-line-clamp: 3; }

@media (max-width:430px) {
  .role-hero { padding: 16px 13px 13px; }
  .role-hero-top { min-height: 151px; }
  .role-hero--student { --hero-art-y: 89px; }
  .role-hero--instructor { --hero-art-y: 91px; }
  .role-hero--director { --hero-art-y: 90px; }
  .role-hero--franchise { --hero-art-y: 91px; }
  .role-hero--platform { --hero-art-y: 88px; }
  .role-metric { min-height: 72px; }
  .role-hero-primary { min-height: 52px; }
  #home-apps-grid .app-widget { min-height: 136px; }
}
@media (max-width:390px) {
  .role-hero-top { min-height: 148px; }
  .role-metric { min-height: 70px; padding: 7px 5px; }
  .role-metric-copy small { font-size: 8.9px; }
  .role-metric-copy strong,
  .role-hero--student .role-metric:nth-child(2) .role-metric-copy strong { font-size: 16.5px; }
  .role-hero-primary { min-height: 50px; font-size: 15px; }
  #home-apps-grid .app-widget { min-height: 132px; }
}
@media (max-width:350px) {
  .role-hero-top { min-height: 146px; }
  .role-metric { min-height: 76px; }
  #home-apps-grid .app-widget { min-height: 128px; }
}

/* Approved action cards are compact rectangles; explicitly clear the legacy
   square aspect ratio and the inherited ::after inset shorthand. */
#home-apps-grid .app-widget {
  aspect-ratio: auto;
  grid-template-rows: auto 1fr;
  padding-bottom: 42px;
}
#home-apps-grid .app-widget::after {
  content: "→";
  inset: auto 12px 12px auto;
  left: auto;
  top: auto;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 30px;
  height: 30px;
  background: rgba(5,15,35,.72);
}

/* Final overflow hardening from the 90-case RU/UA/EN viewport matrix. */
.role-metric-copy small { overflow-wrap:anywhere; word-break:normal; }
#home-apps-grid .app-widget-head strong {
  display:block;
  overflow:visible;
  -webkit-line-clamp:unset;
  line-clamp:unset;
}
@media (max-width:430px) {
  #home-apps-grid .app-widget-head strong { font-size:15px; line-height:1.08; }
}
@media (max-width:350px) {
  .role-hero .role-metric,
  .role-hero--student .role-metric:nth-child(2) {
    grid-template-columns:1fr !important;
    text-align:center;
  }
  .role-metric-copy strong,
  .role-hero--student .role-metric:nth-child(2) .role-metric-copy strong {
    white-space:normal;
    font-size:15px;
    line-height:1.02;
  }
  .role-metric-copy small { font-size:8.2px; line-height:1.08; }
  #role-bottom-nav .nav-label { font-size:7.8px; letter-spacing:-.3px; }
  #home-apps-grid .app-widget-head strong { font-size:14px; }
}

/* Keep all user-facing Hero typography optically crisp; contrast comes from the
   readability veil rather than glyph blur/glow. */
.role-greeting,
.role-hero h2 { text-shadow: none; }
