/* hyTeams V16: local, page-scoped surfaces; existing workflow CSS stays intact. */
body.hyteams-v16 {
  color-scheme:dark; --bg-deep:#060b15;--bg-surface:#0d1625;--bg-card:#142237;
  --bg-input:#101c2e;--text:#edf4ff;--muted:#acbed5;--border:#34465e;
  --border-focus:#59e1ef;--accent:#59e1ef;--accent-dim:#173d4c;
  --danger:#ff8eaa;--warning:#ffd27a;--info:#8dc5ff;--purple:#c2a7ff;
  --cv16-panel:var(--bg-surface);--cv16-cyan:var(--accent);--cv16-violet:var(--purple);--cv16-pink:#f8a2cf;
  --r-sm:8px;--r-md:12px;--r-lg:18px;--sp-settle:ease;--sp-glide:ease;
  --font-sans:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  background:var(--bg-deep);color:var(--text);
}
html[data-mode="light"] body.hyteams-v16,html[data-theme="light"] body.hyteams-v16 {
  color-scheme:light;--bg-deep:#edf2f9;--bg-surface:#ffffff;--bg-card:#e7eef7;
  --bg-input:#f4f7fc;--text:#17263c;--muted:#4b607a;--border:#a7b7ca;
  --border-focus:#006a79;--accent:#006a79;--accent-dim:#d4edf0;
  --danger:#ad2347;--warning:#805000;--info:#235ca0;--purple:#6641ae;--cv16-pink:#a92d72;
}
.hyteams-v16 .ht-nav {background:var(--bg-surface);box-shadow:0 1px 18px #0002}
.hyteams-v16 .ht-nav-brand {letter-spacing:-.035em}
.hyteams-v16 .ht-sidebar {background:linear-gradient(160deg,var(--bg-surface),var(--bg-deep))}
.hyteams-v16 .ht-sidebar-header {min-height:64px;gap:8px}
.hyteams-v16 .ht-ch-item,.hyteams-v16 .ht-voice-item {margin:3px 8px;border-radius:9px;min-height:40px}
.hyteams-v16 .ht-ch-item.active {background:var(--accent-dim);box-shadow:inset 3px 0 var(--accent)}
.hyteams-v16 .ht-chat-header {background:var(--bg-surface);border-bottom:1px solid var(--border)}
.hyteams-v16 .ht-messages {background:radial-gradient(ellipse at top right,color-mix(in srgb,var(--purple) 5%,transparent),transparent 65%),var(--bg-deep)}
.hyteams-v16 .ht-input-wrap {background:var(--bg-input);border:1px solid var(--border);border-radius:14px}
.hyteams-v16 .msg-text {line-height:1.6;overflow-wrap:anywhere}
.hyteams-v16 :is(.ht-chat,.ht-chat-header-left,.ht-view,.ht-input-area) {min-width:0}
.hyteams-v16 :is(.modal,.ht-modal,.hvr-container) {max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;background:var(--bg-surface);color:var(--text)}
.hyteams-v16 #ht-mobile-work-sheet {background:var(--bg-surface);color:var(--text)}
.hyteams-v16 :is(button,[role="button"],a,input,textarea,select):focus-visible {outline:3px solid var(--border-focus)!important;outline-offset:3px}
.hyteams-v16 button:disabled {opacity:.5;cursor:not-allowed}
.hyteams-v16 :is(.ht-nav-icon-btn,.ht-header-btn,.mobile-menu-btn,.hvr-ctrl) {min-width:44px;min-height:44px}
.hyteams-v16 button {touch-action:manipulation}
.hyteams-v16 .ht-skip-link {position:fixed;top:-80px;left:12px;z-index:20000;background:var(--bg-surface);color:var(--text);padding:12px;border:2px solid var(--accent);border-radius:8px}
.hyteams-v16 .ht-skip-link:focus {top:8px}
.hyteams-v16 #toast {color:var(--text);background:var(--bg-card);border:1px solid var(--border)}
.hyteams-v16 .hvr-controls {background:var(--bg-surface);flex-wrap:wrap;gap:8px}
.hyteams-v16 .hvr-tile {background:var(--bg-card);color:var(--text)}
.hyteams-v16 .hvr-tile.speaking {outline:2px solid var(--accent);outline-offset:-2px}
@media(max-width:1100px) and (min-width:769px) {
  .hyteams-v16 .ht-sidebar {width:200px}
  .hyteams-v16 .ht-nav-brand {min-width:0;padding:0 12px}
  .hyteams-v16 .ht-nav-search {min-width:44px}
  .hyteams-v16 .ht-members-panel {width:190px}
}
@media(max-width:768px) {
  .hyteams-v16 .ht-sidebar {max-width:calc(100vw - 40px);z-index:10002;bottom:0;padding-bottom:env(safe-area-inset-bottom,0px)}
  .hyteams-v16 .sidebar-overlay {z-index:10001}
  .hyteams-v16 .ht-sidebar:not(.mobile-open) {visibility:hidden;pointer-events:none}
  .hyteams-v16 .ht-sidebar.mobile-open {visibility:visible}
  .hyteams-v16 :is(.ht-ch-item,.ht-voice-item,.ht-biz-menu-item) {min-height:44px}
  .hyteams-v16 .ht-input-wrap {flex-wrap:wrap;padding:6px}
  .hyteams-v16 .ht-input-area {flex:1 1 150px;max-width:100%}
  .hyteams-v16 .ht-input-tools {flex-wrap:wrap}
  .hyteams-v16 .ht-input-tools button,.hyteams-v16 .ht-input-tools label {min-width:44px;min-height:44px}
  .hyteams-v16 .ht-chat-header {flex-wrap:wrap}
  .hyteams-v16 .ht-chat-header-right {margin-left:auto}
  .hyteams-v16 .ht-ch-tabs {padding:0 8px;min-height:44px}
  .hyteams-v16 .hvr-controls {padding:10px;justify-content:center}
  .hyteams-v16 .hvr-ctrl-btns {flex-wrap:wrap;justify-content:center}
  .hyteams-v16 #hvr-overlay {z-index:10003}
  .hyteams-v16 .hvr-chat {max-width:100%}
  .hyteams-v16 .ht-task-toolbar,.hyteams-v16 .ht-task-filters {flex-wrap:wrap}
  .hyteams-v16 .ht-task-filters {margin-left:0;width:100%}
  .hyteams-v16 .ht-task-filter {flex:1}
  .hyteams-v16 .ht-task-filter input {width:100%;min-width:0}
}
@media(max-width:360px) {
  .hyteams-v16 .ht-nav {padding-inline:6px}
  .hyteams-v16 .ht-nav-brand {font-size:12px;padding-inline:4px}
  .hyteams-v16 .ht-nav-right {gap:0}
  .hyteams-v16 .ht-messages {padding-inline:8px}
  .hyteams-v16 .ht-input-bar {padding:6px}
  .hyteams-v16 .hvr-user-info {width:100%}
}
@media(prefers-reduced-motion:reduce) {
  .hyteams-v16 *, .hyteams-v16 *::before,.hyteams-v16 *::after {animation:none!important;transition:none!important;scroll-behavior:auto!important}
}

/* V16 mobile Task Studio — preserve desktop board and all task handlers. */
@media (max-width:768px) {
 .hyteams-v16 #tab-tasks{background:var(--bg-deep);min-height:0}
 .hyteams-v16 .ht-task-workspace-head{padding:10px 14px 8px;position:relative}
 .hyteams-v16 .ht-task-title-block strong{font-size:21px;letter-spacing:-.035em}
 .hyteams-v16 .ht-task-toolbar{padding:6px 12px 8px;border-bottom:0;background:transparent}
 .hyteams-v16 .ht-task-view-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;background:var(--bg-card);border:1px solid var(--border);border-radius:15px;padding:4px;margin:0 0 8px}
 .hyteams-v16 .ht-task-view-switch .ht-ch-tab{border:0!important;border-radius:11px;min-height:41px;font-size:12px;font-weight:750}
 .hyteams-v16 .ht-task-view-switch .ht-ch-tab.active{background:color-mix(in srgb,var(--accent) 14%,var(--bg-surface));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 46%,transparent);color:var(--accent)}
 .hyteams-v16 .ht-task-filters{grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important}
 .hyteams-v16 .ht-task-filter{grid-column:1;min-width:0;height:44px;border-radius:13px;background:var(--bg-card)}
 .hyteams-v16 .ht-task-filter input{font-size:16px!important;min-width:0}
 .hyteams-v16 .ht-task-filters select{height:44px;border-radius:12px;background:var(--bg-card);font-size:13px!important}
 .hyteams-v16 #tasks-filter-assignee{grid-column:1;display:none}
 .hyteams-v16 #tasks-filter-status{grid-column:1/-1;display:none}
 .hyteams-v16 #tasks-filter-priority{grid-column:1/-1;display:none!important}
 .hyteams-v16 .ht-task-filters.mobile-filters-open #tasks-filter-assignee,
 .hyteams-v16 .ht-task-filters.mobile-filters-open #tasks-filter-status,
 .hyteams-v16 .ht-task-filters.mobile-filters-open #tasks-filter-priority{display:block!important}
 .hyteams-v16 .ht-task-filters.mobile-filters-open #tasks-filter-status{grid-column:2}
 .hyteams-v16 #ht-mobile-task-filter-toggle{grid-column:2;grid-row:1;min-height:44px;min-width:44px;display:inline-flex;gap:6px;align-items:center;justify-content:center;border:1px solid var(--border);background:var(--bg-card);border-radius:13px;color:var(--text);padding:0 12px;font-size:12px;font-weight:750}
 .hyteams-v16 #ht-mobile-task-filter-toggle[aria-expanded=true]{color:var(--accent);border-color:var(--accent);background:var(--bg-surface)}
 .hyteams-v16 .ht-task-health{gap:6px;padding:5px 12px 9px;border:0}
 .hyteams-v16 .ht-task-health span{border-radius:12px;padding:7px 10px;font-size:11px}
 .hyteams-v16 .ht-task-focus-view{padding:8px 12px calc(var(--ht-mobile-dock-h) + 25px)}
 .hyteams-v16 #kanban-board{padding:6px 10px calc(var(--ht-mobile-dock-h) + 18px);overflow-x:auto;overscroll-behavior-x:contain}
 .hyteams-v16 .ht-sl-card,.hyteams-v16 .ht-task-row{border-radius:15px!important;box-shadow:0 3px 16px rgba(0,0,0,.13)}
 .hyteams-v16 .ht-task-create{width:44px;height:44px;border-radius:13px}
 .hyteams-v16 #ht-ios-tab-bar{box-shadow:0 -8px 30px rgba(0,0,0,.22)}
 .hyteams-v16 #view-team-mail{bottom:var(--ht-mobile-dock-h);min-height:0}
 .hyteams-v16 .tm-email-row{min-height:62px}
 .hyteams-v16 .tm-search{font-size:16px!important}
 .hyteams-v16 .ht-input-area textarea{font-size:16px!important}
 .hyteams-v16 #ht-mobile-mail-shortcut{display:flex;align-items:center;gap:6px}
}
@media(min-width:769px){.hyteams-v16 #ht-mobile-task-filter-toggle,.hyteams-v16 #ht-mobile-mail-shortcut{display:none!important}}

/* Voice room must stack above the sticky task swimlane: V16 overlay fix. */
.hyteams-v16 #chat-panel > #hvr-overlay.open {z-index:1000;isolation:isolate}
.hyteams-v16 #chat-panel:has(> #hvr-overlay.open) > #tab-tasks {visibility:hidden;pointer-events:none}
.hyteams-v16 .ht-nav-brand {font-weight:800;letter-spacing:-.02em}

/* hyTeams owns its own mobile dock; generic PWA prompts obscure controls. */
.hyteams-v16 #hyp-install-banner,.hyteams-v16 [data-pwa-install-section]{display:none!important}
.hyteams-v16 .ht-member-item{cursor:pointer}
.hyteams-v16 .ht-member-item:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
@media(max-width:768px){.hyteams-v16 #dm-overlay{inset:50px 0 calc(var(--ht-mobile-dock-h) + 4px) 0!important;width:auto!important;max-width:100vw!important}}

/* Task Studio V16: inline disclosure, no cross-cell floating detail popup.
   Inspired by Beautiful UI's layered cards and responsive detail layouts. */
.hyteams-v16 .ht-sl-task-cell .ht-task-row{width:100%;min-width:0;overflow:hidden;isolation:isolate;transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}
.hyteams-v16 .ht-sl-task-cell .ht-task-row[open]{z-index:auto;overflow:visible;border-color:color-mix(in srgb,var(--accent) 52%,var(--border));box-shadow:0 5px 22px rgba(0,0,0,.18)}
.hyteams-v16 .ht-sl-task-cell .ht-task-row[open] > summary{border-bottom:1px solid var(--border)}
.hyteams-v16 .ht-sl-task-cell .ht-task-row > .tr-details,
.hy-collab-v16 .ht-sl-task-cell .ht-task-row[open] > .tr-details{
  position:relative!important;inset:auto!important;left:auto!important;top:auto!important;
  display:block;width:100%!important;max-width:100%!important;max-height:none!important;
  overflow-wrap:anywhere;overflow:visible;box-sizing:border-box;margin:0!important;
  border:0;border-radius:0;padding:13px 12px 14px;
  background:color-mix(in srgb,var(--bg-card) 52%,var(--bg-surface));
  box-shadow:none;z-index:auto!important;isolation:auto;
  color:var(--text);font-size:12px;line-height:1.55;
}
.hyteams-v16 .ht-sl-task-cell .ht-task-row:not([open]) > .tr-details{display:none!important}
.hyteams-v16 .ht-sl-task-cell .ht-task-row > .tr-details .ht-task-thinking{margin:0 0 10px;line-height:1.4}
.hyteams-v16 .ht-sl-task-cell .ht-task-row > .tr-details .ht-header-btn{border:1px solid var(--border);border-radius:10px;padding:8px 10px;min-height:36px;background:var(--bg-card);color:var(--text);cursor:pointer}
.hyteams-v16 .ht-sl-task-cell .ht-task-row > .tr-details .ht-header-btn:hover{border-color:var(--accent);color:var(--accent)}
.hyteams-v16 .ht-sl-task-cell .ht-task-row summary{border-radius:12px;min-height:58px}
.hyteams-v16 .ht-sl-task-cell .ht-task-row summary:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.hyteams-v16 .ht-sl-task-cell .ht-task-row .tr-title{white-space:normal;overflow-wrap:anywhere;line-height:1.35}
@media(max-width:768px){.hyteams-v16 .ht-sl-task-cell .ht-task-row > .tr-details{padding:12px!important}.hyteams-v16 .ht-sl-task-cell .ht-task-row summary{min-height:52px}}

/* Beautiful UI-inspired Task Studio: responsive scrollable records grid. */
@media (min-width:769px) {
  .hyteams-v16 #tab-tasks{min-height:0;min-width:0;overflow:hidden}
  .hyteams-v16 #kanban-board,
  .hy-collab-v16.hyteams-v16 #kanban-board{
    position:relative;display:block;flex:1 1 auto;min-height:0;min-width:0;
    max-width:100%;max-height:100%;overflow-x:auto!important;overflow-y:auto!important;
    overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--border-focus) var(--bg-surface);
  }
  .hyteams-v16 #kanban-board::-webkit-scrollbar{width:12px;height:12px}
  .hyteams-v16 #kanban-board::-webkit-scrollbar-track{background:var(--bg-surface)}
  .hyteams-v16 #kanban-board::-webkit-scrollbar-thumb{background:var(--border-focus);border:3px solid var(--bg-surface);border-radius:999px}
  .hyteams-v16 #kanban-board:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
  .hyteams-v16 #kanban-board .ht-sl-header-row{position:sticky;top:0;z-index:25}
  .hyteams-v16 #kanban-board .ht-sl-member-cell{position:sticky;left:0;z-index:20}
  .hyteams-v16 #kanban-board .ht-sl-header-cell:first-child{position:sticky;left:0;z-index:30;background:var(--bg-surface)}
}
.hyteams-v16 #kanban-board .ht-task-row{transition:border-color .16s ease,box-shadow .16s ease}
.hyteams-v16 #kanban-board .ht-task-row:focus-within{border-color:var(--accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 45%,transparent)}
.hyteams-v16 #kanban-board .ht-sl-task-cell:has(.ht-task-row[open]){background:color-mix(in srgb,var(--bg-card) 46%,var(--bg-deep))}

