/* Shared constraints for names, notes, tools and notifications in both themes. */
html:root[data-theme] :is(.content, .main, .space-card, .user-card, .review-panel, .review-main,
  .review-round-card > div, .review-project-group, .review-work-group, .intake-workspace,
  .intake-main-material-copy, .intake-original-head > div, .intake-video-copy, .share-strip > div,
  .event > div, .folder-owner > div, .dialog-head h2, .system-dashboard) { min-width: 0; }
html:root[data-theme] :is(h1,h2,h3,.strip-title,.space-card-title,.space-description,
  .intake-main-material-copy strong,.review-attachment strong,.review-feedback-row p,
  .review-feedback-markers button,.event small,.dialog-desc,.review-muted) { overflow-wrap: anywhere; }
html:root[data-theme] :is(.review-feedback-row p,.review-feedback-markers button,.intake-marker-editor textarea) { white-space: pre-wrap; }
html:root[data-theme] :is(.review-field,.field) { min-width: 0; }
html:root[data-theme] :is(input,textarea,select) { max-width: 100%; min-width: 0; }
html:root[data-theme] :is(.review-actions,.review-card-actions,.intake-original-actions,.dialog-actions,.share-strip,.footer-line,.meter) { flex-wrap: wrap; }
html:root[data-theme] :is(.btn,.review-button) { max-width: 100%; overflow-wrap: anywhere; white-space: normal; text-align: center; }
html:root[data-theme] .space-card-foot { padding: 14px 16px; gap: 12px; align-items: center; flex-wrap: wrap; }
html:root[data-theme] .space-card-foot > span:first-child { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
html:root[data-theme] .space-card-foot .btn { flex: 0 1 auto; margin: 0; }
html:root[data-theme] .space-card-head { flex-wrap: wrap; }
html:root[data-theme] .footer-line { padding: 12px 4px; gap: 12px 24px; line-height: 1.6; }
html:root[data-theme] .footer-line > span { min-width: 0; }
html:root[data-theme] .meter { min-width: 0; max-width: 100%; justify-content: flex-end; }
html:root[data-theme] .review-work-group { margin-bottom: 30px; }
html:root[data-theme] .review-work-group > .review-section-head { padding: 0 4px 12px; margin: 0; }
html:root[data-theme] .review-work-group > .review-section-head h2 { font-size: 1rem; }
html:root[data-theme] .review-group-count { color: var(--muted); font-size: .75rem; flex-shrink: 0; }
html:root[data-theme] .review-round-family { margin-bottom: 12px; }
html:root[data-theme] .review-readiness { width: 100%; max-width: none; text-align: left; }
html:root[data-theme] .review-finish-item { background: var(--paper); border-bottom: 1px solid var(--line); }
html:root[data-theme] .review-finish-item:last-child { border-bottom: 0; }
html:root[data-theme] .review-finish-item > summary { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 16px; align-items: start; gap: 16px; padding: 14px 16px; list-style: none; cursor: pointer; font-size: .82rem; line-height: 1.5; }
html:root[data-theme] .review-finish-item > summary::-webkit-details-marker { display: none; }
html:root[data-theme] .review-finish-item-title { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 8px; min-width: 0; color: var(--ink); }
html:root[data-theme] .review-finish-item-title > span { overflow-wrap: anywhere; }
html:root[data-theme] .review-finish-item-title b { color: var(--lumen-mint); }
html:root[data-theme] .review-finish-item-note { min-width: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: .76rem; }
html:root[data-theme] .review-finish-item-body { padding: 0 16px 16px 44px; border-top: 1px solid var(--line); }
html:root[data-theme] .review-finish-item-body p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .84rem; line-height: 1.65; margin: 12px 0; }
html:root[data-theme] .review-finish-item[open] > summary { background: var(--lumen-accent-soft); }
html:root[data-theme] .live-controls { display: flex; align-items: center; gap: 3px; }
html:root[data-theme] .live-bell { position: relative; }
html:root[data-theme] .live-count { position: absolute; top: 0; right: -2px; border: 2px solid var(--paper); min-width: 18px; height: 18px; padding: 0 3px; border-radius: 12px; background: var(--lumen-mint); color: var(--paper); font-size: 10px; display: grid; place-items: center; font-weight: 750; }
html:root[data-theme] .live-sound[aria-pressed="false"] { color: var(--muted); opacity: .75; }
html:root[data-theme] .live-side { margin-top: 20px; }
html:root[data-theme] .live-side:empty { display: none; }
html:root[data-theme] .live-side-items { display: grid; gap: 4px; }
html:root[data-theme] :is(.live-side-items,.live-items) button { display: grid; grid-template-columns: 8px minmax(0,1fr) 12px; align-items: center; gap: 12px; width: 100%; min-width: 0; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; padding: 10px; }
html:root[data-theme] :is(.live-side-items,.live-items) button:hover { background: var(--lumen-accent-soft); }
html:root[data-theme] :is(.live-side-items,.live-items) button > span:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
html:root[data-theme] :is(.live-side-items,.live-items) strong { min-width: 0; font-size: .78rem; overflow-wrap: anywhere; }
html:root[data-theme] :is(.live-side-items,.live-items) small { font-size: .68rem; color: var(--muted); line-height: 1.5; }
html:root[data-theme] .live-side-items strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html:root[data-theme] .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lumen-mint); box-shadow: 0 0 0 3px color-mix(in srgb,var(--lumen-mint) 15%,transparent); }
html:root[data-theme] .live-show-all { margin: 8px 10px; background: transparent; color: var(--lumen-accent); border: 0; font-size: .7rem; cursor: pointer; }
html:root[data-theme] .live-panel { position: fixed; z-index: 85; top: 82px; right: 24px; width: min(420px,calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 12px 36px rgba(20,16,45,.16); overflow: hidden; animation: live-enter .18s ease-out; }
html:root[data-theme] .live-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
html:root[data-theme] .live-panel-head h2 { margin: 0; font-size: .9rem; }
html:root[data-theme] .live-items { padding: 8px; max-height: min(65dvh,540px); overflow-y: auto; overscroll-behavior: contain; }
html:root[data-theme] .live-items p { font-size: .85rem; margin: 18px; color: var(--muted); }
html:root[data-theme] .live-bubble { position: fixed; z-index: 78; bottom: 24px; left: calc(50% + 115px); transform: translateX(-50%); width: min(430px,calc(100vw - 32px)); display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 15px; padding: 8px; box-shadow: 0 12px 36px rgba(20,16,45,.16); animation: live-enter .2s ease-out; }
html:root[data-theme] .live-bubble > button:first-child { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 12px; padding: 8px; align-items: center; background: transparent; border: 0; color: var(--ink); cursor: pointer; text-align: left; flex: 1; min-width: 0; }
html:root[data-theme] .live-bubble strong { display: block; font-size: .83rem; }
html:root[data-theme] .live-bubble small { display: block; font-size: .74rem; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
html:root[data-theme] .space-link.has-notifications .space-dot { background: var(--lumen-mint); border-color: var(--lumen-mint); box-shadow: 0 0 0 3px color-mix(in srgb,var(--lumen-mint) 15%,transparent); }
html:root[data-theme] .live-space-badge { color: var(--lumen-mint); background: color-mix(in srgb,var(--lumen-mint) 12%,var(--paper)); border-radius: 8px; padding: 5px 8px; font-size: .7rem; }
@keyframes live-enter { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 760px) {
  html:root[data-theme] .space-card-head { position: relative; }
  html:root[data-theme] .space-card .folder-menu { position: static; }
  html:root[data-theme] .space-card .folder-menu-items { top: calc(100% + 8px); right: 0; max-width: 100%; }
  html:root[data-theme] .live-space-badge { flex-basis: 100%; text-align: center; }
  html:root[data-theme] .top-actions { gap: 2px; }
  html:root[data-theme] .top-actions .icon-btn { width: 33px; height: 36px; padding: 7px; }
  html:root[data-theme] .top-actions .status-pill { display: none; }
  html:root[data-theme] .live-panel { top: 74px; right: 16px; }
  html:root[data-theme] .live-bubble { left: 50%; bottom: max(16px,env(safe-area-inset-bottom)); }
  html:root[data-theme] .review-finish-item > summary { grid-template-columns: minmax(0,1fr) 16px; gap: 6px 12px; padding: 13px; }
  html:root[data-theme] .review-finish-item-title { grid-column: 1; }
  html:root[data-theme] .review-finish-item-note { grid-column: 1; padding-left: 28px; }
  html:root[data-theme] .review-finish-item > summary > span:last-child { grid-column: 2; grid-row: 1 / span 2; }
  html:root[data-theme] .review-finish-item-body { padding: 0 13px 13px; }
  html:root[data-theme] .footer-line,.meter { justify-content: flex-start; }
  html:root[data-theme] .event { flex-wrap: wrap; }
  html:root[data-theme] .event > div { flex: 1; }
  html:root[data-theme] .event time { white-space: normal; margin-left: 0; }
  html:root[data-theme] .dialog-actions > button { flex: 1 1 120px; }
}
@media (prefers-reduced-motion: reduce) { html:root[data-theme] :is(.live-panel,.live-bubble) { animation: none; } }
html:root[data-theme] .live-chat-bubble{left:auto;right:24px;top:92px;bottom:auto;transform:none;border-color:var(--blue);background:var(--paper)}
html:root[data-theme] .live-bubble[hidden]{display:none}
html:root[data-theme] .live-chat-bubble .icon{color:var(--blue)}
html:root[data-theme] .live-bubble strong{overflow-wrap:anywhere}
@media(max-width:760px){html:root[data-theme] .live-chat-bubble{left:12px;right:12px;top:max(76px,calc(env(safe-area-inset-top) + 64px));width:auto;max-width:none;bottom:auto;padding:8px;border-radius:16px}html:root[data-theme] .live-chat-bubble button{min-height:44px}}

/* Keep chat attention tied to unread messages across shared-header rerenders. */
html:root[data-theme] .live-bell.has-unread-chat { color: var(--blue); background: var(--light-blue); border-radius: 12px; }
html:root[data-theme] .live-bell.has-unread-chat > .icon { transform-origin: 50% 15%; }
html:root[data-theme] .live-chat-bubble { width: min(320px,calc(100vw - 32px)); z-index: 28; top: 84px; padding: 4px; }
html:root[data-theme] .live-chat-bubble > button:first-child { padding: 6px; min-height: 44px; }
html:root[data-theme] .live-chat-bubble strong { font-size: .78rem; line-height: 1.3; }
html:root[data-theme] .live-chat-bubble small { font-size: .7rem; line-height: 1.3; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  html:root[data-theme] .live-bell.has-unread-chat > .icon { animation: live-chat-ring 4.2s ease-in-out infinite; }
  html:root[data-theme] .live-bell.has-unread-chat { animation: live-chat-glow 3s ease-in-out infinite; }
}
@keyframes live-chat-ring { 0%,22%,100% { transform: rotate(0); } 4%,12% { transform: rotate(10deg); } 8%,16% { transform: rotate(-10deg); } }
@keyframes live-chat-glow { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb,var(--blue) 18%,transparent); } 50% { box-shadow: 0 0 0 4px color-mix(in srgb,var(--blue) 10%,transparent); } }
@media(max-width:760px) { html:root[data-theme] .live-chat-bubble { width:auto; top:max(76px,calc(env(safe-area-inset-top) + 64px)); padding:4px; } }

