/* Explicit phone classification excludes desktop/tablet, including narrow
   desktop windows. Native panels, visibility/roles and composer remain intact. */
@media (max-width:1120px) {
  html.circle-phone-conversation-open,
  html.circle-phone-conversation-open body.circle-phone-conversation-open {
    overflow:hidden!important;
    overscroll-behavior:none;
  }
  html.circle-phone-conversation-open body.circle-phone-conversation-open {
    position:fixed!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) {
    box-sizing:border-box;
    position:fixed!important;
    top:var(--circle-chat-top,0px)!important;
    left:var(--circle-chat-left,0px)!important;
    right:auto!important;
    bottom:auto!important;
    width:var(--circle-chat-width,100vw)!important;
    height:var(--circle-chat-height,100dvh)!important;
    min-height:0!important;
    max-height:none!important;
    max-width:none!important;
    display:grid;
    grid-template-columns:44px minmax(0,1fr);
    grid-template-rows:44px auto minmax(0,1fr);
    gap:0;
    margin:0!important;
    padding:env(safe-area-inset-top,0px) 0 0!important;
    overflow:hidden;
    z-index:80;
    background:var(--workspace-canvas,#08100c);
    color:var(--workspace-ink,#edf8f1);
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) > .circle-workspace-topbar,
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) > .agent-workspace-header,
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) > [data-public-circle-join],
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) > [data-team-invite-tray] {
    display:none!important;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) > .circle-phone-conversation-exit:not([hidden]) {
    grid-column:1;
    grid-row:1;
    display:grid;
    place-items:center;
    box-sizing:border-box;
    width:44px;
    min-width:44px;
    height:44px;
    min-height:44px;
    padding:0;
    border:0;
    border-radius:8px;
    background:transparent;
    color:inherit;
    cursor:pointer;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) > .circle-phone-conversation-exit:focus-visible {
    outline:2px solid var(--workspace-green,#36d996);
    outline-offset:-3px;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) > .agent-workspace-mobile-tabs:not([hidden]) {
    grid-column:2;
    grid-row:1;
    display:flex;
    align-items:stretch;
    min-width:0;
    max-width:100%;
    min-height:44px;
    margin:0;
    padding:0 8px 0 0;
    gap:12px;
    overflow-x:auto;
    overflow-y:hidden;
    overscroll-behavior-x:contain;
    flex-wrap:nowrap;
    scrollbar-width:none;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) > .agent-workspace-mobile-tabs::-webkit-scrollbar { display:none; }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) > .agent-workspace-mobile-tabs > button {
    flex:0 0 auto;
    min-height:44px;
    min-width:44px;
    padding:0 4px;
    white-space:nowrap;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) > .agent-workspace-notice {
    grid-column:1/-1;
    grid-row:2;
    max-height:64px;
    margin:0;
    padding:4px 10px;
    overflow:auto;
    font-size:12px;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) > .agent-workspace-notice:empty { display:none; }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) > .agent-workspace-layout {
    grid-column:1/-1;
    grid-row:3;
    display:block!important;
    box-sizing:border-box;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0;
    padding:0;
    overflow:hidden!important;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-sidebar,
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-rightbar { display:contents!important; }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-conversation.is-mobile-active:not([hidden]) {
    box-sizing:border-box;
    position:relative!important;
    inset:auto!important;
    display:flex!important;
    flex-direction:column;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0;
    border-radius:0;
    transform:none!important;
    overflow:hidden;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-conversation-header {
    flex:0 0 auto;
    min-height:44px;
    padding:6px 10px;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-conversation-header > div:first-child { min-width:0; }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-conversation-header [data-topic-eyebrow] {
    display:block;
    font-size:10px;
    line-height:1.3;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-conversation-header h2 { margin:0; font-size:16px; }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-pinned-bar { flex:0 0 auto; max-height:80px; overflow:auto; }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-messages {
    flex:1 1 0;
    min-height:0;
    max-height:none;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior-y:contain;
    overflow-anchor:none;
    -webkit-overflow-scrolling:touch;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-message-form {
    flex:0 1 auto;
    min-height:0;
    max-height:55%;
    padding:8px 8px max(8px,env(safe-area-inset-bottom,0px));
    overflow-y:auto;
    overscroll-behavior-y:contain;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-message-form textarea[name="body"] {
    min-height:44px;
    font-size:16px;
    line-height:1.4;
    caret-color:#8b5cf6;
  }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-message-form input:not([type="hidden"]),
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-message-form select { font-size:16px; }
  html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus:not([hidden]) .agent-workspace-compose-row > button { min-width:44px; min-height:44px; }
}

/* The existing positive-phone lifecycle owns these markers; desktops never do. */
@media(max-width:1120px) {
 html.circle-phone-conversation-open [data-feed-workspace].circle-phone-conversation-focus[data-circle-phone-panel]:not([data-circle-phone-panel="conversation"]) [data-workspace-panel].is-mobile-active:not([hidden]) {
  box-sizing:border-box; position:relative!important; inset:auto!important;
  display:block!important; width:100%!important; height:100%!important;
  min-height:0!important; max-height:none!important; margin:0;
  overflow:auto!important; overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
  border-radius:0; transform:none!important;
 }
}
