/* KOMBAX R60 · FRONTEND UI STABILIZATION
   Scope: layout, safe areas, responsive overflow, visual consistency and user-facing copy states.
   No navigation hierarchy, backend, Supabase, RPC, Storage, Auth, Hermes or agent logic is changed. */

:root{
  --kx-safe-left:env(safe-area-inset-left,0px);
  --kx-safe-right:env(safe-area-inset-right,0px);
  --kx-mobile-header-height:64px;
  --kx-mobile-tabbar-height:66px;
  --kx-readable-muted:#aeb6c2;
  --muted:#aeb6c2;
}

html,body,#app,.app-shell,.content-shell,.main-view{min-width:0;max-width:100%}
html,body{overflow-x:hidden}
body{min-height:100dvh}
img,video,canvas{max-width:100%}
.main-view>*{min-width:0;max-width:100%}

/* Secondary copy: one readable dark-theme baseline rather than per-screen dim grays. */
.page-kicker,.brand-block small,.sidebar-foot small,td small,.gateway-brand small,
.gateway-path-copy small,.direct-profile-copy p,.gateway-safety-note p,
.kx-explainer-profile p,.kx-explainer-profile small,.kx-explainer-action p,.kx-explainer-action small,
.kx-ecosystem-intro p,.kx-ecosystem-flow small,.kx-ecosystem-note{
  color:var(--kx-readable-muted);
}
.kombax-events-page{--ke-muted:#aeb6c2}
.kombax-showcase-page{--sh-muted:#aeb6c2}

/* A light metric/card inside the global dark shell breaks theme continuity. */
.metric.metric-light{
  background:linear-gradient(145deg,var(--panel-2),var(--panel));
  color:var(--ink);
  border-color:var(--line);
}
.metric.metric-light span,.metric.metric-light small{color:var(--kx-readable-muted)}

/* KOMBAX Migrations in Mi Club: restore the same card language and text separation as its neighbors. */
.kx-migration-banner{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:18px;
  min-width:0;
  max-width:100%;
  margin:18px 0;
  padding:18px 19px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:radial-gradient(circle at 94% 12%,rgba(226,29,45,.11),transparent 30%),linear-gradient(145deg,var(--panel-2),var(--panel));
  box-shadow:0 10px 28px rgba(0,0,0,.13);
}
.kx-migration-banner>div{min-width:0}
.kx-migration-banner span,.kx-migration-banner strong,.kx-migration-banner p{display:block}
.kx-migration-banner span{margin:0 0 6px;color:#ff6574;font-size:8px;font-weight:900;letter-spacing:.14em}
.kx-migration-banner strong{font-size:15px;line-height:1.28;color:var(--ink)}
.kx-migration-banner p{max-width:760px;margin:6px 0 0;color:var(--kx-readable-muted);font-size:11px;line-height:1.55}
.kx-migration-banner .btn{flex:0 0 auto}

/* Horizontal rows: scroll intentionally, never expand the page width. */
.showcase-controls,.showcase-search,.showcase-categories,
.kx-events-toolbar,.kx-events-search,.kx-events-state-tabs,.kx-event-detail-nav{
  min-width:0;
  max-width:100%;
}
.showcase-categories,.kx-events-state-tabs,.kx-event-detail-nav{
  width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  overscroll-behavior-inline:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  scroll-snap-type:x proximity;
  padding-right:30px;
  -webkit-mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 28px),transparent 100%);
  mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 28px),transparent 100%);
}
.showcase-categories::-webkit-scrollbar,.kx-events-state-tabs::-webkit-scrollbar,.kx-event-detail-nav::-webkit-scrollbar{display:none}
.showcase-categories button,.kx-events-state-tabs button,.kx-event-detail-nav>*{flex:0 0 auto;scroll-snap-align:start}
.showcase-search{grid-template-columns:minmax(0,1fr) auto}
.showcase-search input{width:100%;max-width:100%}
.showcase-search button{max-width:100%;white-space:normal}

/* Event-detail management CTA: long text must wrap/fit instead of leaving the viewport. */
.kx-event-manage-shell{max-width:calc(100% - 24px)}
.kx-event-manage-toggle{min-width:0;max-width:100%;white-space:normal}
.kx-event-manage-toggle span{min-width:0;overflow-wrap:anywhere}

/* MAIN EVENT: preserve the 3-column composition but make every child shrinkable. */
.kx-main-battle,.kx-main-battle>*{min-width:0;max-width:100%}
.kx-main-battle-crown{
  min-width:0;
  width:max-content;
  max-width:calc(100% - 24px);
  white-space:normal;
}
.kx-main-battle-crown span,.kx-main-battle-crown b{max-width:100%;text-align:center;overflow-wrap:anywhere}
.kx-main-fighter,.kx-main-fighter>div{min-width:0;max-width:100%}
.kx-main-fighter strong{
  display:block;
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:normal;
  hyphens:auto;
  text-wrap:balance;
}