html:root[data-theme] .main.has-unread-chat > .topbar { margin-bottom: 64px; }

/* Separate persistent video notice; participates in layout, never covers review panels. */
html:root[data-theme] .live-video-panel{margin:8px 30px 0;padding:10px 14px;border:1px solid var(--blue);border-radius:12px;background:var(--paper);min-width:0}
html:root[data-theme] .live-video-panel[hidden]{display:none}
html:root[data-theme] .live-video-heading{display:flex;align-items:center;gap:8px;font-size:.8rem;color:var(--blue)}
html:root[data-theme] .live-video-panel>div{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
html:root[data-theme] .live-video-panel [data-live-key]{flex:1 1 210px;display:grid;grid-template-columns:22px minmax(0,1fr) 12px;align-items:center;gap:8px;padding:7px 10px;min-height:44px;border:1px solid var(--line);border-radius:9px;background:var(--canvas);color:var(--ink);text-align:left;font:inherit}
html:root[data-theme] .live-video-panel [data-live-key] strong,html:root[data-theme] .live-video-panel [data-live-key] small{display:block;overflow-wrap:anywhere;font-size:.78rem}
html:root[data-theme] .live-video-panel [data-live-key] small{font-size:.7rem;color:var(--muted)}
html:root[data-theme] .live-items>h3{font-size:.78rem;padding:8px 12px;margin:0;color:var(--muted)}
@keyframes live-video-arrival{0%,100%{opacity:1;transform:translateY(0)}50%{opacity:.5;transform:translateY(-2px)}}
@media(prefers-reduced-motion:no-preference){html:root[data-theme] .live-video-panel .live-video-heading>.icon{animation:live-video-arrival 3s ease-in-out infinite}}
@media(max-width:760px){html:root[data-theme] .live-video-panel{margin:8px 12px 0;padding:9px 10px}html:root[data-theme] .live-video-panel [data-live-key]{flex-basis:100%}}
