#selectionToolbar{
  position:fixed; z-index:var(--z-toolbar); display:none; align-items:center;
  background:var(--md-color-grey-white); border-radius:10px; padding:4px;
  box-shadow:var(--shadow-popover);
  gap:2px;
}
#selectionToolbar.open{ display:flex; }
#selectionToolbar button, .plan-edit-sel-toolbar button{
  height:32px; min-width:32px; padding:0 8px; border:none; border-radius:6px; background:transparent;
  color:var(--ui-muted); font-size:var(--text-lg); cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:6px;
}
#selectionToolbar button:not(.sel-btn-labeled){ width:32px; padding:0; }
#selectionToolbar button.sel-btn-labeled{ font-family:var(--font-sans); font-size:var(--text-md); font-weight:var(--font-weight-medium); }
#selectionToolbar button:hover, .plan-edit-sel-toolbar button:hover{ background:var(--ui-surface-2); color:var(--ui-text); }
#selectionToolbar button.active{ background:var(--ui-surface-2); color:var(--ui-accent); }
#selectionToolbar .sel-sep{ width:1px; align-self:stretch; margin:4px 2px; background:var(--ui-border); }
#selectionToolbar.title-field #selBoldBtn, #selectionToolbar.title-field .sel-color-wrap, #selectionToolbar.title-field #selSepAi,
#selectionToolbar.title-field #selBulletListBtn, #selectionToolbar.title-field #selNumberListBtn, #selectionToolbar.title-field #selSepList,
#selectionToolbar.centered-field #selBulletListBtn, #selectionToolbar.centered-field #selNumberListBtn, #selectionToolbar.centered-field #selSepList{ display:none; }
#selectionToolbar.selection-toolbar-minimal > *:not(#selAiRewriteBtn){ display:none; }
#selectionToolbar.selection-toolbar-readonly > *:not(#selCommentBtn){ display:none; }
#selectionToolbar.selection-toolbar-cell #selCommentBtn,
#selectionToolbar.selection-toolbar-cell #selCommentBtn + .sel-sep,
#selectionToolbar.selection-toolbar-cell #selLinkBtn + .sel-sep{ display:none; }

.sel-color-wrap{ position:relative; display:flex; }
#selectionToolbar #selAiColorBtn{ width:auto; padding:0 6px; gap:3px; }
.sel-color-caret{ font-size:var(--text-xs); }
#selAiColorBtn.menu-open{ background:var(--ui-surface-2); color:var(--ui-text); }
.sel-color-menu{
  display:none; position:absolute; top:calc(100% + 6px); left:50%; transform:translateX(-50%);
  z-index:1; gap:4px; padding:6px; border-radius:10px;
  background:var(--md-color-grey-white); box-shadow:var(--shadow-popover);
}
.sel-color-menu.open{ display:flex; }
#selectionToolbar .sel-color-menu button{
  width:28px; min-width:0; height:28px; padding:0; border-radius:50%;
}
#selectionToolbar .sel-color-menu button.is-active{ box-shadow:inset 0 0 0 2px var(--ui-accent); }
.sel-color-dot{ width:16px; height:16px; border-radius:50%; flex-shrink:0; }
.sel-color-dot-gradient{ background:var(--ui-ai-gradient); }
.sel-color-dot-accent{ background:var(--sel-slide-accent, var(--md-brand-foreground-1-rest)); }

.accent-text{ color:var(--md-brand-foreground-1-rest); }
[data-style="accent"] .accent-text{ color:var(--md-color-grey-white); }
.cover-slide-bg .accent-text{ color:var(--hero-fg); }

.presenter-notes-sel-btn{
  position:fixed; z-index:var(--z-toolbar); background:var(--ui-surface); box-shadow:var(--shadow-popover);
  color:var(--ui-accent); font-size:var(--text-md); font-weight:var(--font-weight-medium);
}

#aiRewritePopover{
  position:fixed; z-index:var(--z-toolbar-popover); display:none; flex-direction:column; gap:8px;
  background:var(--md-color-grey-white); border:1px solid var(--ui-border); border-radius:10px; padding:10px; width:280px;
  box-shadow:var(--shadow-popover);
}
#aiRewritePopover.open{ display:flex; }
.ai-rewrite-options{ display:flex; flex-direction:column; gap:2px; }
.ai-rewrite-option{
  text-align:left; border:none; background:transparent; padding:7px 8px; border-radius:6px;
  font-family:var(--font-sans); font-size:var(--text-md); color:var(--ui-text); cursor:pointer;
}
.ai-rewrite-option:hover{ background:var(--ui-surface-2); }