/* Profile cards: denser selection while preserving touch targets. */
.direct-profile-card{min-height:190px;padding:16px}
.direct-profile-icon{width:58px;height:58px;border-radius:15px}
.direct-profile-icon .feature-icon{width:50px;height:50px}
.direct-profile-copy>span{margin-top:12px}
.direct-profile-copy p{font-size:10.5px;line-height:1.5}
.direct-profile-card footer{padding-top:12px}

/* Review state is visible inside the profile instead of being a badge without context. */
.kx-state.warn,.kx-state.neutral{color:#e4e8ee;border-color:rgba(255,255,255,.14);background:rgba(255,255,255,.045)}
.kx-state.warn{color:#fde68a;border-color:rgba(245,158,11,.28);background:rgba(245,158,11,.08)}
.kx-review-status{
  display:grid;
  gap:3px;
  margin-top:11px;
  padding:11px 12px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:12px;
  background:rgba(255,255,255,.025);
}
.kx-review-status strong{font-size:10px;color:#f2f4f7}
.kx-review-status span{font-size:10px;line-height:1.5;color:var(--kx-readable-muted)}
.kx-review-status.warn{border-color:rgba(245,158,11,.22);background:rgba(245,158,11,.055)}
.kx-review-status.ok{border-color:rgba(34,197,94,.20);background:rgba(34,197,94,.05)}
.kx-review-status.danger{border-color:rgba(239,68,68,.22);background:rgba(239,68,68,.05)}

/* Three-step optional explainer: benefits now live inside step 3. */
.kx-benefit-inline{margin-top:22px;padding:18px;border:1px solid rgba(255,255,255,.08);border-radius:16px;background:rgba(255,255,255,.022)}
.kx-benefit-inline h3{margin-bottom:8px}

@media(max-width:820px){
  body{padding-bottom:0!important}
  .app-shell{min-height:100dvh}
  .content-shell{padding-bottom:0!important}
  .topbar{
    height:calc(var(--kx-mobile-header-height) + var(--uw-safe-top))!important;
    min-height:calc(var(--kx-mobile-header-height) + var(--uw-safe-top));
    padding-top:var(--uw-safe-top)!important;
    padding-right:max(17px,var(--kx-safe-right))!important;
    padding-bottom:0!important;
    padding-left:max(64px,calc(17px + var(--kx-safe-left)))!important;
    box-sizing:border-box;
  }
  .main-view{
    min-width:0;
    padding-bottom:calc(var(--uw-safe-bottom) + 28px)!important;
    scroll-padding-top:calc(var(--kx-mobile-header-height) + var(--uw-safe-top) + 12px);
    scroll-padding-bottom:calc(var(--uw-safe-bottom) + 28px);
  }
  /* R60 mobile navigation simplification: the side menu is the single mobile navigation surface. */
  .bottom-nav{display:none!important}
  .filter-bar{top:calc(var(--kx-mobile-header-height) + var(--uw-safe-top) + 8px)!important}
  .toast{bottom:calc(var(--uw-safe-bottom) + 16px)!important}

  .kx-events-toolbar{grid-template-columns:minmax(0,1fr);align-items:stretch}
  .kx-events-state-tabs{justify-content:flex-start}

  .kx-event-manage-shell{right:12px;max-width:calc(100% - 24px)}
  .kx-event-manage-toggle{max-width:min(190px,calc(100vw - 40px))}

  .kx-migration-banner{grid-template-columns:1fr;gap:14px;padding:16px}
  .kx-migration-banner .btn{width:100%}

  .direct-profile-card{min-height:0;grid-template-columns:54px minmax(0,1fr);padding:13px;gap:0 11px}
  .direct-profile-icon{width:52px;height:52px}
  .direct-profile-icon .feature-icon{width:44px;height:44px}
  .direct-profile-copy>span{margin-top:1px}
  .direct-profile-copy h2{margin:4px 0 5px}
  .direct-profile-card footer{margin-top:10px;padding-top:10px}
}

@media(max-width:620px){
  .showcase-search{grid-template-columns:minmax(0,1fr) auto!important}
  .showcase-search button{min-width:88px}
  .kx-main-battle{grid-template-columns:minmax(0,1fr) 56px minmax(0,1fr)!important;padding-inline:6px!important}
  .kx-main-fighter strong{font-size:clamp(20px,6.6vw,29px)!important;line-height:.98!important}
  .kx-main-battle-crown{padding:7px 10px!important}
  .kx-main-battle-crown span{font-size:7px!important;letter-spacing:.16em!important}
  .kx-main-battle-crown b{font-size:9px!important;letter-spacing:.05em!important}
}

@media(max-width:390px){
  .showcase-search{grid-template-columns:1fr!important}
  .showcase-search button{width:100%}
  .kx-event-manage-toggle{width:auto!important;min-width:38px;max-width:46px;padding-inline:10px!important}
  .kx-event-manage-toggle span{display:none!important}
  .kx-main-battle{grid-template-columns:minmax(0,1fr) 46px minmax(0,1fr)!important}
  .kx-main-fighter strong{font-size:clamp(18px,6.2vw,23px)!important}
  .kx-main-versus>b{font-size:38px!important}
}

/* ========================================================================== */
/* R60 FINAL PILOT · CONVERSATIONS + MANAGEMENT ASSIST                        */
/* One visual chat shell, isolated channels, premium AI identity.             */
/* ========================================================================== */

.kx-conversations-page,.kx-assist-management-home,.kx-migrations-page,.kx-ai-chat-layer{min-width:0;max-width:100%}
.kx-conversation-channels{
  position:relative;
  display:flex;
  align-items:center;
  gap:7px;
  width:100%;
  max-width:100%;
  margin:-4px 0 18px;
  padding:6px;
  overflow-x:auto;
  overscroll-behavior-inline:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  border:1px solid rgba(255,255,255,.09);
  border-radius:16px;
  background:rgba(12,15,19,.88);
  box-shadow:0 12px 30px rgba(0,0,0,.16);
}
.kx-conversation-channels::-webkit-scrollbar{display:none}
.kx-conversation-channels button{
  flex:1 0 auto;
  min-width:92px;
  min-height:40px;
  border:1px solid transparent;
  border-radius:11px;
  padding:8px 13px;
  background:transparent;
  color:var(--kx-readable-muted);
  font-size:10px;
  font-weight:850;
  letter-spacing:.045em;
  transition:background .16s,border-color .16s,color .16s,transform .16s;
}
.kx-conversation-channels button:hover{background:rgba(255,255,255,.045);color:#fff}
.kx-conversation-channels button.active{
  color:#fff;
  border-color:rgba(255,255,255,.12);
  background:linear-gradient(135deg,rgba(255,255,255,.105),rgba(255,255,255,.045));
  box-shadow:0 7px 20px rgba(0,0,0,.18),inset 0 1px rgba(255,255,255,.05);
}
.kx-conversation-channels button[data-kx-conversation-channel="social"].active{box-shadow:inset 0 -2px #e1283a,0 7px 20px rgba(0,0,0,.18)}
.kx-conversation-channels button[data-kx-conversation-channel="showcase"].active{box-shadow:inset 0 -2px #d6a84b,0 7px 20px rgba(0,0,0,.18)}
.kx-conversation-channels button[data-kx-conversation-channel="assist"].active{box-shadow:inset 0 -2px #48cfe8,0 7px 20px rgba(0,0,0,.18)}
.kx-conversation-channels button[data-kx-conversation-channel="migrations"].active{box-shadow:inset 0 -2px #ff4658,0 7px 20px rgba(0,0,0,.18)}

/* Standalone Social/Showcase inbox. Never visually nests under the Social feed. */
.kx-conversations-page{display:grid;gap:0}
.kx-conversations-page .kx-message-filters{margin:0 0 12px;padding:0}
.kx-conversations-page .kombax-contact-list{display:grid;gap:10px}
.kx-conversations-page .kx-message-card{
  border:1px solid rgba(255,255,255,.085);
  border-radius:17px;
  padding:15px;
  background:linear-gradient(145deg,rgba(19,23,28,.94),rgba(10,12,15,.98));
}

/* Approved product imagery for management-oriented modules. */
.kx-ai-product-hero{
  position:relative;
  isolation:isolate;
  min-height:clamp(330px,36vw,510px);
  overflow:hidden;
  margin:0 0 16px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:26px;
  background:#06080b;
  box-shadow:0 25px 70px rgba(0,0,0,.30);
}
.kx-ai-product-hero>img{
  position:absolute;
  inset:0;
  z-index:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  filter:saturate(1.02) contrast(1.02);
}
.kx-ai-product-hero:after{
  content:'';
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  background:linear-gradient(90deg,rgba(5,7,10,.96) 0%,rgba(5,7,10,.82) 28%,rgba(5,7,10,.30) 58%,rgba(5,7,10,.12) 100%),linear-gradient(0deg,rgba(5,7,10,.62),transparent 48%);
}
.kx-ai-product-hero.migrations:after{background:linear-gradient(90deg,rgba(5,7,10,.95) 0%,rgba(5,7,10,.78) 29%,rgba(5,7,10,.28) 62%,rgba(5,7,10,.16) 100%),linear-gradient(0deg,rgba(5,7,10,.68),transparent 52%)}
.kx-ai-product-hero-copy{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  width:min(54%,690px);
  min-height:inherit;
  padding:clamp(24px,4vw,48px);
}
.kx-ai-product-hero-copy>span{color:#70e8fb;font-size:9px;font-weight:950;letter-spacing:.16em}
.kx-ai-product-hero.migrations .kx-ai-product-hero-copy>span{color:#ff6b78}
.kx-ai-product-hero-copy h2{max-width:570px;margin:8px 0 11px;font-size:clamp(30px,4.2vw,56px);line-height:.96;letter-spacing:-.048em}
.kx-ai-product-hero-copy p{max-width:590px;margin:0 0 18px;color:#c4ccd7;font-size:12px;line-height:1.62;text-wrap:pretty}
.kx-ai-product-hero-copy .row-actions{justify-content:flex-start}

.kx-assist-capabilities{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}
.kx-assist-capabilities article{
  min-width:0;
  padding:16px;
  border:1px solid rgba(255,255,255,.085);
  border-radius:16px;
  background:linear-gradient(145deg,rgba(19,23,28,.78),rgba(10,12,15,.88));
}
.kx-assist-capabilities span{font-size:8px;font-weight:950;letter-spacing:.14em;color:#70e8fb}
.kx-assist-capabilities strong{display:block;margin:7px 0 5px;font-size:13px;line-height:1.35}
.kx-assist-capabilities p{margin:0;color:var(--kx-readable-muted);font-size:10.5px;line-height:1.52}

/* Chat layer: visually independent from source module and safe-area aware. */
.kx-ai-chat-layer{display:grid;gap:0}
.kx-ai-chat-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  min-width:0;
  padding:15px 17px;
  margin-bottom:10px;
  border:1px solid rgba(72,207,232,.20);
  border-radius:18px;
  background:radial-gradient(circle at 9% 20%,rgba(72,207,232,.10),transparent 34%),linear-gradient(145deg,#11161b,#090c10);
}
.kx-ai-chat-head.migrations{border-color:rgba(255,70,88,.22);background:radial-gradient(circle at 9% 20%,rgba(255,70,88,.10),transparent 34%),linear-gradient(145deg,#151215,#090c10)}
.kx-ai-chat-identity{display:flex;align-items:center;gap:12px;min-width:0}
.kx-ai-avatar{display:block;width:52px;height:52px;object-fit:cover;object-position:center 22%;border-radius:15px;border:1px solid rgba(255,255,255,.15);background:#0b0e12;box-shadow:0 8px 24px rgba(0,0,0,.28)}
.kx-ai-chat-identity>div{min-width:0}
.kx-ai-chat-identity span{display:block;color:#74e7f8;font-size:8px;font-weight:950;letter-spacing:.15em}
.kx-ai-chat-head.migrations .kx-ai-chat-identity span{color:#ff6978}
.kx-ai-chat-identity h2{margin:4px 0 2px;font-size:18px;line-height:1.1;overflow-wrap:anywhere}
.kx-ai-chat-identity p{margin:0;color:var(--kx-readable-muted);font-size:10px;line-height:1.4}
.kx-ai-chat-head .kx-assist-context{flex:0 1 auto;align-items:flex-end;text-align:right}
.kx-ai-chat-head .kx-assist-context span{font-size:8px;color:var(--kx-readable-muted);overflow-wrap:anywhere}
.kx-ai-chat-head .kx-assist-context b{font-size:10px;color:#f4f7fa;line-height:1.45}

.kx-assist-thread-page{
  min-height:clamp(330px,47vh,620px)!important;
  max-height:min(62vh,680px)!important;
  padding:18px!important;
  scroll-padding-block:16px;
  background:radial-gradient(circle at 10% 2%,rgba(72,207,232,.045),transparent 34%),rgba(4,6,9,.76)!important;
}
.kx-migrations-chat .kx-assist-thread-page{background:radial-gradient(circle at 10% 2%,rgba(255,70,88,.045),transparent 34%),rgba(4,6,9,.76)!important}
.kx-assist-welcome{display:flex;align-items:center;gap:15px;padding:16px!important;background:linear-gradient(135deg,rgba(72,207,232,.09),rgba(255,70,88,.035))!important}
.kx-assist-welcome-avatar{flex:0 0 auto}
.kx-assist-welcome-avatar .kx-ai-avatar{width:70px;height:70px;border-radius:18px}
.kx-assist-welcome>div:last-child{min-width:0}
.kx-assist-bubble{display:flex;gap:9px;align-items:flex-end;padding:0!important;border:0!important;background:transparent!important;max-width:min(88%,760px)!important}
.kx-assist-bubble>div{min-width:0;padding:11px 13px;border:1px solid rgba(255,255,255,.09);border-radius:15px;background:rgba(255,255,255,.055)}
.kx-assist-bubble.user{align-self:flex-end;flex-direction:row-reverse}
.kx-assist-bubble.user>div{background:rgba(64,124,255,.15);border-color:rgba(92,145,255,.25)}
.kx-assist-bubble.assistant{align-self:flex-start}
.kx-bubble-avatar{display:block;flex:0 0 auto;width:30px;height:30px}
.kx-bubble-avatar .kx-ai-avatar{width:30px;height:30px;border-radius:10px}
.kx-assist-bubble p{font-size:12px;line-height:1.58!important}
.kx-assist-bubble time{display:block;margin-top:5px;opacity:.82}

.kx-assist-quick-prompts{display:flex;gap:7px;max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding:2px 0}
.kx-assist-quick-prompts::-webkit-scrollbar{display:none}
.kx-assist-quick-prompts button{flex:0 0 auto;min-height:36px;padding:8px 11px;border:1px solid rgba(72,207,232,.19);border-radius:999px;background:rgba(72,207,232,.055);color:#dce9ee;font-size:9.5px;font-weight:800}
.kx-assist-quick-prompts button:hover{background:rgba(72,207,232,.10)}
.kx-assist-status{min-height:20px;line-height:1.45;color:#bdc6d1!important}
.kx-assist-composer-sticky{
  position:sticky;
  bottom:calc(var(--uw-safe-bottom) + 8px);
  z-index:24;
  padding:9px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  background:rgba(9,12,16,.95);
  backdrop-filter:blur(15px);
  box-shadow:0 -14px 34px rgba(0,0,0,.24);
}
.kx-assist-composer-sticky textarea{min-height:52px!important;max-height:160px;margin:0;background:#090c10}

.kx-ai-support-separation{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 15px;
  border:1px solid rgba(255,255,255,.085);
  border-radius:15px;
  background:rgba(255,255,255,.025);
}
.kx-ai-support-separation>div{min-width:0;flex:1}
.kx-ai-support-separation strong{font-size:11px}
.kx-ai-support-separation p{margin:4px 0 0;color:var(--kx-readable-muted);font-size:9.8px;line-height:1.5}

/* Human/formal support is intentionally separate from AI management. */
.kx-formal-support{gap:14px}
.kx-support-separation-hero{padding:17px;border:1px solid rgba(255,255,255,.09);border-radius:17px;background:linear-gradient(145deg,#12161b,#090c10)}
.kx-support-separation-hero>span{color:#ff7582;font-size:8px;font-weight:950;letter-spacing:.15em}
.kx-support-separation-hero h3{margin:6px 0 6px;font-size:21px}
.kx-support-separation-hero p{margin:0;color:var(--kx-readable-muted);line-height:1.55;font-size:11px}
.kx-support-email-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.kx-support-email-grid a{display:block;min-width:0;padding:13px;border:1px solid rgba(255,255,255,.085);border-radius:14px;background:rgba(255,255,255,.025);text-decoration:none}
.kx-support-email-grid a:hover{border-color:rgba(255,255,255,.16);background:rgba(255,255,255,.045)}
.kx-support-email-grid strong,.kx-support-email-grid span,.kx-support-email-grid small{display:block;overflow-wrap:anywhere}
.kx-support-email-grid strong{font-size:11px}.kx-support-email-grid span{margin:4px 0;color:#e5e9ef;font-size:10px}.kx-support-email-grid small{color:var(--kx-readable-muted);font-size:9px;line-height:1.45}

/* Assist/Migrations cards inside Club/Federation/Brand management hubs. */
.kx-management-assist-banner{
  display:grid;
  grid-template-columns:62px minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  min-width:0;
  margin:18px 0;
  padding:13px 15px;
  border:1px solid rgba(72,207,232,.18);
  border-radius:var(--radius);
  background:radial-gradient(circle at 8% 15%,rgba(72,207,232,.09),transparent 26%),linear-gradient(145deg,var(--panel-2),var(--panel));
}
.kx-management-assist-banner img{width:62px;height:62px;object-fit:cover;object-position:center 22%;border-radius:15px;border:1px solid rgba(255,255,255,.12)}
.kx-management-assist-banner>div{min-width:0}
.kx-management-assist-banner span,.kx-management-assist-banner strong,.kx-management-assist-banner p{display:block}
.kx-management-assist-banner span{color:#70e8fb;font-size:8px;font-weight:950;letter-spacing:.14em}
.kx-management-assist-banner strong{margin-top:4px;font-size:14px}
.kx-management-assist-banner p{margin:4px 0 0;color:var(--kx-readable-muted);font-size:10px;line-height:1.5}

.kx-assist-quota-grid.single article{background:linear-gradient(145deg,rgba(18,22,27,.92),rgba(10,12,15,.96))}
.kx-assist-quota-grid.single strong{font-variant-numeric:tabular-nums}
.kx-assist-quota-grid.single small{color:#b8c1cc}

@media(max-width:900px){
  .kx-ai-product-hero-copy{width:min(65%,620px)}
  .kx-assist-capabilities{grid-template-columns:1fr 1fr}
  .kx-assist-capabilities article:last-child{grid-column:1/-1}
}

@media(max-width:820px){
  .kx-conversation-channels{position:sticky;top:calc(var(--kx-mobile-header-height) + var(--uw-safe-top) + 6px);z-index:62;margin-top:0;background:rgba(9,12,16,.94);backdrop-filter:blur(16px)}
  .kx-ai-product-hero{min-height:540px}
  .kx-ai-product-hero>img{object-position:62% center}
  .kx-ai-product-hero.migrations>img{object-position:60% center}
  .kx-ai-product-hero:after,.kx-ai-product-hero.migrations:after{background:linear-gradient(180deg,rgba(5,7,10,.08) 0%,rgba(5,7,10,.24) 36%,rgba(5,7,10,.87) 66%,#05070a 89%)}
  .kx-ai-product-hero-copy{justify-content:flex-end;width:100%;padding:260px 20px 24px}
  .kx-ai-product-hero-copy h2{font-size:clamp(31px,8.8vw,48px)}
  .kx-ai-chat-head{align-items:flex-start;flex-direction:column}
  .kx-ai-chat-head .kx-assist-context{width:100%;align-items:flex-start;text-align:left;padding-top:9px;border-top:1px solid rgba(255,255,255,.07)}
  .kx-ai-support-separation{align-items:stretch;flex-direction:column}
  .kx-ai-support-separation .btn,.kx-ai-support-separation a.btn{width:100%}
  .kx-management-assist-banner{grid-template-columns:54px minmax(0,1fr)}
  .kx-management-assist-banner img{width:54px;height:54px}
  .kx-management-assist-banner .btn{grid-column:1/-1;width:100%}
  .kx-support-email-grid{grid-template-columns:1fr}
  .kx-assist-thread-page{max-height:none!important;min-height:44dvh!important}
  .kx-assist-composer-sticky{bottom:calc(var(--uw-safe-bottom) + 6px)}
}

@media(max-width:620px){
  .kx-conversation-channels{gap:5px;padding:5px;border-radius:14px;-webkit-mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 22px),transparent 100%);mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 22px),transparent 100%)}
  .kx-conversation-channels button{flex:0 0 auto;min-width:88px;min-height:38px;padding-inline:10px}
  .kx-assist-capabilities{grid-template-columns:1fr}.kx-assist-capabilities article:last-child{grid-column:auto}
  .kx-ai-product-hero{min-height:520px;border-radius:21px}
  .kx-ai-product-hero>img{height:58%;object-position:62% center}
  .kx-ai-product-hero.migrations>img{object-position:58% center}
  .kx-ai-product-hero-copy{min-height:520px;padding:250px 17px 21px}
  .kx-ai-product-hero-copy p{font-size:11px}
  .kx-ai-chat-identity h2{font-size:16px}
  .kx-ai-avatar{width:48px;height:48px}
  .kx-assist-thread-page{padding:12px!important}
  .kx-assist-welcome{align-items:flex-start;flex-direction:column}
  .kx-assist-welcome-avatar .kx-ai-avatar{width:58px;height:58px}
  .kx-assist-bubble{max-width:96%!important}
  .kx-bubble-avatar{width:27px;height:27px}.kx-bubble-avatar .kx-ai-avatar{width:27px;height:27px}
  .kx-assist-bubble>div{padding:10px 11px}.kx-assist-bubble p{font-size:11.5px}
  .kx-assist-composer-sticky{grid-template-columns:minmax(0,1fr) auto!important;align-items:center;padding:7px}
  .kx-assist-composer-sticky textarea{min-height:46px!important;resize:none}
  .kx-assist-composer-sticky .btn{width:auto!important;min-height:46px;padding-inline:14px}
}

/* Approved chat empty-state artwork: visible only before the first message. */
.kx-assist-welcome-visual{display:grid!important;grid-template-columns:110px minmax(0,1fr);align-items:center!important;padding:12px!important;overflow:hidden}
.kx-ai-empty-image{display:block;width:110px;height:138px;object-fit:cover;object-position:50% 22%;border-radius:14px;border:1px solid rgba(255,255,255,.11);background:#07090c}
.kx-assist-welcome-visual.migrations{border-color:rgba(255,70,88,.18)!important}
@media(max-width:620px){.kx-assist-welcome-visual{grid-template-columns:78px minmax(0,1fr)!important;align-items:center!important}.kx-ai-empty-image{width:78px;height:98px;border-radius:12px}}

/* R60 pilot final · Formal Support is a fifth conversation line, intentionally distinct from management AI. */
.kx-support-page{display:grid;gap:14px;min-width:0}
.kx-support-main-hero{
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(250px,.75fr);
  gap:14px;
  padding:clamp(20px,3.2vw,36px);
  border:1px solid rgba(150,172,196,.18);
  border-radius:24px;
  background:radial-gradient(circle at 8% 18%,rgba(123,151,181,.12),transparent 34%),linear-gradient(145deg,#11161c,#080b0f 76%);
  box-shadow:0 22px 60px rgba(0,0,0,.26);
}
.kx-support-main-copy{min-width:0;align-self:center}
.kx-support-main-copy>span,.kx-support-chat-locked span{display:block;color:#aebfd0;font-size:8px;font-weight:950;letter-spacing:.16em}
.kx-support-main-copy h2{max-width:720px;margin:8px 0 10px;font-size:clamp(28px,4vw,50px);line-height:.98;letter-spacing:-.045em;text-wrap:balance}
.kx-support-main-copy p{max-width:720px;margin:0 0 18px;color:var(--kx-readable-muted);font-size:11.5px;line-height:1.62;text-wrap:pretty}
.kx-support-trust{
  display:flex;flex-direction:column;align-items:flex-start;justify-content:center;min-width:0;padding:18px;
  border:1px solid rgba(160,183,207,.16);border-radius:18px;background:rgba(155,179,204,.055)
}
.kx-support-trust strong{margin:12px 0 5px;font-size:14px}.kx-support-trust p{margin:0;color:var(--kx-readable-muted);font-size:10px;line-height:1.55}
.kx-support-mark{display:grid;place-items:center;width:30px;height:30px;border:1px solid rgba(174,196,219,.32);border-radius:10px;background:rgba(147,174,201,.10);color:#d9e4ee;font-weight:950;box-shadow:0 7px 20px rgba(0,0,0,.2)}
.kx-support-mark.large{width:54px;height:54px;border-radius:16px;font-size:22px;flex:0 0 auto}
.kx-bubble-avatar .kx-support-mark{width:30px;height:30px;border-radius:10px}
.kx-support-page-channels{margin:0}
.kx-support-cases{min-width:0}
.kx-support-guided-explainer{display:flex;align-items:flex-start;gap:12px;margin:0 0 12px;padding:12px 13px;border:1px solid rgba(160,183,207,.13);border-radius:14px;background:rgba(160,183,207,.035)}
.kx-support-guided-explainer strong{flex:0 0 auto;font-size:10px}.kx-support-guided-explainer p{margin:0;color:var(--kx-readable-muted);font-size:9.8px;line-height:1.5}
.kx-ticket-row.support-ticket{border-color:rgba(160,183,207,.10)}
.kx-ticket-row.support-ticket:hover{border-color:rgba(160,183,207,.20)}
.kx-ai-chat-head.support{border-color:rgba(160,183,207,.22);background:radial-gradient(circle at 9% 20%,rgba(160,183,207,.095),transparent 34%),linear-gradient(145deg,#11171d,#090c10)}
.kx-ai-chat-head.support .kx-ai-chat-identity span{color:#afc1d3}
.kx-ai-chat-head .kx-assist-context small{display:block;margin-top:3px;color:var(--kx-readable-muted);font-size:8.5px;line-height:1.4}
.kx-assist-thread-page.support{background:radial-gradient(circle at 10% 2%,rgba(160,183,207,.04),transparent 34%),rgba(4,6,9,.78)!important}
.kx-assist-bubble.support.assistant>div{border-color:rgba(160,183,207,.13);background:rgba(160,183,207,.055)}
.kx-assist-bubble.support.assistant small{color:#c7d5e2}
.kx-support-chat-empty{display:flex;align-items:center;gap:14px;padding:16px;border:1px solid rgba(160,183,207,.14);border-radius:16px;background:rgba(160,183,207,.04)}
.kx-support-chat-empty>div:last-child{min-width:0}.kx-support-chat-empty strong{font-size:12px}.kx-support-chat-empty p{margin:5px 0 0;color:var(--kx-readable-muted);font-size:10.5px;line-height:1.55}
.kx-support-chat-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.kx-support-chat-locked{
  display:flex;align-items:flex-start;gap:18px;max-width:900px;margin:18px auto;padding:clamp(20px,4vw,38px);
  border:1px solid rgba(160,183,207,.18);border-radius:22px;background:radial-gradient(circle at 10% 15%,rgba(160,183,207,.09),transparent 36%),linear-gradient(145deg,#11161c,#080b0f)
}
.kx-support-chat-locked>div:last-child{min-width:0}.kx-support-chat-locked h2{margin:7px 0 8px;font-size:clamp(24px,3.6vw,40px);line-height:1.02}.kx-support-chat-locked p{margin:0 0 18px;color:var(--kx-readable-muted);font-size:11px;line-height:1.62}
.kx-migration-guide .kx-guide-split{grid-template-columns:repeat(3,minmax(0,1fr))}

@media(max-width:900px){
  .kx-support-main-hero{grid-template-columns:1fr}.kx-support-trust{min-height:0}
}
@media(max-width:760px){
  .kx-migration-guide .kx-guide-split{grid-template-columns:1fr}
  .kx-support-main-hero{padding:20px;border-radius:20px}
  .kx-support-guided-explainer{flex-direction:column}
  .kx-support-chat-locked{margin:12px 0;flex-direction:column;gap:13px}
  .kx-support-chat-actions{flex-direction:column}.kx-support-chat-actions .btn,.kx-support-chat-actions a.btn{width:100%}
}
@media(max-width:520px){
  .kx-support-main-copy h2{font-size:30px}
  .kx-support-mark.large{width:48px;height:48px;border-radius:14px;font-size:19px}
  .kx-support-main-hero{padding:17px}
}

/* R60 PILOT FINAL · conversational assistant avatar only */
.kx-assist-welcome-avatar{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:16px;min-height:132px;padding:18px}
.kx-assist-welcome-avatar-shell{display:grid;place-items:center;width:78px;height:78px;border-radius:24px;overflow:hidden;background:radial-gradient(circle at 50% 30%,rgba(73,225,255,.15),rgba(7,9,12,.98) 72%);border:1px solid rgba(85,225,255,.2);box-shadow:0 14px 34px rgba(0,0,0,.28)}
.kx-assist-welcome-avatar-shell .kx-ai-avatar{width:100%;height:100%;border:0;border-radius:0;object-fit:cover;object-position:50% 22%}
@media(max-width:620px){.kx-assist-welcome-avatar{grid-template-columns:64px minmax(0,1fr);gap:13px;padding:15px}.kx-assist-welcome-avatar-shell{width:64px;height:64px;border-radius:19px}}


/* R60 PILOT · SUBVIEW NAVIGATION CONTRACT
   Full-page layers keep an explicit way back plus an explicit close/exit affordance. */
.kx-subview-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;max-width:100%}
.kx-subview-actions .kx-subview-back{display:inline-flex;align-items:center;gap:7px;white-space:nowrap}
.kx-subview-actions .kx-subview-close{flex:0 0 42px;width:42px;height:42px;border-radius:14px}
.kx-ai-chat-layer .page-head,.kx-conversations-page .page-head{align-items:flex-start;gap:14px}
@media(max-width:620px){
  .kx-ai-chat-layer .page-head,.kx-conversations-page .page-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px}
  .kx-ai-chat-layer .page-head>div:first-child,.kx-conversations-page .page-head>div:first-child{min-width:0}
  .kx-subview-actions{gap:6px}
  .kx-subview-actions .kx-subview-back{min-height:40px;padding:8px 11px;font-size:12px}
  .kx-subview-actions .kx-subview-close{width:40px;height:40px;flex-basis:40px}
}

/* R60 PILOT FINAL · SUBVIEW NAVIGATION */
.modal-head-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}.modal-back{display:inline-flex;align-items:center;gap:5px}.kx-subview-actions{display:flex;align-items:center;gap:8px}.kx-subview-back{display:inline-flex;align-items:center;gap:5px}.kx-subview-close{flex:0 0 auto}@media(max-width:620px){.modal-head{align-items:flex-start;gap:10px}.modal-head-actions{gap:6px}.modal-back span{display:none}.modal-back{width:42px;min-width:42px;padding:0;justify-content:center}.kx-subview-actions{width:100%;justify-content:flex-end}.kx-subview-back{margin-right:auto}}

/* R60 pilot final · navegación de retorno/cierre consistente */
.kx-auto-subview-close{
  flex:0 0 42px;
  width:42px;
  height:42px;
  margin-left:auto;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(10,12,16,.86);
  color:#fff;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.kx-auto-subview-close:hover,.kx-auto-subview-close:focus-visible{border-color:rgba(255,38,66,.5);background:rgba(201,0,27,.12)}
.kx-managed-top .kx-auto-subview-close,.kx-fed-top .kx-auto-subview-close,.kx-prep-hero .kx-auto-subview-close{margin-left:auto}
@media(max-width:620px){
  .kx-auto-subview-close{width:40px;height:40px;flex-basis:40px}
  .kx-prep-hero .kx-auto-subview-close{position:absolute;top:12px;right:12px}
  .kx-prep-hero{position:relative;padding-top:62px!important}
}

/* R64.1 · KOMBAX Assist specialities */
.kx-assist-specialists-wrap{display:grid;gap:12px}.kx-assist-specialists{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.kx-assist-specialist{display:grid;align-content:start;gap:7px;min-height:184px;padding:16px;border:1px solid rgba(255,255,255,.09);border-radius:16px;background:linear-gradient(145deg,rgba(255,255,255,.045),rgba(255,255,255,.018))}.kx-assist-specialist>span{color:#ff5a67;font-size:9px;font-weight:900;letter-spacing:.12em}.kx-assist-specialist>strong{font-size:15px;line-height:1.25}.kx-assist-specialist>p{min-height:44px;margin:0;color:var(--muted,#aeb1bd);font-size:10px;line-height:1.5}.kx-assist-specialist>.btn{align-self:end;width:100%;margin-top:auto}.kx-assist-specialist:has([data-kx-assist-specialist="stripe"]){border-color:rgba(99,235,247,.28);background:linear-gradient(145deg,rgba(43,198,218,.075),rgba(255,255,255,.018))}.kx-assist-specialist:has([data-kx-assist-specialist="stripe"])>span{color:#63ebf7}
@media(max-width:1000px){.kx-assist-specialists{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:580px){.kx-assist-specialists{grid-template-columns:1fr}.kx-assist-specialist{min-height:0}.kx-assist-specialist>p{min-height:0}}
