/* HyChat Apex Live Mode: additive; Chat shell, voice and backend are unchanged. */
.hy-live-view-switch {
  display:inline-flex;align-items:center;gap:3px;padding:3px;
  background:color-mix(in oklch,var(--hy-panel) 88%,transparent);
  border:1px solid var(--hy-line);border-radius:13px;flex:none;
}
.hy-live-view-switch button {
  font:600 12px/1.3 inherit;font-size:12px;font-weight:650;
  padding:9px 13px;min-height:36px;border:0;border-radius:9px;
  background:transparent;color:var(--hy-muted);cursor:pointer;white-space:nowrap;
  transition:background .15s ease,color .15s ease,box-shadow .15s ease;
}
.hy-live-view-switch button[aria-selected="true"] {
  background:color-mix(in oklch,var(--hy-cyan) 13%,var(--hy-panel));
  color:var(--hy-text);box-shadow:inset 0 0 0 1px color-mix(in oklch,var(--hy-cyan) 36%,transparent);
}
.hy-live-view-switch button:hover {color:var(--hy-text);}
.hy-live-view-switch button:focus-visible,.hy-live-draw-tools button:focus-visible,
.hy-live-actions button:focus-visible {outline:2px solid var(--hy-cyan);outline-offset:2px;}
#app.hy-cobrowse-active .hy-live-view-switch {position:relative;z-index:2;}
.hy-live-view-switch--stage {margin-inline:auto;}
.hy-live-stage-status {
  display:flex;align-items:center;gap:7px;min-width:0;
  padding:0 14px 6px;color:var(--hy-muted);font-size:11px;
}
.hy-live-stage-status::before {
  content:"";width:6px;height:6px;flex:none;border-radius:50%;
  background:var(--hy-cyan);box-shadow:0 0 11px color-mix(in oklch,var(--hy-cyan) 60%,transparent);
}
.hy-live-controls {
  display:flex;flex-direction:column;gap:5px;padding:9px 12px;
  border-block:1px solid var(--hy-line);
  background:linear-gradient(100deg,color-mix(in oklch,var(--hy-cyan) 5%,var(--hy-panel)),var(--hy-panel));
}
.hy-live-control-row {display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;}
.hy-live-draw-tools,.hy-live-actions {display:flex;gap:5px;align-items:center;flex-wrap:wrap;}
.hy-live-draw-tools button,.hy-live-actions button {
  min-height:36px;padding:6px 10px;background:var(--hy-glass);color:var(--hy-text);
  border:1px solid var(--hy-line);border-radius:9px;
  font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer;
}
.hy-live-draw-tools button:hover,.hy-live-actions button:hover {
  border-color:color-mix(in oklch,var(--hy-cyan) 46%,var(--hy-line));
  background:color-mix(in oklch,var(--hy-cyan) 8%,var(--hy-panel));
}
.hy-live-draw-tools button[aria-pressed="true"] {
  border-color:var(--hy-cyan);background:color-mix(in oklch,var(--hy-cyan) 20%,var(--hy-panel));
}
.hy-live-controls small {
  display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;
  font-size:10px;color:var(--hy-muted);
}
.hy-live-activity {
  display:flex;align-items:center;gap:7px;overflow:hidden;white-space:nowrap;
  color:var(--hy-muted);font-size:10px;
}
.hy-live-activity-entry {
  overflow:hidden;text-overflow:ellipsis;max-width:42%;
  background:color-mix(in oklch,var(--hy-panel) 90%,transparent);
  border-radius:6px;padding:4px 7px;
}
.hy-live-activity-entry[data-phase="error"] {color:var(--hy-red);}
.hy-live-annotation-layer {
  position:absolute;z-index:4;top:0;left:0;overflow:visible;
  pointer-events:none;touch-action:none;
}
.hy-live-annotation-layer.hy-live-drawing {pointer-events:auto;cursor:crosshair;}
.hy-live-stroke {vector-effect:non-scaling-stroke;filter:drop-shadow(0 1px 4px #0007);}
.hy-live-settings-note {
  font-size:11px;color:var(--hy-muted);max-width:310px;
}
.hy-live-settings-row select {
  min-height:42px;max-width:180px;padding:8px 10px;border:1px solid var(--hy-line);
  border-radius:10px;background:var(--hy-panel);color:var(--hy-text);
}
.hy-live-talk-hint {white-space:normal;line-height:1.4;}
@media(max-width:1100px) {
  .hy-live-view-switch--chat {margin-inline:4px;}
  .hy-live-view-switch button {padding:7px 9px;min-height:34px;}
}
@media(max-width:720px) {
  #chat-main .hy-topbar {flex-wrap:wrap;row-gap:5px;}
  .hy-live-view-switch--chat {order:3;margin:0 auto 0 0;}
  .hy-live-view-switch--stage {margin-inline:0;}
  .hy-cobrowse-workspace .hy-cobrowse-head {min-height:62px;flex-wrap:wrap;gap:7px;}
  .hy-cobrowse-workspace .hy-cobrowse-identity {flex:1 1 160px;}
  .hy-cobrowse-workspace .hy-cobrowse-session-actions {margin-left:auto;}
  .hy-live-draw-tools button,.hy-live-actions button {font-size:11px;min-height:35px;padding:5px 8px;}
  .hy-live-stage-status {padding:0 10px 5px;}
  .hy-live-controls {padding:7px 8px;}
  .hy-live-activity-entry {max-width:68%;}
}
@media(max-width:390px) {
  .hy-live-view-switch button {font-size:11px;min-height:32px;padding:6px 8px;}
  .hy-live-actions .hy-live-small-hide {display:none;}
  .hy-cobrowse-workspace #cobrowse-title {font-size:12px;}
}
@media(prefers-reduced-motion:reduce) {
  .hy-live-view-switch button {transition:none;}
  .hy-live-stroke {filter:none;}
}

#app.hy-cobrowse-active #cobrowse-modal {grid-template-rows:auto auto auto auto minmax(0,1fr) auto;}


/* Mobile Live Mode: single visible entry, real browser first, advanced tools on demand. */
.hy-live-mobile-avatar,.hy-live-mobile-header-avatar,.hy-live-mobile-start-actions,
#hy-live-tools-toggle {display:none}
@media (max-width:719px) {
  #app.hy-cobrowse-active #cobrowse-modal {
    height:100dvh;max-height:100dvh;min-height:0;
    grid-template-rows:auto auto auto minmax(0,1fr) auto !important;
    overflow:hidden;
  }
  #app.hy-cobrowse-active .hy-cobrowse-head {
    min-height:58px;max-height:66px;flex-wrap:nowrap;
    padding:8px 12px;gap:8px;
  }
  #app.hy-cobrowse-active .hy-cobrowse-identity {flex:1;min-width:0;gap:9px}
  #app.hy-cobrowse-active .hy-cobrowse-identity .hy-cobrowse-mark {display:none}
  #app.hy-cobrowse-active .hy-live-mobile-header-avatar {
    display:block;width:39px;height:39px;flex:none;border-radius:50%;
    object-fit:cover;border:1px solid var(--hy-cyan);
  }
  #app.hy-cobrowse-active .hy-cobrowse-identity #cobrowse-title {font-size:18px}
  #app.hy-cobrowse-active .hy-live-view-switch--stage {display:none}
  #app.hy-cobrowse-active .hy-cobrowse-session-actions {margin:0;gap:4px}
  #app.hy-cobrowse-active .hy-cobrowse-session-actions .hy-icon-btn,
  #app.hy-cobrowse-active #cobrowse-chat-toggle {width:39px;min-width:39px;height:42px}
  #app.hy-cobrowse-active .hy-cobrowse-controlbar {min-height:40px;padding:3px 12px}
  #app.hy-cobrowse-active #cobrowse-modal:not(.hy-live-mobile-session) .hy-cobrowse-controlbar,
  #app.hy-cobrowse-active #cobrowse-modal:not(.hy-live-mobile-session) .hy-cobrowse-nav,
  #app.hy-cobrowse-active #cobrowse-modal:not(.hy-live-mobile-session) .hy-cobrowse-bottom,
  #app.hy-cobrowse-active #cobrowse-modal:not(.hy-live-mobile-session) #hy-live-tools-toggle,
  #app.hy-cobrowse-active #cobrowse-modal:not(.hy-live-mobile-session) .hy-live-controls {display:none}
  #app.hy-cobrowse-active #cobrowse-modal:not(.hy-live-mobile-session) {
    grid-template-rows:auto auto minmax(0,1fr) !important;
  }
  #app.hy-cobrowse-active .hy-cobrowse-toolbar {min-height:54px;padding:6px 12px}
  #app.hy-cobrowse-active #cobrowse-modal:not(.hy-live-mobile-session) .hy-cobrowse-toolbar {
    grid-template-columns:minmax(0,1fr) auto;padding:7px 13px 12px;
  }
  #app.hy-cobrowse-active #cobrowse-url {min-width:0;width:100%;font-size:16px}
  #app.hy-cobrowse-active #cobrowse-start {
    min-height:44px;padding:8px 13px;font-size:13px;font-weight:750;
  }
  #app.hy-cobrowse-active #cobrowse-modal:not(.hy-live-mobile-session) #cobrowse-start {
    min-width:100px;
  }
  #app.hy-cobrowse-active #cobrowse-modal:not(.hy-live-mobile-session) #cobrowse-start::after {
    content:' →';
  }
  #app.hy-cobrowse-active .hy-cobrowse-frame {min-height:0;overflow:auto}
  #app.hy-cobrowse-active #cobrowse-empty {
    min-height:100%;display:flex;flex-direction:column;align-items:center;
    justify-content:center;text-align:center;gap:13px;padding:22px 18px 40px;
  }
  #app.hy-cobrowse-active #cobrowse-empty[hidden]{display:none}
  #app.hy-cobrowse-active #cobrowse-empty > [data-icon] {display:none}
  #app.hy-cobrowse-active .hy-live-mobile-avatar {
    display:block;width:94px;height:94px;object-fit:cover;border-radius:50%;
    border:2px solid var(--hy-cyan);box-shadow:0 0 26px #35eaff44;
  }
  #app.hy-cobrowse-active #cobrowse-empty h3 {font-size:23px;line-height:1.2;margin:3px 0 0}
  #app.hy-cobrowse-active #cobrowse-empty p {max-width:320px;margin:0;line-height:1.45;font-size:14px}
  #app.hy-cobrowse-active .hy-live-mobile-start-actions {
    display:flex;flex-direction:column;gap:10px;width:min(100%,330px);margin-top:7px;
  }
  #app.hy-cobrowse-active .hy-live-mobile-start-actions button {
    display:block;width:100%;min-height:50px;font-size:16px;font-weight:750;border-radius:14px;
  }
  #app.hy-cobrowse-active #cobrowse-empty small {max-width:280px;line-height:1.45;font-size:11px}
  #app.hy-cobrowse-active #hy-live-tools-toggle {
    display:block;width:100%;min-height:39px;padding:6px 14px;
    border-radius:0;border-inline:0;text-align:left;font-weight:750;
  }
  #app.hy-cobrowse-active #hy-live-tools-toggle::after {content:' ▾';float:right}
  #app.hy-cobrowse-active #cobrowse-modal.hy-live-tools-open #hy-live-tools-toggle::after {content:' ▴'}
  #app.hy-cobrowse-active #cobrowse-modal:not(.hy-live-tools-open) .hy-live-controls {display:none}
  #app.hy-cobrowse-active #cobrowse-modal.hy-live-tools-open .hy-live-controls {
    display:flex;max-height:38dvh;overflow-y:auto;overscroll-behavior:contain;
  }
  #app.hy-cobrowse-active #cobrowse-modal:not(.hy-live-tools-open) {
    grid-template-rows:auto auto auto auto minmax(0,1fr) auto !important;
  }
  #app.hy-cobrowse-active #cobrowse-modal.hy-live-tools-open {
    grid-template-rows:auto auto auto auto minmax(0,1fr) auto !important;
  }
  #app.hy-cobrowse-active #cobrowse-modal.hy-live-tools-open .hy-live-controls {
    position:absolute;z-index:12;left:0;right:0;
    top:var(--hy-live-tools-top,207px);max-height:min(52dvh,390px);
    box-shadow:0 16px 36px #000c;border:1px solid var(--hy-line);
  }
  #app.hy-cobrowse-active #cobrowse-modal.hy-live-tools-open #hy-live-tools-toggle {position:relative;z-index:13}
  #app.hy-cobrowse-active #chat-main {inset:60px 8px 0 !important;max-width:calc(100vw - 16px)}
  #app.hy-cobrowse-active .hy-cobrowse-chat-scrim:not([hidden]) {background:#000a}
}
/* Keep all six settings destinations visible on a phone; scrolling a
   hidden horizontal tab-strip made Debug effectively undiscoverable. */
@media (max-width:719px) {
  #settings-modal .hy-tabs {
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;overflow:visible;padding-bottom:8px;
  }
  #settings-modal .hy-tabs .hy-tab {
    flex:none;min-width:0;width:100%;min-height:44px;
    padding:7px 2px;font-size:11px;white-space:nowrap;
  }
}
@media (max-width:370px) {
  #app.hy-cobrowse-active .hy-live-mobile-header-avatar{width:34px;height:34px}
  #app.hy-cobrowse-active .hy-cobrowse-head{padding-inline:8px;gap:4px}
  #app.hy-cobrowse-active #cobrowse-start {padding-inline:7px;min-width:76px}
}