/* Beautiful UI-inspired interactive toolbar for the original swimlane grid. */
.hyteams-v16 .ht-task-board-nav{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 14px;background:color-mix(in srgb,var(--bg-card) 70%,var(--bg-deep));border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.hyteams-v16 .ht-task-board-nav-label{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:750;color:var(--text)}
.hyteams-v16 .ht-task-board-nav-label iconify-icon{font-size:17px;color:var(--accent)}
.hyteams-v16 .ht-task-board-nav-label small{font-size:11px;font-weight:450;color:var(--muted)}
.hyteams-v16 .ht-task-board-nav-controls{display:flex;align-items:center;gap:5px}
.hyteams-v16 .ht-task-board-nav-controls button{display:inline-grid;place-items:center;width:35px;height:35px;border-radius:10px;border:1px solid var(--border);background:var(--bg-surface);color:var(--text);cursor:pointer}
.hyteams-v16 .ht-task-board-nav-controls button:hover:not(:disabled){background:var(--bg-card);border-color:var(--accent);color:var(--accent)}
.hyteams-v16 .ht-task-board-nav-controls button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.hyteams-v16 .ht-task-board-nav-controls button:disabled{opacity:.34;cursor:default}
@media(max-width:768px){.hyteams-v16 .ht-task-board-nav{padding:5px 10px}.hyteams-v16 .ht-task-board-nav-label small{display:none}.hyteams-v16 .ht-task-board-nav-controls button{width:44px;height:44px}}
.hyteams-v16 #tab-tasks:has(#tasks-view-list.active) .ht-task-board-nav{display:none}

/* Beautiful UI records controls: semantic sort field, 44px targets and responsive grid. */
.hyteams-v16 .ht-task-sort-label{display:inline-flex;align-items:center;gap:7px;padding:0 5px;font-size:11px;font-weight:750;color:var(--muted)}
.hyteams-v16 .ht-task-filters #ht-task-sort{min-width:128px;max-width:200px;min-height:40px;border:1px solid var(--border);border-radius:12px;padding:0 12px;background:var(--bg-card);color:var(--text);font-size:12px;cursor:pointer}
.hyteams-v16 .ht-task-filters #ht-task-sort:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.hyteams-v16 .ht-task-focus-view .ht-tier-section{border:1px solid var(--border);border-radius:16px;overflow:hidden;margin:10px 0;background:var(--bg-surface);box-shadow:0 7px 25px rgba(0,0,0,.1)}
.hyteams-v16 .ht-task-focus-view .ht-tier-hdr{padding:12px 16px;background:color-mix(in srgb,var(--bg-card) 75%,var(--bg-deep))}
.hyteams-v16 .ht-task-focus-view .ht-task-row{border-radius:12px;margin:7px 10px;box-shadow:none}
.hyteams-v16 .ht-task-focus-view .ht-task-row[open]>.tr-details{position:relative!important;inset:auto!important;width:100%!important;max-width:none!important;max-height:none!important;overflow:visible!important;box-shadow:none;border:0;border-top:1px solid var(--border);border-radius:0 0 12px 12px}
@media(max-width:768px){.hyteams-v16 .ht-task-filters .ht-task-sort-label{display:none}.hyteams-v16 .ht-task-filters #ht-task-sort{width:100%;max-width:none;grid-column:1/-1;min-height:44px}}
