/* KARETA r59 — manual #masters / Избранное reference redesign.
   Route: https://kareta.kz/#masters
   This is route-specific, not a generic guard. */

body.kr-route-masters{
  --mst-r59-bg:#eef0f2;
  --mst-r59-page:#fff;
  --mst-r59-soft:#f4f4f5;
  --mst-r59-line:#e7e8eb;
  --mst-r59-text:#080b10;
  --mst-r59-muted:#6f747d;
  --mst-r59-orange:#ffb000;
  --mst-r59-orange2:#ff9800;
  --mst-r59-green:#22c55e;
  background:var(--mst-r59-bg) !important;
}
body.kr-route-masters #app{background:var(--mst-r59-bg) !important;}

body.kr-route-masters .masters-reference-r59,
body.kr-route-masters #app > .page{
  min-height:100dvh !important;
  background:var(--mst-r59-bg) !important;
  padding:clamp(14px,2.5vw,32px) clamp(12px,2.8vw,40px) calc(124px + env(safe-area-inset-bottom,0px)) !important;
}

body.kr-route-masters .kr-screen--masters{
  width:100% !important;
  max-width:1120px !important;
  margin:0 auto !important;
  padding:clamp(22px,3vw,38px) !important;
  background:#fff !important;
  border:1px solid rgba(15,23,42,.055) !important;
  border-radius:28px !important;
  box-shadow:0 16px 42px rgba(15,23,42,.08) !important;
  overflow:hidden !important;
}

/* Header */
body.kr-route-masters .kr-master-screen-header{
  display:grid !important;
  grid-template-columns:44px minmax(0,1fr) 44px !important;
  gap:12px !important;
  align-items:center !important;
  margin:0 0 18px !important;
  padding:0 !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}
body.kr-route-masters .kr-header__title{
  color:var(--mst-r59-text) !important;
  font-size:clamp(38px,5.5vw,68px) !important;
  line-height:.94 !important;
  font-weight:950 !important;
  letter-spacing:-.075em !important;
  margin:0 !important;
}
body.kr-route-masters .kr-back,
body.kr-route-masters .kr-icon-btn{
  width:44px !important;
  height:44px !important;
  border:0 !important;
  border-radius:14px !important;
  background:var(--mst-r59-soft) !important;
  color:#111 !important;
  box-shadow:none !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-weight:950 !important;
}

/* Search */
body.kr-route-masters .kr-master-screen-search{
  margin:0 0 12px !important;
  padding:8px !important;
  border-radius:18px !important;
  background:var(--mst-r59-soft) !important;
  border:1px solid var(--mst-r59-line) !important;
  box-shadow:none !important;
}
body.kr-route-masters .kr-search__input{
  width:100% !important;
  min-height:48px !important;
  border:0 !important;
  border-radius:14px !important;
  background:#fff !important;
  color:var(--mst-r59-text) !important;
  padding:0 14px !important;
  font-size:16px !important;
  font-weight:750 !important;
}

/* Tabs */
body.kr-route-masters .kr-master-screen-tabs{
  display:flex !important;
  gap:8px !important;
  overflow-x:auto !important;
  scrollbar-width:none !important;
  margin:0 0 18px !important;
  padding:10px !important;
  border-radius:18px !important;
  background:var(--mst-r59-soft) !important;
  border:1px solid var(--mst-r59-line) !important;
}
body.kr-route-masters .kr-master-screen-tabs::-webkit-scrollbar{display:none !important;}
body.kr-route-masters .kr-tab{
  flex:0 0 auto !important;
  min-height:38px !important;
  padding:0 13px !important;
  border:0 !important;
  border-radius:12px !important;
  background:#fff !important;
  color:var(--mst-r59-muted) !important;
  font-size:14px !important;
  font-weight:900 !important;
  white-space:nowrap !important;
}
body.kr-route-masters .kr-tab.is-active{
  color:#111 !important;
  background:#fff3c7 !important;
  box-shadow:inset 0 -2px 0 var(--mst-r59-orange) !important;
}

/* List */
body.kr-route-masters .masters-reference-r59-list,
body.kr-route-masters .kr-master-screen-list{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:14px !important;
}