#aiRewriteReviewToolbar, #omegaCommentReviewToolbar{
  position:fixed; z-index:var(--z-toolbar); display:none; align-items:center; gap:2px;
  background:var(--md-color-grey-white); border-radius:10px; padding:4px; box-shadow:var(--shadow-popover);
}
#aiRewriteReviewToolbar.open, #omegaCommentReviewToolbar.open{ display:flex; }
#omegaReviewBackdrop{ display:none; position:fixed; inset:0; z-index:var(--z-review); background:transparent; overflow:hidden; }
#omegaReviewBackdrop.open{ display:block; }
.omega-review-spot{
  position:absolute; border-radius:8px; pointer-events:none;
  box-shadow:0 0 0 9999px rgba(20,24,32,0.35);
  transition:left .15s ease, top .15s ease, width .15s ease, height .15s ease;
}
body.omega-review-open #omegaCommentReviewToolbar.open{ z-index:var(--z-review-toolbar); }
#omegaCommentReviewToolbar.ai-review-toolbar-enter{ animation:aiReviewToolbarEnter .22s ease; }
@keyframes aiReviewToolbarEnter{ from{ opacity:0; transform:translateY(-6px); } to{ opacity:1; transform:translateY(0); } }
#aiRewriteReviewToolbar.ai-review-toolbar-enter{ animation:aiReviewToolbarEnter .22s ease; }
#aiRewriteReviewToolbar button, #componentAiReviewToolbar button, #planAiReviewToolbar button,
#omegaCommentReviewToolbar button, .discovery-merge-review-bar button{
  height:28px; padding:0 10px; border:none; border-radius:6px; background:transparent; cursor:pointer;
  font-family:var(--font-sans); font-size:var(--text-md);
}
#aiRewriteIgnoreBtn, #omegaReviewIgnoreBtn{ color:var(--ui-muted); }
#aiRewriteIgnoreBtn:hover, #omegaReviewIgnoreBtn:hover{ background:var(--ui-surface-2); }
#aiRewriteAcceptBtn, #omegaReviewAcceptBtn{ color:var(--ui-accent); font-weight:var(--font-weight-semibold); }
#aiRewriteAcceptBtn:hover, #omegaReviewAcceptBtn:hover{ background:var(--ui-surface-2); }

.ai-rewrite-preview-old{ color:var(--md-neutral-foreground-3-rest); }
.ai-rewrite-skeleton-overlay{ position:fixed; inset:0; pointer-events:none; z-index:var(--z-skeleton); }
.ai-rewrite-skeleton-bar{
  position:absolute; border-radius:4px;
  background:var(--ui-muted); animation:ai-rewrite-pulse 1.1s ease-in-out infinite;
}
@keyframes ai-rewrite-pulse{ 0%,100%{ opacity:0.3; } 50%{ opacity:0.75; } }
.ai-text-greying{ color:var(--ui-muted); animation:ai-rewrite-pulse 1.1s ease-in-out infinite; }
[data-style="accent"] .ai-rewrite-preview-old{ color:rgba(255,255,255,0.7); }
.ai-rewrite-final-blue{ color:var(--ui-accent); background:rgba(0,64,222,0.10); border-radius:4px; transition:color .3s ease, background .3s ease; }
[data-style="accent"] .ai-rewrite-final-blue{ color:var(--md-color-grey-white); background:rgba(255,255,255,0.35); }
[data-style="accent"] .ai-gradient-text{
  background:none; -webkit-text-fill-color:var(--md-color-grey-white); color:var(--md-color-grey-white);
}

.ai-card-skeleton-overlay{ position:fixed; inset:0; pointer-events:none; z-index:var(--z-skeleton); }
.ai-card-skeleton-piece{
  position:absolute; border-radius:4px;
  background:var(--ui-muted); animation:ai-rewrite-pulse 1.1s ease-in-out infinite;
}
.ai-card-skeleton-piece.ai-card-skeleton-icon{ border-radius:8px; }
.ai-card-greying{ background:var(--md-color-grey-white) !important; animation:ai-rewrite-pulse 1.1s ease-in-out infinite; }
.ai-card-greying *:not(.card-grip-handle):not(.card-grip-handle *):not(.card-resize-handle):not(.card-resize-handle *):not(.card-gear-btn):not(.card-lock-btn){
  color:var(--ui-muted) !important; fill:var(--ui-muted) !important; border-color:var(--ui-muted) !important;
  background-color:transparent !important; background-image:none !important;
}
@keyframes ai-card-skeleton-shimmer{ 0%{ background-position:0% 0; } 100%{ background-position:100% 0; } }
.slide-thumb.ai-thumb-skeleton{
  background:linear-gradient(90deg, #F2F5F9 0%, #D3D9E2 50%, #F2F5F9 100%);
  background-size:300% 100%; animation:ai-card-skeleton-shimmer 1.6s ease-in-out infinite alternate;
  cursor:default;
}
html[data-ui-theme="dark"] .slide-thumb.ai-thumb-skeleton{
  background:linear-gradient(90deg, #2A313D 0%, #3A4250 50%, #2A313D 100%);
  background-size:300% 100%;
}
.slide-thumb.ai-thumb-skeleton > *{ visibility:hidden; }
#componentAiReviewToolbar, #recomposeReviewBar{
  position:fixed; z-index:var(--z-toolbar); display:none; align-items:center; gap:2px;
  background:var(--md-color-grey-white); border-radius:10px; padding:4px; box-shadow:var(--shadow-popover);
}
#componentAiReviewToolbar.open, #recomposeReviewBar.open{ display:flex; }
#recomposeReviewBar button{ border:none; background:transparent; border-radius:8px; padding:6px 10px; font-family:var(--font-sans); font-size:var(--text-md); cursor:pointer; }
#recomposeReviewLabel{ padding:0 10px 0 8px; font-size:var(--text-sm); color:var(--ui-muted); white-space:nowrap; }
#recomposeIgnoreBtn{ color:var(--ui-muted); }
#recomposeIgnoreBtn:hover{ background:var(--ui-surface-2); }
#recomposeAcceptBtn{ color:var(--ui-accent); font-weight:var(--font-weight-semibold); }
#recomposeAcceptBtn:hover{ background:var(--ui-surface-2); }
body.recompose-review .topbar,
body.recompose-review .icon-rail,
body.recompose-review .rail-panel,
body.recompose-review #sidebarLeft,
body.recompose-review .app-nav,
body.recompose-review #selectionToolbar,
body.recompose-review .comments-panel{
  pointer-events:none; opacity:.5; transition:opacity .15s;
}
body.recompose-review #framesContainer > .frame{ pointer-events:none; }
body.recompose-review #recomposeReviewBar{ pointer-events:auto; opacity:1; }
body.recompose-review #framesContainer > .frame:not(.active){ opacity:.45; }
#componentAiIgnoreBtn{ color:var(--ui-muted); }
#componentAiIgnoreBtn:hover{ background:var(--ui-surface-2); }
#componentAiAcceptBtn{ color:var(--ui-accent); font-weight:var(--font-weight-semibold); }
#componentAiAcceptBtn:hover{ background:var(--ui-surface-2); }

.plan-edit-sel-toolbar{
  position:fixed; z-index:var(--z-toolbar); display:none; align-items:center;
  background:var(--md-color-grey-white); border-radius:10px; padding:4px; gap:2px;
  box-shadow:var(--shadow-popover);
}
.plan-edit-sel-toolbar.open{ display:flex; }
#planEditAskSelBtn{ font-family:var(--font-sans); font-size:var(--text-md); font-weight:var(--font-weight-medium); width:auto; white-space:nowrap; }

#planAiReviewToolbar{
  position:fixed; z-index:var(--z-toolbar); display:none; align-items:center; gap:2px;
  background:var(--md-color-grey-white); border-radius:10px; padding:4px; box-shadow:var(--shadow-popover);
}
#planAiReviewToolbar.open{ display:flex; }
#planAiIgnoreBtn{ color:var(--ui-muted); }
#planAiIgnoreBtn:hover{ background:var(--ui-surface-2); }
#planAiAcceptBtn{ color:var(--ui-accent); font-weight:var(--font-weight-semibold); }
#planAiAcceptBtn:hover{ background:var(--ui-surface-2); }

