/* v171: scoped chat presentation; shared routing and account policies stay intact. */
body.chat-route .chat-reference-layout .chat-upgrade {
 display:flex!important;align-items:center;justify-content:center;gap:6px;
 border:1px solid #c8d9ff;border-radius:18px;padding:5px 10px;
 background:linear-gradient(135deg,#eaf2ff,#f7eeff,#edf6ff);
 color:#3f5895;font-size:12px!important;line-height:1.6;white-space:nowrap;
 box-shadow:0 2px 5px #26385b10;text-decoration:none;
}
body.chat-route .chat-reference-layout .chat-upgrade .ui-icon {color:#2177e9;width:16px;height:16px;flex:none}
body.chat-route .chat-reference-layout .chat-upgrade bdi {font-weight:inherit}
body.chat-route .chat-reference-layout .chat-primary-nav>.chat-prompt-library {display:flex;align-items:center;gap:12px;direction:ltr;width:100%;box-sizing:border-box;min-height:40px;padding:10px 14px;border-radius:10px;color:#263a56;font-size:14px;text-decoration:none}
body.chat-route .chat-reference-layout .chat-prompt-library span {direction:rtl}
body.chat-route .chat-reference-layout .chat-prompt-library:hover {background:#e9f0ff;color:#2456b6}
body.chat-route .chat-reference-layout #tool-analysis {display:none!important}
body.chat-route .chat-reference-layout #chat-plus-menu {direction:ltr!important;text-align:left;font-family:Arial,sans-serif}
body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item {
 position:relative;box-sizing:border-box;display:block!important;width:100%!important;
 border:0;margin:0!important;padding:0!important;background:transparent;text-align:left;
 font-family:inherit;cursor:pointer;border-radius:12px;
}
body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item>span {
 display:flex!important;position:relative;width:100%;box-sizing:border-box;
 align-items:center;gap:12px;min-height:38px!important;padding:8px 12px!important;
 border-radius:12px!important;color:#222!important;background:transparent!important;
}
body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item b {font:400 14px/1.4 Arial,sans-serif!important;flex:none}
body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item small {font:400 14px/1.4 Arial,sans-serif!important;color:#8b8b8b!important;white-space:nowrap}
body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item .ui-icon {width:19px!important;height:19px!important;flex:none;color:#888}
body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item:nth-child(3) .ui-icon,
body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item:nth-child(4) .ui-icon {color:#18c5ed}
body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item:hover>span {background:#f1f1f1!important}
body.chat-route .chat-reference-layout #chat-plus-menu input:checked+span {background:#eef5ff!important}
body.chat-route .chat-reference-layout #chat-plus-menu input[type=checkbox]+span::after {display:none!important;content:none!important}
body.chat-route .chat-reference-layout #chat-plus-menu [aria-checked=true]>span::after {content:'✓'!important;display:block!important;position:static!important;transform:none!important;border:0!important;background:none!important;color:#2177e9;margin-left:auto!important;width:auto!important;height:auto!important}
body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item:focus-within>span,
body.chat-route .chat-reference-layout #chat-plus-menu button:focus-visible>span {outline:2px solid #2177e9;outline-offset:-2px}
body.chat-route .chat-reference-layout #chat-plus-menu .detail-access-closed {opacity:.45;cursor:not-allowed}
body.chat-route .chat-reference-layout #chat-plus-menu .detail-access-closed::after {display:none}
.chat-library171 #chat-library-list171 {display:grid;gap:8px;margin-top:16px;max-height:50dvh;overflow:auto}
.chat-library171 #chat-library-list171 button {display:flex;align-items:center;gap:10px;min-height:48px;text-align:start;border:1px solid #dfe6f0;border-radius:12px;padding:10px;background:transparent;color:inherit;font:inherit;cursor:pointer}
.chat-library171 #chat-library-list171 button span {flex:1;overflow-wrap:anywhere}
@media(min-width:901px) {
 body.chat-route .chat-reference-layout .chat-compose-row {position:relative}
 body.chat-route .chat-reference-layout .chat-plus-wrap {position:static}
 body.chat-route .chat-reference-layout #chat-plus-menu {
  width:100%!important;max-width:100%!important;bottom:calc(100% + 15px);left:0;right:auto;
  padding:7px!important;border:1px solid #e4e4e4;border-radius:23px!important;
  box-shadow:0 6px 24px #15213b0d!important;
 }
 body.chat-route .chat-reference-layout #chat-plus-menu .plus-mobile171 {display:none!important}
}
@media(max-width:900px) {
 body.chat-route .chat-reference-layout .chat-workspace-header {flex-direction:row-reverse}
 body.chat-route .chat-reference-layout .chat-header-title {direction:rtl}
 body.chat-route .chat-reference-layout .chat-header-actions {order:2;flex:none!important;gap:2px!important}
 body.chat-route .chat-reference-layout .chat-upgrade {font-size:10px!important;padding:5px 9px;gap:5px;min-height:30px;box-sizing:border-box}
 body.chat-route .chat-reference-layout .chat-upgrade .ui-icon {width:15px;height:15px}
 body.chat-route .chat-reference-layout .chat-header-title {min-width:0!important;flex:1}
 body.chat-route .chat-reference-layout .chat-current-title {min-width:0!important;width:0;flex:1}
 body.chat-route .chat-reference-layout #chat-plus-menu {
  width:278px!important;max-width:calc(100vw - 32px)!important;
  padding:12px 14px!important;border:0;border-radius:28px!important;
  bottom:calc(100% + 12px);left:0;right:auto;box-shadow:0 10px 32px #15213b24!important;
 }
 body.chat-route .chat-reference-layout #chat-plus-menu .plus-desktop171 {display:none!important}
 body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item>span {min-height:62px!important;padding:9px 8px!important;gap:14px}
 body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item b {font-size:17px!important}
 body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item .ui-icon {box-sizing:content-box;width:24px!important;height:24px!important;padding:10px;background:#ededed;border-radius:50%;color:#122039}
 body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item small {display:none}
}
@media(min-width:901px) and (max-width:1100px) {
 body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item>span {gap:8px;padding-inline:9px!important}
 body.chat-route .chat-reference-layout #chat-plus-menu .chat-plus-item small {font-size:12px!important}
}

/* v172: only the mobile header/message controls change layout. */
.chat-reference-layout .mobile-history-search172 {display:none!important}
@media(max-width:900px) {
 body.chat-route .chat-reference-layout .chat-account-menu .mobile-history-search172 {display:flex!important}
 body.chat-route .chat-reference-layout .message.assistant .message-tools172 {display:flex;flex-wrap:wrap;direction:ltr;align-items:center;gap:2px;margin-top:8px}
 body.chat-route .chat-reference-layout .message.assistant .message-tools172 .message-actions,
 body.chat-route .chat-reference-layout .message.assistant .message-tools172 .message-feedback {display:contents!important}
 body.chat-route .chat-reference-layout .message.assistant .message-tools172 .feedback-btn {display:inline-flex;align-items:center;justify-content:center;width:40px!important;height:40px!important;min-height:40px!important;padding:9px!important;border:0;border-radius:10px;margin:0!important}
 body.chat-route .chat-reference-layout .message.assistant .message-tools172 .feedback-btn .ui-icon {width:18px;height:18px}

 body.chat-route .chat-reference-layout .chat-workspace-header {
  display:grid!important;grid-template-columns:44px minmax(0,1fr) 44px;
  grid-template-rows:44px;direction:ltr;align-items:center;gap:4px!important;
  height:58px!important;min-height:58px!important;padding:7px 10px!important;
 }
 body.chat-route .chat-reference-layout .chat-header-title,
 body.chat-route .chat-reference-layout .chat-header-actions {display:contents!important}
 body.chat-route .chat-reference-layout .chat-current-title,
 body.chat-route .chat-reference-layout .chat-title-edit,
 body.chat-route .chat-reference-layout .chat-more-wrap,
 body.chat-route .chat-reference-layout .chat-header-divider,
 body.chat-route .chat-reference-layout .chat-profile-avatar,
 body.chat-route .chat-reference-layout .chat-header-actions>[data-workspace-panel=notifications] {display:none!important}
 body.chat-route .chat-reference-layout #chat-history-toggle {display:grid!important;grid-column:1;grid-row:1;justify-self:start;width:44px!important;height:44px!important}
 body.chat-route .chat-reference-layout .chat-upgrade {grid-column:2;grid-row:1;justify-self:center;direction:rtl;font-size:12px!important;padding:5px 12px;min-height:32px;max-width:100%;box-sizing:border-box}
 body.chat-route .chat-reference-layout #chat-message-search-toggle {display:grid!important;grid-column:3;grid-row:1;justify-self:end;width:44px!important;height:44px!important}
 body.chat-route .chat-reference-layout .message.assistant .message-actions {display:flex;flex-direction:row;direction:ltr;justify-content:flex-start;align-items:center;gap:2px!important;flex-wrap:wrap}
 body.chat-route .chat-reference-layout .message.assistant .message-actions button {
  display:inline-flex;align-items:center;justify-content:center;flex:none;
  width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;
  padding:9px!important;margin:0!important;border:0;border-radius:10px;font-size:0!important;
 }
 body.chat-route .chat-reference-layout .message.assistant .message-actions button span {display:none!important}
 body.chat-route .chat-reference-layout .message.assistant .message-actions button .ui-icon {display:block;width:18px!important;height:18px!important;margin:0!important;flex:none}
 body.chat-route .chat-reference-layout .message.user .message-actions {display:none!important}
 body.chat-route .chat-reference-layout .message.user .message-body {-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;touch-action:pan-y}
 body.chat-route .chat-reference-layout .message.user .message-body:focus-visible {outline:2px solid #2177e9;outline-offset:4px;border-radius:12px}
 #modal.user-actions-dialog172 {width:min(340px,calc(100vw - 32px));max-height:70dvh;box-sizing:border-box;border-radius:22px;padding:20px}
 #modal.user-actions-dialog172 #modal-title {font-size:17px;margin:0 0 12px}
 #modal.user-actions-dialog172 .user-actions-list172 {display:grid;gap:4px}
 #modal.user-actions-dialog172 .user-actions-list172 button {display:flex;align-items:center;gap:12px;text-align:right;width:100%;padding:12px;min-height:48px;border:0;border-radius:12px;background:transparent;color:inherit;font:inherit;cursor:pointer}
 #modal.user-actions-dialog172 .user-actions-list172 button:hover {background:#edf3fc}
 #modal.user-actions-dialog172 .user-actions-list172 button:disabled {opacity:.45;cursor:not-allowed}
 #modal.user-actions-dialog172 .user-actions-list172 .ui-icon {width:20px;height:20px;flex:none}
}

/* v173: real flex toolbars, explicit reply/share and whole-bubble gestures. */
body.chat-route .chat-reference-layout .chat-history-heading .chat-history-search173 {
 display:inline-flex!important;align-items:center;justify-content:center;flex:none;
 width:34px;min-width:34px;height:34px;min-height:34px;border:0;border-radius:9px;
 padding:7px;background:transparent;color:#435a79;cursor:pointer;
}
body.chat-route .chat-reference-layout .chat-history-search173 .ui-icon {width:18px;height:18px}
body.chat-route .chat-reference-layout .chat-history-search173:hover,
body.chat-route .chat-reference-layout .chat-history-search173[aria-expanded=true] {background:#e9f0ff;color:#175cd3}
body.chat-route .chat-reference-layout .message.assistant .message-actions [data-reply-message],
body.chat-route .chat-reference-layout .message.assistant .message-actions [data-detail-share] {display:inline-flex!important;visibility:visible!important;opacity:1!important;align-items:center;justify-content:center}
body.chat-route .chat-reference-layout .message.assistant .message-actions .ui-icon {display:block;flex:none}
body.chat-route .chat-reference-layout .message.user .message-content {-webkit-touch-callout:none;touch-action:pan-y}
@media(max-width:900px) {
 body.chat-route .chat-reference-layout .message.user .message-content {-webkit-user-select:none;user-select:none}
 body.chat-route .chat-reference-layout .message.assistant .message-tools172 {display:flex!important;flex-wrap:wrap;align-items:center;direction:ltr;gap:2px;margin-top:8px}
 body.chat-route .chat-reference-layout .message.assistant .message-tools172 .message-actions,
 body.chat-route .chat-reference-layout .message.assistant .message-tools172 .message-feedback {display:flex!important;flex:none;flex-wrap:wrap;align-items:center;direction:ltr;gap:2px!important;margin:0!important;max-width:100%}
 body.chat-route .chat-reference-layout .message.assistant .message-tools172 .message-actions {opacity:1}
 body.chat-route .chat-reference-layout .message.assistant .message-actions button {color:#3e5575!important}
}
#modal.user-actions-dialog172 {width:min(340px,calc(100vw - 32px));max-height:70dvh;box-sizing:border-box;border-radius:22px;padding:20px}
#modal.user-actions-dialog172 #modal-title {font-size:17px;margin:0 0 12px}
#modal.user-actions-dialog172 .user-actions-list172 {display:grid;gap:4px}
#modal.user-actions-dialog172 .user-actions-list172 button {display:flex;align-items:center;gap:12px;text-align:right;width:100%;padding:12px;min-height:48px;border:0;border-radius:12px;background:transparent;color:inherit;font:inherit;cursor:pointer}
#modal.user-actions-dialog172 .user-actions-list172 button:hover {background:#edf3fc}
#modal.user-actions-dialog172 .user-actions-list172 button:disabled {opacity:.45;cursor:not-allowed}
#modal.user-actions-dialog172 .user-actions-list172 .ui-icon {width:20px;height:20px;flex:none}

/* v174: keep the existing heading and subtitle typography; adapt their content. */
body.chat-route .chat-reference-layout .chat-welcome .welcome-mobile174 {display:none}
body.chat-route .chat-reference-layout .chat-welcome .welcome-desktop174 {display:block}
body.chat-route .chat-reference-layout .chat-welcome h1>span {font:inherit;color:inherit;line-height:inherit}
@media(max-width:900px) {
 body.chat-route .chat-reference-layout .chat-welcome .welcome-desktop174 {display:none}
 body.chat-route .chat-reference-layout .chat-welcome .welcome-mobile174 {display:inline}
}

/* 111: Admin-only Chat / Work mode switch; no public layout selectors. */
body.chat-route .chat-reference-layout .chat-admin-modes111 {
 display:flex;flex:0 0 auto;flex-direction:column;align-items:center;gap:5px;
 padding:6px 12px 9px;box-sizing:border-box;min-width:0;
}
body.chat-route .chat-reference-layout .chat-admin-mode-tabs111 {
 display:flex;align-items:center;gap:3px;padding:3px;background:#f1f3f6;
 border:1px solid #e2e6eb;border-radius:12px;
}
body.chat-route .chat-reference-layout .chat-admin-mode-tabs111 button {
 display:inline-flex;align-items:center;justify-content:center;gap:7px;
 min-width:91px;min-height:36px;padding:6px 13px;border:1px solid transparent;
 border-radius:9px;background:transparent;color:#526174;
 font-family:inherit;font-size:14px;font-weight:600;line-height:1.3;cursor:pointer;
}
body.chat-route .chat-reference-layout .chat-admin-mode-tabs111 button .ui-icon {width:17px;height:17px;flex:none}
body.chat-route .chat-reference-layout .chat-admin-mode-tabs111 button[aria-pressed=true] {
 background:#fff;color:#183b65;border-color:#dce2e9;box-shadow:0 1px 3px #1a304012;
}
body.chat-route .chat-reference-layout .chat-admin-mode-tabs111 button:not(:disabled):hover {color:#1565c0;background:#fff}
body.chat-route .chat-reference-layout .chat-admin-mode-tabs111 button:focus-visible {outline:2px solid #3874cf;outline-offset:1px}
body.chat-route .chat-reference-layout .chat-admin-mode-tabs111 button:disabled {cursor:not-allowed;opacity:.65}
@media(max-width:900px){
 body.chat-route .chat-reference-layout .chat-admin-modes111 {padding:3px 10px 6px;gap:4px}
 body.chat-route .chat-reference-layout .chat-admin-mode-tabs111 button {min-height:40px}
}
@media(max-width:900px) and (max-height:520px){
 body.chat-route .chat-reference-layout .chat-admin-modes111 {padding-block:2px;gap:2px}
 body.chat-route .chat-reference-layout .chat-admin-mode-tabs111 button {min-height:32px}
}

/* 112: use the existing media bar for the admin's three tabs. */
.chat-workspace .mh6-admin-modebar112 .chat-admin-modes111 {align-items:flex-start;padding:0;gap:5px}
.chat-workspace .mh6-admin-modebar112 .chat-admin-mode-tabs111 {max-width:100%;flex-wrap:wrap;direction:rtl;flex-direction:row}
.chat-workspace .mh6-admin-modebar112 .chat-admin-mode-tabs111 button {min-width:0;white-space:nowrap}
.chat-workspace .mh6-admin-modebar112 .chat-admin-mode-tabs111 button[data-chat-admin-architecture] {direction:ltr}
body.chat-route .chat-reference-layout .chat-welcome #chat-admin-mode-description {text-align:center;max-width:100%;overflow-wrap:anywhere}
body.chat-route .chat-reference-layout #chat-admin-mode-description[hidden] {display:none!important}
@media(max-width:900px){.chat-workspace .mh6-admin-modebar112 .chat-admin-mode-tabs111 {width:100%}.chat-workspace .mh6-admin-modebar112 .chat-admin-mode-tabs111 button {flex:1 1 auto;padding-inline:8px}}
