/* UI-r49 — global smoke guards after client/master/STO cabinet polish.
   Scope: visual safety only. No route, API, DB or business-logic changes. */
:root{
  --kr-r49-orange:#ff6a00;
  --kr-r49-text:#101821;
  --kr-r49-muted:#667085;
  --kr-r49-line:rgba(15,23,42,.10);
  --kr-r49-card:#fff;
  --kr-r49-soft:rgba(255,106,0,.10);
}

/* Universal anti-overlap contract for icon+text UI controls. */
button,
.btn,
.flow-btn,
.catalog-tool-btn,
.services-app-btn,
.services-app-card,
.services-app-option,
.services-app-sheet-option,
.cabinet-action,
.client-cabinet-card,
.master-cabinet-tile,
.sto-row-btn,
.sto-btn,
.mcab-section .btn{
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
}

button > span,
.btn > span,
.catalog-tool-btn > span,
.services-app-btn > span,
.services-app-card > span,
.services-app-option > span,
.services-app-sheet-option > span,
.client-cabinet-card span,
.master-cabinet-tile span,
.sto-row-btn span,
.sto-btn span{
  min-width:0;
}

button b,
.btn b,
.catalog-tool-btn b,
.services-app-btn b,
.services-app-card b,
.services-app-option b,
.services-app-sheet-option b,
.client-cabinet-card b,
.master-cabinet-tile b,
.sto-row-btn b,
.sto-btn b{
  min-width:0;
  overflow-wrap:anywhere;
  word-break:normal;
  line-height:1.18;
}

/* Keep line-icon language consistent with the first onboarding screens. */
[class*="ico"],
[class*="icon"],
.kr-ui-icon,
.mct-ico,
.sto-stat-ico,
.sto-order-ico,
.sto-dash-ico,
.cabinet-stat-ico,
.services-app-card__ico,
.services-app-option__ico,
.bnav-icon-wrap{
  flex:0 0 auto;
  color:var(--kr-r49-orange);
}

/* Prevent old large emoji glyphs from forcing row height or text collision. */
.catalog-tool-btn__ico,
.mo-search-ico,
.services-app-card__ico,
.services-app-option__ico,
.services-app-sheet-option__ico,
.cabinet-stat-ico,
.master-cabinet-icon,
.sto-stat-ico,
.sto-order-ico,
.sto-dash-ico,
.mct-ico{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  min-width:42px;
  border-radius:14px;
  background:var(--kr-r49-soft);
  border:1px solid rgba(255,106,0,.18);
  font-size:0!important;
  line-height:1;
  overflow:hidden;
}

.catalog-tool-btn__ico::before,
.mo-search-ico::before,
.services-app-card__ico::before,
.services-app-option__ico::before,
.services-app-sheet-option__ico::before,
.cabinet-stat-ico::before,
.master-cabinet-icon::before,
.sto-stat-ico::before,
.sto-order-ico::before,
.sto-dash-ico::before,
.mct-ico::before{
  content:'';
  display:block;
  width:22px;
  height:22px;
  background:currentColor;
  -webkit-mask:var(--kr-ui-icon-user, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.6-4.4 4.2-6 8-6s6.4 1.6 8 6'/%3E%3C/svg%3E")) center / contain no-repeat;
  mask:var(--kr-ui-icon-user, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.6-4.4 4.2-6 8-6s6.4 1.6 8 6'/%3E%3C/svg%3E")) center / contain no-repeat;
}

/* Buttons: final pass after cabinet polish. */
.btn-primary,
.flow-btn--primary,
.services-app-primary,
.services-app-submit,
.onb2-role-continue{
  background:linear-gradient(180deg,#ff7a1a 0%,#ff5a00 100%)!important;
  color:#fff!important;
  border-color:rgba(255,106,0,.95)!important;
  box-shadow:0 12px 26px rgba(255,106,0,.20)!important;
}
.btn-outline,
.btn-secondary,
.flow-btn--secondary,
.services-app-secondary,
.services-app-ghost,
.sto-row-btn,
.sto-btn,
.master-cabinet-tile{
  background:rgba(255,255,255,.86)!important;
  color:var(--kr-r49-text)!important;
  border-color:var(--kr-r49-line)!important;
}

/* Mobile smoke: controls must wrap, not collide. */
@media (max-width:767px){
  .catalog-tool-btn,
  .services-app-btn,
  .services-app-option,
  .services-app-sheet-option,
  .client-cabinet-card,
  .master-cabinet-tile,
  .sto-row-btn,
  .sto-btn{
    gap:10px!important;
    align-items:center!important;
  }
  .catalog-tool-btn b,
  .services-app-btn b,
  .services-app-option b,
  .services-app-sheet-option b,
  .client-cabinet-card b,
  .master-cabinet-tile b,
  .sto-row-btn b,
  .sto-btn b{
    font-size:clamp(13px,3.6vw,16px)!important;
  }
  .catalog-tool-btn__ico,
  .mo-search-ico,
  .services-app-card__ico,
  .services-app-option__ico,
  .services-app-sheet-option__ico,
  .cabinet-stat-ico,
  .master-cabinet-icon,
  .sto-stat-ico,
  .sto-order-ico,
  .sto-dash-ico,
  .mct-ico{
    width:38px;
    height:38px;
    min-width:38px;
    border-radius:13px;
  }
}

/* Tablet/wide smoke: keep cards readable and avoid over-stretched text lines. */
@media (min-width:768px){
  .services-app-phone,
  .client-cabinet-shell,
  .master-cabinet-shell,
  .sto-dispatch-page{
    min-width:0;
    overflow-x:hidden;
  }
  .services-app-list,
  .client-cabinet-grid,
  .master-cabinet-tile-nav,
  .sto-stat-grid{
    align-items:stretch;
  }
  .services-app-card,
  .client-cabinet-card,
  .master-cabinet-tile,
  .sto-stat-card,
  .sto-section{
    min-height:auto;
    height:auto;
  }
  .services-app-card *,
  .client-cabinet-card *,
  .master-cabinet-tile *,
  .sto-section *,
  .sto-stat-card *{
    overflow-wrap:anywhere;
  }
}

@media (min-width:1024px){
  .catalog-tool-btn__ico,
  .mo-search-ico,
  .services-app-card__ico,
  .services-app-option__ico,
  .services-app-sheet-option__ico,
  .cabinet-stat-ico,
  .master-cabinet-icon,
  .sto-stat-ico,
  .sto-order-ico,
  .sto-dash-ico,
  .mct-ico{
    width:46px;
    height:46px;
    min-width:46px;
    border-radius:16px;
  }
}

@media (min-width:768px) and (max-height:760px){
  .services-app-phone,
  .client-cabinet-shell,
  .master-cabinet-shell,
  .sto-dispatch-page{
    padding-top:14px!important;
    padding-bottom:18px!important;
  }
  .client-cabinet-hero,
  .master-cabinet-hero,
  .sto-dispatch-head{
    padding-top:18px!important;
    padding-bottom:18px!important;
  }
}