#commentsResolveBar{
  position:fixed; z-index:var(--z-toolbar); display:flex; align-items:center; gap:2px;
  background:var(--md-color-grey-white); border-radius:10px; padding:4px 6px; border:2px solid transparent;
  box-shadow:var(--shadow-popover);
  opacity:0; visibility:hidden; transform:translateY(14px);
  transition:opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
#commentsResolveBar.open{ opacity:1; visibility:visible; transform:translateY(0); transition:opacity .22s ease, transform .22s ease; }
@keyframes cr-bar-pulse-border{
  0%, 100%{ border-color:transparent; box-shadow:var(--shadow-popover); }
  50%{ border-color:rgba(0,64,222,0.35); box-shadow:var(--shadow-popover), 0 0 0 3px rgba(0,64,222,0.12); }
}
#commentsResolveBar.cr-bar-attention{ animation:cr-bar-pulse-border .9s ease-in-out 1; }
.cr-bar-group{ display:flex; align-items:center; gap:2px; }
#commentsResolveBar button{
  height:28px; min-width:28px; padding:0 8px; border:none; border-radius:6px; background:transparent;
  color:var(--ui-muted); font-size:var(--text-base); cursor:pointer; display:flex; align-items:center; justify-content:center;
}
#commentsResolveBar button:hover{ background:var(--ui-surface-2); color:var(--ui-text); }
#crBarCount{ font-family:var(--font-sans); font-size:var(--text-md); color:var(--ui-muted); padding:0 4px; white-space:nowrap; }
#crBarAcceptBtn{ color:var(--ui-accent); }
#commentsResolveBar button:disabled{ opacity:.35; cursor:not-allowed; }
#commentsResolveBar button:disabled:hover{ background:transparent; color:var(--ui-muted); }
.cr-bar-sep{ width:1px; align-self:stretch; margin:4px 2px; background:var(--ui-border); }
.cr-field-highlight{ outline:2px solid var(--ui-accent); outline-offset:2px; border-radius:2px; }
.link-popover{
  position:fixed; z-index:var(--z-toolbar-popover); display:none; flex-direction:column; gap:10px;
  background:var(--md-color-grey-white); border:1px solid var(--ui-border); border-radius:10px; padding:12px; width:300px;
  box-shadow:var(--shadow-popover);
}
.link-popover.open{ display:flex; }
.link-popover-actions{ display:flex; justify-content:flex-end; }
.link-popover-actions-split{ justify-content:space-between; }
.link-popover input.invalid{ border-color:var(--ui-danger); }
.link-input-error{ display:none; margin-top:-6px; font-size:var(--text-sm); color:var(--ui-danger); }
.link-input-error.show{ display:block; }
.link-hover-preview{ flex-direction:row; align-items:center; gap:8px; width:auto; max-width:320px; padding:8px 10px; }
.link-hover-preview i.fa-globe{ color:var(--ui-muted); flex-shrink:0; font-size:var(--text-base); }
.link-hover-name{ font-size:var(--text-md); color:var(--ui-text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:160px; }
.link-ghost-btn{ padding:5px 8px; gap:4px; flex-shrink:0; }
[data-field] a[data-field-link]{ text-decoration:underline; color:inherit; cursor:text; }
#framesContainer [contenteditable] b, #framesContainer [contenteditable] strong{ font-weight:700; }
.ai-gradient-text{
  background:var(--ui-ai-gradient);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  caret-color:var(--ui-text);
}
.ai-gradient-text-animated{
  background-size:250% 100%; animation:ai-gradient-shift 1.6s linear infinite;
}
@keyframes ai-gradient-shift{
  0%{ background-position:0% 50%; }
  100%{ background-position:100% 50%; }
}
.ai-gradient-text .ai-word{
  background:var(--ui-ai-gradient);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  background-size:calc(var(--ai-span, 100%) * 2.5) 100%;
  background-position:calc(-1 * var(--ai-x, 0px)) 50%;
}
.ai-gradient-text-animated .ai-word{
  animation:aiWordIn .35s ease forwards, ai-word-gradient-shift 1.6s linear infinite;
  animation-delay:0s, var(--ai-phase, 0s);
}
@keyframes ai-word-gradient-shift{
  0%{ background-position:calc(-1 * var(--ai-x, 0px)) 50%; }
  100%{ background-position:calc(-1 * var(--ai-x, 0px) - var(--ai-span, 100%) * 1.5) 50%; }
}

#commentsPanel{ display:flex; flex-direction:column; flex:1; min-height:0; gap:10px; }
#commentsPanel.hidden{ display:none; }
.comments-list{ flex:1; min-height:0; overflow-y:auto; padding:2px 0 8px; display:flex; flex-direction:column; gap:14px; }
.comment-entry{ border:1px solid var(--ui-border); border-radius:8px; padding:10px; font-size:var(--text-md); }
.comment-entry .ctx{ color:var(--ui-muted); font-size:var(--text-sm); margin-bottom:2px; }
.comment-entry .ctx-quote{ color:var(--ui-muted); font-size:var(--text-sm); margin-bottom:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.comment-entry .ctx-deleted-tag{
  display:inline-flex; align-items:center; gap:5px; margin-bottom:4px; padding:2px 8px;
  border-radius:20px; background:var(--md-neutral-background-2-rest); color:var(--ui-muted);
  font-size:var(--text-sm);
}
.comment-entry .ctx-deleted-tag i{ font-size:var(--text-xs); }
.comment-entry .note{ color:var(--ui-text); }
.comment-entry .note.note-clamp{ display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
.comment-entry:not(.comment-entry-focused){ cursor:pointer; }
.comment-replies-summary{ display:flex; align-items:center; gap:8px; margin-top:8px; }
.comment-avatar-stack{ display:flex; align-items:center; }
.comment-avatar-stack .comment-avatar{
  width:20px; height:20px; font-size:var(--text-xs); margin-left:-7px;
  box-shadow:0 0 0 2px var(--ui-surface);
}
.comment-avatar-stack .comment-avatar:first-child{ margin-left:0; }
.comment-avatar-more{
  background:var(--md-neutral-background-2-rest); color:var(--ui-muted); font-family:var(--font-sans);
  font-size:var(--text-xs); font-weight:var(--font-weight-semibold);
}
.comment-replies-count{ font-size:var(--text-xs); color:var(--ui-muted); }
.comment-entry .entry-actions{ display:flex; justify-content:flex-end; margin-top:6px; }
.comment-avatar{
  width:32px; height:32px; border-radius:50%; flex-shrink:0; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
}
.comment-avatar img{ width:100%; height:100%; object-fit:cover; display:block; }
.comment-avatar-initial{
  background:var(--ui-accent); color:var(--md-color-grey-white); font-family:var(--font-sans);
  font-size:var(--text-base); font-weight:var(--font-weight-semibold);
}
.comment-avatar-omega{ object-fit:contain; }
.comment-reply-pending .comment-avatar-omega{ animation:omega-avatar-pulse 1.3s ease-in-out infinite; }
@keyframes omega-avatar-pulse{ 0%,100%{ transform:scale(1); opacity:1; } 50%{ transform:scale(0.85); opacity:0.5; } }
.omega-reply-progress{ color:var(--ui-muted); animation:ai-rewrite-pulse 1.1s ease-in-out infinite; }
.comment-entry-header{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.comment-entry-header-text{ display:flex; flex-direction:column; gap:1px; min-width:0; }
.comment-date{ font-size:var(--text-xs); color:var(--ui-muted); }
.comments-footer{ padding:12px 0 4px; border-top:1px solid var(--ui-border); flex-shrink:0; }
.comments-footer .panel-hint{ margin-bottom:8px; }
.comments-footer .btn-block + .btn-block{ margin-top:8px; }
#commentsExportFallback{ width:100%; min-height:90px; margin-top:8px; font-size:var(--text-sm); font-family:var(--font-mono); }
.comments-tab-seg{ margin:0 0 2px; flex-shrink:0; }
.comments-filter-row{ display:flex; align-items:center; gap:8px; margin:0 0 2px; }
.comments-new-btn{ display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 10px; border-radius:8px; font-size:var(--text-sm); color:var(--ui-text); }
.comments-new-btn i{ font-size:var(--text-sm); }
.comments-filter-wrap{ position:relative; display:flex; flex-shrink:0; margin-left:auto; }
.comments-filter-btn{
  position:relative; display:flex; align-items:center; gap:6px; height:28px; padding:0 8px; border:1px solid var(--ui-border);
  background:var(--md-color-grey-white); border-radius:8px; cursor:pointer; font-size:var(--text-sm); color:var(--ui-muted);
}
.comments-filter-dot{
  position:absolute; top:-4px; right:-4px; width:9px; height:9px; border-radius:50%;
  background:var(--ui-accent); box-shadow:0 0 0 2px var(--ui-surface);
}
.comments-filter-dot.hidden{ display:none; }
.comment-entry-compose{ cursor:default; }
.comment-entry-compose .comment-compose-input{
  width:100%; min-height:60px; max-height:160px; overflow-y:auto; box-sizing:border-box; margin-top:2px;
  font-family:var(--font-sans); font-size:var(--text-md); color:var(--ui-text); border:1px solid var(--ui-border);
  border-radius:6px; padding:6px; outline:none; white-space:pre-wrap; word-break:break-word; cursor:text;
}
.comment-entry-compose .comment-compose-input:focus{ border-color:var(--ui-accent); }
.comment-entry-compose .comment-compose-input:empty:before{ content:attr(data-placeholder); color:var(--ui-muted); }
.comment-entry-compose .entry-actions{ gap:6px; margin-top:8px; }
.comments-filter-btn:hover{ background:var(--ui-surface-2); }
.comments-filter-menu{ min-width:180px; }
.comments-filter-option{ justify-content:space-between; }
.comments-filter-check{ opacity:0; font-size:var(--text-md); color:var(--ui-accent); }
.comments-filter-option.active .comments-filter-check{ opacity:1; }
.comments-slide-filter-option{ justify-content:flex-start; gap:8px; }
.comments-slide-filter-checkbox{
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
  width:16px; height:16px; border-radius:4px; border:1.5px solid var(--ui-border); background:var(--md-color-grey-white);
  color:transparent; font-size:var(--text-2xs);
}
.comments-slide-filter-checkbox.checked{ background:var(--ui-accent); border-color:var(--ui-accent); color:var(--md-color-grey-white); }

.generic-ai-popover{
  position:fixed; z-index:var(--z-toolbar-popover); display:flex; flex-direction:column; gap:8px;
  background:var(--md-color-grey-white); border:1px solid var(--ui-border); border-radius:10px; padding:10px; width:280px;
  box-shadow:var(--shadow-popover);
}
.generic-ai-quick-options{ display:flex; flex-direction:column; gap:4px; }
.generic-ai-quick-btn{
  border:none; background:none;
  border-radius:8px; padding:6px 10px; font-family:var(--font-sans); font-size:var(--text-sm);
  color:var(--ui-text); cursor:pointer; text-align:left; width:100%;
}
.generic-ai-quick-btn:hover{ background:var(--md-neutral-background-2-rest); }
.slash-command-menu{ min-width:180px; }
.slash-command-menu button{ gap:8px; }
.card-grip-menu{ min-width:120px; max-width: 140px;}
.comment-entry{ position:relative; }
.comment-ellipsis-btn, .comment-reply-ellipsis-btn, .comment-resolve-btn{
  position:absolute; top:6px; right:6px; width:22px; height:22px; font-size:var(--text-sm);
  opacity:0; transition:opacity .12s ease; background:var(--ui-surface); border-radius:6px;
}
.comment-entry:hover .comment-ellipsis-btn,
.comment-entry:has(.comment-entry-menu.open) .comment-ellipsis-btn{ opacity:1; }
.comment-entry-menu{ top:26px; right:6px; }
.comment-resolve-btn{ right:32px; font-size:var(--text-md); }
.comment-entry:hover .comment-resolve-btn,
.comment-entry:has(.comment-entry-menu.open) .comment-resolve-btn{ opacity:1; }
.comment-resolve-btn.is-resolved{ color:var(--ui-accent); }
.comment-author{ font-size:var(--text-md); font-weight:var(--font-weight-semibold); color:var(--ui-text); }
.comment-edit-textarea{
  width:100%; box-sizing:border-box; min-height:60px; font-family:var(--font-sans);
  font-size:var(--text-md); color:var(--ui-text); border:1px solid var(--ui-border); border-radius:6px;
  padding:6px 8px; resize:vertical; outline:none;
}
.comment-edit-textarea:focus{ border-color:var(--ui-accent); }
.comment-replies{ margin-top:8px; padding-top:8px; border-top:1px solid var(--ui-border); display:flex; flex-direction:column; gap:8px; }
.comment-reply{ position:relative; font-size:var(--text-md); color:var(--ui-text); }
.comment-reply-body{ margin-top:6px; }
.comment-reply:hover .comment-reply-ellipsis-btn,
.comment-reply:has(.comment-entry-menu.open) .comment-reply-ellipsis-btn{ opacity:1; }
.comment-reply .comment-entry-menu{ top:26px; right:6px; }
.comment-entry-focused{ border-color:var(--ui-accent); box-shadow:0 0 0 1px var(--ui-accent); }
.comment-mention-tag{ color:var(--ui-accent); background:rgba(0,64,222,0.10); border-radius:4px; padding:0 3px; }
.comment-pending-highlight{ background:rgba(0,64,222,0.16); border-radius:2px; }
.comment-reply-composer{ margin-top:8px; }
.comment-reply-input-wrap{ position:relative; display:flex; }
.comment-reply-input{
  flex:1; min-width:0; font-family:var(--font-sans); font-size:var(--text-md); color:var(--ui-text);
  border:1px solid var(--ui-border); border-radius:16px; padding:7px 34px 7px 10px; outline:none;
  background:var(--ui-surface); box-sizing:border-box;
}
div.comment-reply-input{
  min-height:32px; max-height:120px; overflow-y:auto; white-space:pre-wrap; word-break:break-word; cursor:text; line-height:1.35;
}
div.comment-reply-input:empty:before{ content:attr(data-placeholder); color:var(--ui-muted); pointer-events:none; }
.comment-reply-input:focus{ border-color:var(--ui-accent); }
.comment-reply-send-btn{
  position:absolute; top:50%; right:4px; transform:translateY(-50%);
  width:24px; height:24px; border-radius:50%; font-size:var(--text-sm);
}
.comment-mention-menu{
  position:fixed; z-index:var(--z-float); background:var(--md-color-grey-white); border:1px solid var(--ui-border); border-radius:8px;
  box-shadow:var(--shadow-soft); padding:4px; display:flex; flex-direction:column; gap:2px;
  max-height:160px; overflow-y:auto;
}
.comment-mention-menu button{
  display:flex; align-items:center; gap:8px; text-align:left; border:none; background:none;
  padding:6px 8px; border-radius:5px; cursor:pointer;
  font-family:var(--font-sans); font-size:var(--text-md); color:var(--ui-text);
}
.comment-mention-menu button:hover, .comment-mention-menu button.active{ background:var(--ui-surface-2); }
.comment-mention-text{ display:flex; flex-direction:column; gap:1px; min-width:0; }
.comment-mention-name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.comment-mention-email{ font-size:var(--text-xs); color:var(--ui-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.props-header{ display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--ui-border); }
.props-header:active{ cursor:grabbing; }
.props-header span{ font-size:var(--text-base); font-weight:var(--font-weight-semibold); color:var(--ui-text); font-family:var(--font-display)}
.rail-panel-header-title{ display:flex; align-items:center; gap:4px; }
.props-body{ padding:6px 4px 14px; display:flex; flex-direction:column; gap:12px; }
.prop-section-label{ font-size:var(--text-xs); font-weight:var(--font-weight-extralight); color:var(--ui-muted); text-transform:uppercase; letter-spacing:0.03em; margin:0 0 4px -4px; }
.prop-section-divider{ height:1px; background:var(--ui-border); border:none; margin:8px -4px; }
.prop-section-header-row{ display:flex; align-items:center; justify-content:space-between; margin:0 0 -6px; }
.prop-section-header-row .prop-section-label{ margin:0; }
.prop-section-header-row .icon-btn-ghost{ width:24px; height:24px; font-size:var(--text-md); }
.props-body input[type="range"]{ -webkit-appearance:none; appearance:none; width:100%; height:4px; border:none; border-radius:999px; background:var(--md-neutral-background-2-rest); outline:none; }
.props-body input[type="range"]::-webkit-slider-thumb{ -webkit-appearance:none; appearance:none; width:14px; height:14px; border-radius:50%; background:var(--ui-accent); border:2px solid var(--md-color-grey-white); box-shadow:var(--shadow-xs); cursor:pointer; }
.props-body input[type="range"]::-moz-range-thumb{ width:14px; height:14px; border-radius:50%; background:var(--ui-accent); border:2px solid var(--md-color-grey-white); box-shadow:var(--shadow-xs); cursor:pointer; }
.props-body input[type="range"]::-moz-range-track{ height:4px; border:none; border-radius:999px; background:var(--md-neutral-background-2-rest); }
.tag-field-inner{ display:flex; flex-direction:column; gap:12px; }
.tag-field-label-icon-row{ display:flex; gap:8px; align-items:flex-start; }
.tag-field-label-icon-row .tag-field-label{ flex:2; min-width:0; }
.tag-field-label-icon-row .tag-field-icon{ flex:1; min-width:0; }
.prop-field{ display:flex; flex-direction:column; gap:5px; font-size:var(--text-sm); color:var(--ui-muted); font-family:var(--font-regular)}
.file-dropzone{
  border:1px dashed var(--ui-border); border-radius:8px; padding:32px 16px; text-align:center;
  font-size:var(--text-base); color:var(--ui-muted); line-height:1.6;
  display:flex; flex-direction:column; align-items:center; gap:8px;
}
.file-dropzone-icon{ width:48px; height:48px; }
.file-dropzone.drag-over{ border-color:var(--ui-accent); background:var(--ui-surface-2); }
.file-dropzone-link{ color:var(--md-brand-foreground-1-rest); text-decoration:underline; cursor:pointer; }
#fileImportBody:has(.file-import-review){ overflow:visible; }
.file-import-review{ display:flex; flex-direction:column; gap:12px; }
.file-import-filecard{
  display:flex; align-items:center; gap:8px; padding:10px 12px; border:1px solid var(--ui-border);
  border-radius:8px; background:var(--md-neutral-background-2-rest); font-size:var(--text-base); color:var(--ui-text);
}
.file-import-filecard i{ color:var(--ui-muted); }
.file-import-filecard-name{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-import-select{ position:relative; width:100%; }
.file-import-reading{
  display:flex; align-items:center; justify-content:center; gap:10px; height:180px;
  color:var(--ui-muted); font-size:var(--text-base);
}
.file-import-spinner{
  width:16px; height:16px; border-radius:50%; flex-shrink:0;
  border:2px solid var(--ui-border); border-top-color:var(--ui-accent);
  animation:file-import-spin .7s linear infinite;
}
@keyframes file-import-spin{ to{ transform:rotate(360deg); } }
.file-import-error{ margin:10px 0 0; font-size:var(--text-md); color:var(--ui-danger); }

.file-import-select-trigger{
  width:100%; box-sizing:border-box; display:flex; justify-content:space-between; align-items:center; gap:8px;
  padding:12px 9px; border:1px solid var(--ui-border); border-radius:8px; background:var(--md-color-grey-white); cursor:pointer;
  font-size:var(--text-base); font-family:var(--font-sans); color:var(--ui-text);
}
.file-import-select-trigger span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-import-select-trigger:hover{ border-color:var(--ui-accent); }
.file-import-select-menu{
  display:none; flex-direction:column; position:absolute; top:calc(100% + 4px); left:0; right:0; max-height:260px;
  background:var(--md-color-grey-white); border:1px solid var(--ui-border); border-radius:8px; box-shadow:var(--shadow-soft); padding:6px; gap:2px; z-index:10;
}
.file-import-select.open .file-import-select-menu{ display:flex; }
.file-import-select-search-box{ margin-bottom:4px; }
.file-import-select-search{ font-family:var(--font-sans); }
.file-import-select-search-box .file-import-select-search{ padding-left:32px; padding-right:28px; }
.file-import-select-options{ overflow-y:auto; display:flex; flex-direction:column; gap:2px; }
.file-import-select-option{ display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:6px; font-size:var(--text-base); cursor:pointer; }
.file-import-select-option:hover{ background:var(--md-neutral-background-2-rest); }
.file-import-select-all{ font-weight:var(--font-weight-semibold); border-bottom:1px solid var(--ui-border); border-radius:0; margin-bottom:2px; padding-bottom:8px; }
.prop-field:has(> .file-import-select){ position:relative; display:block; }
.prop-field:has(> .file-import-select) > span:first-child{
  position:absolute; left:9px; top:0; font-size:var(--text-xs); line-height:1; transform:translateY(-50%);
  background:var(--md-color-grey-white); padding:0 3px; margin-left:-3px; z-index:1; pointer-events:none;
}
.file-import-review-actions{ display:flex; justify-content:flex-end; gap:8px; }
.prop-field input, .prop-field textarea, .prop-field select{
  font-family:var(--font-sans);
  font-size:var(--text-base);
  color:var(--ui-text);
  border:1px solid var(--ui-border);
  border-radius:8px;
  padding:7px 9px;
  outline:none;
  resize:vertical;
}
.prop-field input:focus, .prop-field textarea:focus, .prop-field select:focus{ border-color:var(--ui-accent); }
.prop-field:has(> input:not([type="range"])), .prop-field:has(> textarea), .prop-field:has(> select){
  position:relative; display:block;
}
.prop-field:has(> input:not([type="range"])) > span:first-child,
.prop-field:has(> textarea) > span:first-child,
.prop-field:has(> select) > span:first-child{
  position:absolute; left:9px; top:50%; transform:translateY(-50%); font-size:var(--text-base); line-height:1;
  background:var(--md-color-grey-white); padding:0 3px; margin-left:-3px;
  transition:top .15s ease, font-size .15s ease, color .15s ease;
  pointer-events:none; z-index:1;
}
.prop-field:has(> textarea) > span:first-child{ top:12px; transform:none; }
.prop-field:has(> input:not([type="range"])) input,
.prop-field:has(> textarea) textarea,
.prop-field:has(> select) select{
  width:100%; box-sizing:border-box; padding:12px 9px;
}
.prop-field input::placeholder, .prop-field textarea::placeholder{ color:transparent; }
.prop-field:has(> input:not([type="range"]):focus) > span:first-child,
.prop-field:has(> input:not([type="range"]):not(:placeholder-shown)) > span:first-child,
.prop-field:has(> textarea:focus) > span:first-child,
.prop-field:has(> textarea:not(:placeholder-shown)) > span:first-child,
.prop-field:has(> select) > span:first-child{
  top:0; font-size:var(--text-xs); transform:translateY(-50%);
}
.prop-field:has(> input:not([type="range"]):focus) > span:first-child,
.prop-field:has(> textarea:focus) > span:first-child,
.prop-field:has(> select:focus) > span:first-child{
  color:var(--ui-accent);
}
.prop-field:has(> .date-field > input){ position:relative; display:block; }
.prop-field:has(> .date-field > input) > span:first-child{
  position:absolute; left:9px; top:50%; transform:translateY(-50%); font-size:var(--text-base); line-height:1;
  background:var(--md-color-grey-white); padding:0 3px; margin-left:-3px;
  transition:top .15s ease, font-size .15s ease, color .15s ease;
  pointer-events:none; z-index:1;
}
.prop-field:has(> .date-field > input) > .date-field{ width:100%; }
.prop-field:has(> .date-field > input) > .date-field > input{ flex:1; min-width:0; box-sizing:border-box; padding:12px 9px; }
.prop-field:has(> .date-field > input:focus) > span:first-child,
.prop-field:has(> .date-field > input:not(:placeholder-shown)) > span:first-child{
  top:0; font-size:var(--text-xs); transform:translateY(-50%);
}
.prop-field:has(> .date-field > input:focus) > span:first-child{ color:var(--ui-accent); }
.prop-field select{ appearance:none; -webkit-appearance:none; padding-right:28px; cursor:pointer; }
.prop-select-chevron{ position:absolute; right:11px; top:50%; transform:translateY(-50%); font-size:var(--text-sm); color:var(--ui-muted); pointer-events:none; }
.prop-toggle-row{ display:flex; align-items:center; justify-content:space-between; font-size:var(--text-base); color:var(--ui-text); font-family: "lexend Regular" }
.prop-sync-check{ display:flex; align-items:center; gap:8px; font-size:var(--text-md); color:var(--ui-text-2); cursor:pointer; }
.prop-checkbox-row{ display:flex; align-items:center; gap:8px; font-size:var(--text-base); color:var(--ui-text); cursor:pointer; }
.prop-sync-check input[type="checkbox"],
.prop-checkbox-row input[type="checkbox"],
.file-import-select-option input[type="checkbox"],
.slide-picker-checkbox{
  appearance:none; -webkit-appearance:none; margin:0; padding:0; flex-shrink:0; cursor:pointer;
  width:16px; height:16px; border-radius:5px; border:1.5px solid var(--ui-border);
  background:var(--md-color-grey-white); position:relative; transition:border-color .15s ease, background-color .15s ease;
}
.prop-sync-check input[type="checkbox"]:hover,
.prop-checkbox-row input[type="checkbox"]:hover,
.file-import-select-option input[type="checkbox"]:hover,
.slide-picker-checkbox:hover,
.prop-sync-check input[type="checkbox"]:focus-visible,
.prop-checkbox-row input[type="checkbox"]:focus-visible,
.file-import-select-option input[type="checkbox"]:focus-visible,
.slide-picker-checkbox:focus-visible{
  border-color:var(--ui-accent);
}
.prop-sync-check input[type="checkbox"]:checked,
.prop-checkbox-row input[type="checkbox"]:checked,
.file-import-select-option input[type="checkbox"]:checked,
.slide-picker-checkbox:checked{
  background:var(--ui-accent); border-color:var(--ui-accent);
}
.prop-sync-check input[type="checkbox"]:checked::after,
.prop-checkbox-row input[type="checkbox"]:checked::after,
.file-import-select-option input[type="checkbox"]:checked::after,
.slide-picker-checkbox:checked::after{
  font-family:"Font Awesome 6 Pro"; font-weight:var(--font-weight-black); content:"\f00c";
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); font-size:var(--text-xs); color:var(--md-color-grey-white);
}
.prop-checkbox-row input[type="checkbox"]:indeterminate{ background:var(--ui-accent); border-color:var(--ui-accent); }
.prop-checkbox-row input[type="checkbox"]:indeterminate::after{
  content:""; position:absolute; top:50%; left:50%; width:8px; height:2px; border-radius:1px;
  transform:translate(-50%,-50%); background:var(--md-color-grey-white);
}
.prop-radio-group{ display:flex; flex-direction:column; gap:10px; }
.prop-checkbox-row input[type="radio"]{
  appearance:none; -webkit-appearance:none; margin:0; flex-shrink:0; cursor:pointer;
  width:16px; height:16px; border-radius:50%; border:1.5px solid var(--ui-border);
  background:var(--md-color-grey-white); position:relative; transition:border-color .15s ease;
}
.prop-checkbox-row input[type="radio"]:hover,
.prop-checkbox-row input[type="radio"]:focus-visible,
.prop-checkbox-row input[type="radio"]:checked{ border-color:var(--ui-accent); }
.prop-checkbox-row input[type="radio"]:checked::after{
  content:""; position:absolute; top:50%; left:50%; width:8px; height:8px; border-radius:50%;
  transform:translate(-50%,-50%); background:var(--ui-accent);
}

.switch{
  --switch-w: 38px; --switch-h: 20px; --switch-pad: 2px; --switch-knob-scale: 1.3;
  --switch-knob-w: calc((var(--switch-h) - var(--switch-pad) * 2) * var(--switch-knob-scale));
  --switch-track-off: var(--ui-border-strong); --switch-track-off-border: var(--ui-border-strong);
  --switch-track-on: var(--ui-accent); --switch-knob: var(--md-color-grey-white);
  position:relative; display:inline-block; width:var(--switch-w); height:var(--switch-h); flex-shrink:0;
}
.switch input{ opacity:0; width:0; height:0; }
.switch-slider{
  position:absolute; cursor:pointer; inset:0;
  background:var(--switch-track-off); box-shadow:inset 0 0 0 1px var(--switch-track-off-border);
  transition:background .25s ease, box-shadow .25s ease; border-radius:calc(var(--switch-h) / 2);
}
.switch-slider:before{
  position:absolute; content:""; box-sizing:border-box;
  height:calc(var(--switch-h) - var(--switch-pad) * 2); width:var(--switch-knob-w);
  left:var(--switch-pad); top:var(--switch-pad); background:var(--switch-knob);
  transition:transform .16s ease-out; border-radius:calc((var(--switch-h) - var(--switch-pad) * 2) / 2);
}
.switch input:checked + .switch-slider{ background:var(--switch-track-on); box-shadow:inset 0 0 0 1px var(--switch-track-on); }
.switch input:checked + .switch-slider:before{ transform:translateX(calc(var(--switch-w) - var(--switch-knob-w) - var(--switch-pad) * 2)); }


.switch.is-mixed .switch-slider{
  background:var(--switch-track-on); box-shadow:inset 0 0 0 1px var(--switch-track-on);
}
.switch.is-mixed .switch-slider:before{
  width:calc(var(--switch-knob-w) * 0.55);
  height:3px; top:calc((var(--switch-h) - 3px) / 2); border-radius:2px;
  transform:translateX(calc((var(--switch-w) - var(--switch-knob-w) * 0.55 - var(--switch-pad) * 2) / 2));
}

.comment-mention-menu button.comment-mention-noaccess{ opacity:0.75; }
.comment-mention-noaccess-tag{
  margin-left:auto; flex-shrink:0; padding:1px 6px; border-radius:5px; white-space:nowrap;
  font-size:var(--text-2xs); font-weight:var(--font-weight-semibold); color:var(--ui-danger); background:rgba(214,69,69,0.12);
}
