/* Public playground: its own frame, no connection to the operator workspace. */
html { height: 100%; }
body { margin: 0; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #426d53; outline-offset: 3px; }
[hidden] { display: none !important; }
.demo-bar { flex-shrink: 0; display: flex; align-items: center; gap: 25px; padding: 14px 24px; background: #17241e; color: #f5f7ec; z-index: 20; }
.demo-back { flex-shrink: 0; color: inherit; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-decoration: none; }
.demo-back span { color: #bdcaaa; font-size: 10px; }
.demo-disclosure { display: grid; gap: 3px; font-size: 11px; line-height: 1.5; color: #bfccb9; }
.demo-disclosure strong { color: #f6f8ee; font-size: 13px; font-weight: 600; }
.demo-actions { display: flex; gap: 8px; margin-left: auto; flex-shrink: 0; }
.demo-actions a, .demo-actions button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 7px; font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
.demo-actions button { color: #e1e9d7; background: transparent; border: 1px solid #53624c; }
.demo-actions a { color: #17241e; background: #deefb4; border: 1px solid #deefb4; font-weight: 600; }
.demo-actions :focus-visible, .demo-back:focus-visible { outline-color: #e1efb4; }
.app-shell { height: auto; min-height: 0; flex: 1; }
.demo-loading, .demo-fallback { margin: auto; max-width: 640px; padding: 24px; font-size: 16px; line-height: 1.7; }
.demo-loading:has(+ noscript) { margin-top: 20px; }
.row-top strong { font-size: 13px; }
.row-preview { font-size: 12px; color: #62715b; }
.message-text { font-size: 14px; line-height: 1.65; }
.message-time, .composer-hint { color: #596c4c; }
.composer textarea { font-size: 14px; }
.topbar { display: none; }
.page-heading { height: auto; min-height: 90px; padding: 16px 24px; }
.page-heading .eyebrow { display: none; }
.work-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 0; margin-bottom: 12px; overflow: visible; }
.sidebar { scrollbar-width: thin; }
.work-item { min-width: 0; }
.demo-card p { font-size: 11px; }
.inbox-layout { position: relative; }
.profile-pane.visible { top: 0; right: 0; bottom: 0; }
.profile-data, .profile-select { font-size: 12px; color: #4a5e3d; }
.search-box input { font-size: 12px; }
.list-tabs button { min-height: 36px; }
.chat-header .icon-button { min-width: 32px; min-height: 36px; }
.channel-card { display: block; }
.channel-card p { font-size: 14px; line-height: 1.65; }
.channel-card h2 { margin: 18px 0 8px; }
.setup-note p { max-width: 760px; line-height: 1.7; }
.setup-note .button { margin-top: 10px; text-decoration: none; }
.reset-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; }
#reset-dialog p { font-size: 15px; line-height: 1.6; color: #53634b; }
.toast { bottom: 22px; z-index: 100; }
dialog { max-width: min(480px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); overflow: auto; }
dialog input, dialog textarea { font-size: 16px; }
@media (max-height: 850px) and (min-width: 641px) { .demo-card { display: none; } .brand { padding-top: 20px; padding-bottom: 20px; } .workspace { margin-bottom: 22px; } }
@media (max-width: 1100px) {
  .demo-bar { gap: 16px; padding: 12px 18px; }
  .demo-disclosure span { max-width: 320px; }
}
@media (max-width: 850px) and (min-width: 641px) {
  .demo-bar { flex-wrap: wrap; gap: 8px 18px; }
  .demo-disclosure { order: 3; width: 100%; display: flex; gap: 10px; }
  .demo-disclosure span { max-width: none; }
  .sidebar .nav-item { font-size: 0; }
}
@media (max-width: 640px) {
  .demo-bar { display: grid; grid-template-columns: 1fr auto; padding: 10px 12px 11px; gap: 7px 10px; }
  .demo-back { font-size: 12px; }
  .demo-back span { font-size: 9px; }
  .demo-disclosure { grid-column: 1/-1; grid-row: 2; font-size: 10px; }
  .demo-disclosure strong { display: none; }
  .demo-disclosure span { max-width: none; }
  .demo-actions { gap: 6px; }
  .demo-actions button, .demo-actions a { font-size: 10px; min-height: 36px; padding: 7px 9px; }
  .demo-actions a { max-width: 88px; line-height: 1.2; text-align: center; }
  .app-shell { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: auto; min-height: 62px; padding-bottom: env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid #dbe2d2; z-index: 30; overflow: visible; background: #f7f9f1; }
  .sidebar .brand, .sidebar .workspace, .sidebar .nav-caption, #sidebar-channels, .sidebar-bottom { display: none; }
  .sidebar nav { width: 100%; display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; margin: 0; padding: 5px 8px; }
  .sidebar .nav-item { min-height: 52px; margin: 0; padding: 6px 2px; flex-direction: column; gap: 4px; font-size: 10px; border-radius: 8px; line-height: 1.1; white-space: nowrap; }
  .nav-item .icon { width: 18px; height: 18px; }
  .main { width: 100%; }
  .topbar { display: none; }
  .page-heading { height: 82px; min-height: 82px; padding: 12px 15px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { font-size: 12px; }
  .page-heading .eyebrow { display: none; }
  .page-heading > .button { min-width: 42px; min-height: 42px; }
  .work-summary { margin: 0 10px 10px; gap: 6px; }
  .work-item { padding: 9px; min-height: 52px; }
  .work-item span { font-size: 10px; }
  .work-item strong { font-size: 21px; }
  .inbox-layout { margin: 0 8px 8px; flex: 1; min-height: 0; border-radius: 12px; }
  .main:has(.mobile-chat:not([hidden])) .page-heading, .main:has(.mobile-chat:not([hidden])) .work-summary { display: none; }
  .main:has(.mobile-chat:not([hidden])) .inbox-layout { margin-top: 8px; }
  .search-box input, .list-selects select { font-size: 14px; }
  .list-selects select { min-height: 38px; }
  .conversation-row { min-height: 90px; }
  .row-top strong { font-size: 14px; }
  .row-preview { font-size: 12px; }
  .row-top time { font-size: 10px; }
  .list-tabs { justify-content: space-between; gap: 8px; }
  .list-tabs button { font-size: 12px; min-height: 40px; }
  .chat-header { min-height: 68px; padding: 10px 6px; gap: 3px; }
  .chat-person strong { font-size: 13px; }
  .chat-meta { font-size: 10px; }
  .chat-actions { gap: 0; }
  .chat-actions .icon-button, .mobile-back { min-width: 36px; min-height: 42px; }
  .resolve-button { font-size: 10px; min-height: 40px; }
  .chat-actions [data-action="priority"] { display: none; }
  .message-text { font-size: 14px; }
  .message { max-width: 93%; }
  .messages { padding: 12px; }
  .composer-area { padding: 8px 10px; }
  .composer textarea { font-size: 16px; min-height: 60px; max-height: 100px; }
  .composer-tabs button { font-size: 12px; min-height: 36px; }
  .composer-tabs { gap: 15px; }
  .composer-bottom .button { font-size: 12px; min-height: 42px; }
  .composer-bottom .text-button { font-size: 11px; min-height: 42px; }
  .composer-hint { font-size: 10px; margin-top: 7px; }
  .quick-replies { max-height: 135px; overflow-y: auto; }
  .quick-replies button { min-height: 38px; font-size: 12px; }
  .profile-pane.visible { top: 0; right: 0; bottom: 0; width: min(300px,100%); box-shadow: -20px 0 50px #23331925; }
  .profile-title .icon-button { min-width: 40px; min-height: 40px; }
  .profile-data, .profile-select { font-size: 13px; }
  .profile-select, .owner-row button { min-height: 40px; }
  .secondary-page { margin: 0 8px 8px; padding: 14px 10px; }
  .clients-table th, .clients-table td { padding: 12px 6px; }
  .client-name { font-size: 12px; }
  .clients-table td:last-child, .clients-table th:last-child { display: none; }
  .section-actions { flex-direction: column; align-items: flex-start; gap: 12px; }
  .template-card p { font-size: 13px; }
  .template-card .text-button { min-height: 40px; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); font-size: 12px; }
  dialog { padding: 20px; }
}
@media (max-width: 360px) {
  .demo-bar { padding-inline: 9px; gap: 6px; }
  .demo-back { font-size: 11px; }
  .demo-back span { display: none; }
  .demo-actions button, .demo-actions a { font-size: 10px; padding-inline: 7px; }
  .chat-person strong { max-width: 117px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-actions .icon-button { min-width: 32px; }
  .resolve-button { padding: 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