/* Actual cards */
body.kr-route-masters .kr-master-screen-card{
  position:relative !important;
  min-width:0 !important;
  max-width:100% !important;
  min-height:108px !important;
  margin:0 !important;
  padding:16px !important;
  display:grid !important;
  grid-template-columns:64px minmax(0,1fr) 28px !important;
  gap:14px !important;
  align-items:center !important;
  border:1px solid var(--mst-r59-line) !important;
  border-radius:18px !important;
  background:#fff !important;
  box-shadow:0 8px 24px rgba(15,23,42,.055) !important;
  overflow:hidden !important;
  cursor:pointer !important;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease !important;
}
body.kr-route-masters .kr-master-screen-card:hover{
  transform:translateY(-1px) !important;
  border-color:rgba(255,176,0,.28) !important;
  box-shadow:0 14px 32px rgba(15,23,42,.08) !important;
}
body.kr-route-masters .kr-master-screen-avatar{
  width:64px !important;
  height:64px !important;
  border-radius:18px !important;
  background:#26282e !important;
  color:#fff !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:20px !important;
  font-weight:950 !important;
  letter-spacing:-.04em !important;
  position:relative !important;
  overflow:visible !important;
}
body.kr-route-masters .kr-master-screen-avatar span{
  position:absolute !important;
  right:0 !important;
  bottom:0 !important;
  width:14px !important;
  height:14px !important;
  border-radius:999px !important;
  border:2px solid #fff !important;
  background:var(--mst-r59-green) !important;
}
body.kr-route-masters .kr-master-screen-avatar span.is-busy{
  background:#f59e0b !important;
}
body.kr-route-masters .kr-master-screen-body{
  min-width:0 !important;
  display:grid !important;
  gap:6px !important;
}
body.kr-route-masters .kr-master-screen-top{
  min-width:0 !important;
  display:flex !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:10px !important;
}
body.kr-route-masters .kr-master-screen-top h3{
  min-width:0 !important;
  margin:0 !important;
  color:var(--mst-r59-text) !important;
  font-size:clamp(18px,2vw,22px) !important;
  line-height:1.1 !important;
  font-weight:950 !important;
  letter-spacing:-.045em !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
body.kr-route-masters .kr-master-screen-top b{
  flex:0 0 auto !important;
  min-height:26px !important;
  padding:5px 9px !important;
  border-radius:999px !important;
  background:#fff3c7 !important;
  color:#6f4a00 !important;
  font-size:12px !important;
  line-height:1.1 !important;
  font-weight:950 !important;
  white-space:nowrap !important;
}
body.kr-route-masters .kr-master-screen-spec{
  margin:0 !important;
  color:#363b44 !important;
  font-size:14px !important;
  line-height:1.22 !important;
  font-weight:800 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
body.kr-route-masters .kr-master-screen-meta{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:6px !important;
  color:var(--mst-r59-muted) !important;
  font-size:13px !important;
  line-height:1.2 !important;
  font-weight:800 !important;
}
body.kr-route-masters .kr-master-screen-meta span:first-child{
  color:var(--mst-r59-orange2) !important;
  font-weight:950 !important;
}
body.kr-route-masters .kr-master-screen-chevron{
  width:28px !important;
  height:28px !important;
  border-radius:10px !important;
  background:var(--mst-r59-soft) !important;
  color:#111 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:22px !important;
  font-weight:900 !important;
}

/* Empty */
body.kr-route-masters .kr-master-screen-empty{
  min-height:280px !important;
  border:1px dashed #d9dbe0 !important;
  border-radius:22px !important;
  background:#fafafa !important;
  padding:24px !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  text-align:center !important;
}

/* Tablet/wide */
@media (min-width:768px){
  body.kr-route-masters .masters-reference-r59{
    padding:clamp(20px,3vw,40px) clamp(20px,3vw,48px) calc(128px + env(safe-area-inset-bottom,0px)) !important;
  }
  body.kr-route-masters .kr-screen--masters{
    padding:clamp(26px,3vw,38px) !important;
  }
  body.kr-route-masters .kr-master-screen-header{
    grid-template-columns:52px minmax(0,1fr) 52px !important;
    margin-bottom:22px !important;
  }
  body.kr-route-masters .kr-back,
  body.kr-route-masters .kr-icon-btn{
    width:52px !important;
    height:52px !important;
    border-radius:16px !important;
  }
  body.kr-route-masters .masters-reference-r59-list,
  body.kr-route-masters .kr-master-screen-list{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}
@media (min-width:1180px){
  body.kr-route-masters .masters-reference-r59-list,
  body.kr-route-masters .kr-master-screen-list{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }
  body.kr-route-masters .kr-master-screen-card{
    grid-template-columns:60px minmax(0,1fr) 26px !important;
  }
  body.kr-route-masters .kr-master-screen-avatar{
    width:60px !important;
    height:60px !important;
  }
}

/* Mobile full-screen app mode */
@media (max-width:767px){
  body.kr-route-masters,
  body.kr-route-masters #app,
  body.kr-route-masters .masters-reference-r59{
    background:#fff !important;
  }
  body.kr-route-masters .masters-reference-r59{
    padding:0 0 calc(92px + env(safe-area-inset-bottom,0px)) !important;
  }
  body.kr-route-masters .kr-screen--masters{
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    padding:18px 14px 22px !important;
    min-height:100dvh !important;
  }
  body.kr-route-masters .kr-header__title{
    font-size:clamp(34px,10vw,42px) !important;
  }
  body.kr-route-masters .kr-master-screen-card{
    grid-template-columns:56px minmax(0,1fr) 24px !important;
    padding:14px !important;
    border-radius:16px !important;
  }
  body.kr-route-masters .kr-master-screen-avatar{
    width:56px !important;
    height:56px !important;
    border-radius:16px !important;
  }
  body.kr-route-masters .kr-master-screen-top{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
  }
  body.kr-route-masters .kr-master-screen-meta{
    font-size:12px !important;
  }
}

/* Low-height tablet compact */
@media (min-width:768px) and (max-height:760px){
  body.kr-route-masters .masters-reference-r59{
    padding-top:14px !important;
    padding-bottom:104px !important;
  }
  body.kr-route-masters .kr-screen--masters{
    padding:20px !important;
  }
  body.kr-route-masters .kr-header__title{
    font-size:46px !important;
  }
}

/* Master profile opened from #masters:<id> — keep it in the same app-card language. */
body.kr-route-masters :where(.master-profile-page){
  min-height:100dvh !important;
  background:var(--mst-r59-bg) !important;
  padding:clamp(14px,2.5vw,32px) clamp(12px,2.8vw,40px) calc(124px + env(safe-area-inset-bottom,0px)) !important;
}
body.kr-route-masters .master-profile-page > .container{
  max-width:1120px !important;
  margin:0 auto !important;
  padding:clamp(20px,3vw,36px) !important;
  background:#fff !important;
  border:1px solid rgba(15,23,42,.055) !important;
  border-radius:28px !important;
  box-shadow:0 16px 42px rgba(15,23,42,.08) !important;
}

/* Hard guards */
body.kr-route-masters :where(h1,h2,h3,h4,p,span,small,b,strong,a,button,label,div){
  min-width:0 !important;
  max-width:100% !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
}
