/* utono v2.0.16 — dark-mode parity and accessible shared surfaces.
   The v2.0.15 rich editor used --panel without declaring it. The previous
   fallback (#faf9f7) was the source of white editor/menu/card surfaces. */
.theme-light {
  --panel:var(--utono-card,#fff);
  --panel-raised:var(--utono-canvas,#fff);
  --utono-surface-muted:#F3F1EC;
  --utono-surface-deep:#E7E2DA;
  --utono-control-text:var(--utono-text);
  --utono-control-hover:var(--utono-selected);
  --utono-link-active:var(--utono-link);
  --utono-contrast-ring:#2D604C;
}
.theme-dark {
  --panel:var(--utono-card,#1A1D1C);
  --panel-raised:var(--surface-raised,#222623);
  --utono-surface-muted:#222623;
  --utono-surface-deep:#27332B;
  --utono-control-text:var(--utono-text);
  --utono-control-hover:var(--utono-selected);
  --utono-link-active:var(--utono-link);
  --utono-contrast-ring:#8CB3D9;
}
/* Surfaces inherit theme on desktop, mobile and floating portals, which are
   siblings of the editor rather than descendants of the note itself. */
.theme-dark :is(.utono-e2-toolbar,.utono-e2-toolbar select,.utono-yt-node,.utono-yt-body,
  .utono-yt-popup,.utono-yt-comment-form,.utono-sc-dialog){
  color:var(--utono-text);
  border-color:var(--utono-border);
}
.theme-dark .utono-e2-toolbar{
  background:var(--panel)!important;
  color:var(--utono-text);
  border:1px solid var(--line-strong);
  box-shadow:0 3px 18px rgba(0,0,0,.13);
}
.theme-dark .utono-e2-toolbar button{
  color:var(--utono-text);
  background:transparent;
  opacity:1;
}
.theme-dark .utono-e2-toolbar button:hover,
.theme-dark .utono-e2-toolbar button:focus-visible{background:var(--utono-selected);color:var(--utono-text)}
.theme-dark .utono-e2-toolbar button[disabled]{opacity:.46}
.theme-dark .utono-e2-toolbar select{
  background:var(--surface-raised);
  color:var(--utono-text);
  border-color:var(--line-strong);
}
.theme-dark .utono-e2-toolbar option{background:var(--surface-raised);color:var(--utono-text)}
.theme-dark .utono-e2-label{color:#B4D4B8}
.theme-dark .utono-e2-label small{background:#25382A;color:#DCEBDD;border-color:#45694B}
.theme-dark .utono-e2-canvas{color:var(--utono-text);caret-color:var(--utono-text)}
.theme-dark .utono-e2-canvas :is(a,.utono-yt-textlink){color:#A4CBEA}
.theme-dark .utono-e2-canvas :is(a,.utono-yt-textlink):hover{color:#D2E6F8}
/* YouTube Small / Regular / Card / Embed / Text Link: intentional opaque
   surfaces, never an ivory fallback on a dark document. */
.theme-dark .utono-yt-node{background:var(--panel);border:1px solid #3A453D;box-shadow:0 8px 25px rgba(0,0,0,.24)}
.theme-dark .utono-yt-body{background:var(--panel);color:var(--utono-text)}
.theme-dark .utono-yt-small-row,.theme-dark .utono-yt-regular-row,
.theme-dark .utono-yt-text-content{background:var(--panel);color:var(--utono-text)}
.theme-dark .utono-yt-description strong,.theme-dark .utono-yt-title{
  color:#EDEDE8;
}
.theme-dark .utono-yt-description>span,
.theme-dark .utono-yt-card-desc,
.theme-dark .utono-yt-description small{color:#B8C4BA}
.theme-dark .utono-yt-smart-footer{
  background:#242D27;
  color:#CBD5CB;
  border-color:#3A453D;
}
.theme-dark .utono-yt-channel{color:#F0F4EF}
.theme-dark .utono-yt-views,.theme-dark .utono-yt-likes,
.theme-dark .utono-yt-duration{color:#CAD7CC}
.theme-dark .utono-yt-socialbar{border-color:#38423B;color:var(--utono-text)}
.theme-dark .utono-yt-socialbar button{color:var(--utono-text)}
.theme-dark .utono-yt-socialbar button:hover,
.theme-dark .utono-yt-socialbar button:focus-visible{background:#314238}
/* Floating menus and threads are created in the document portal, not inside
   the widget. Give all headings, disabled labels and input fields real contrast. */
.theme-dark .utono-yt-popup{
  background:#202522;
  border:1px solid #47544A;
  color:#EDEDE8;
  box-shadow:0 20px 55px #0009;
  color-scheme:dark;
}
.theme-dark .utono-yt-popup button{color:#EDEDE8}
.theme-dark .utono-yt-popup button:hover,
.theme-dark .utono-yt-popup button:focus-visible,
.theme-dark .utono-yt-popup button.selected{background:#35463A;color:#F5FAF5}
.theme-dark .utono-yt-popup button[disabled]{opacity:.47}
.theme-dark .utono-yt-popup button.danger{color:#FFAAA5}
.theme-dark .utono-yt-menu-heading{color:#BED0C1}
.theme-dark .utono-yt-popup hr{border-color:#48554B}
.theme-dark .utono-yt-popup :is(input,textarea,select){
  color:var(--utono-text);background:#171E1A;border-color:#546354;
}
.theme-dark .utono-yt-popup :is(input,textarea)::placeholder{color:#B5BDB3}
.theme-dark .utono-yt-thread{background:#26362C;border-color:#87B596}
.theme-dark .utono-yt-thread.resolved{opacity:.78}
.theme-dark .utono-yt-comment-form{background:#202922;border-color:#48564A}
.theme-dark .utono-yt-thread-list{color:#EDEDE8}
.theme-dark .utono-yt-empty-comments,.theme-dark .utono-e2-link-actions>span{color:#C0CCC0}
/* Clipboard diagnostics, search, rich-media input and legacy editor popovers. */
.theme-dark .utono-sc-dialog{background:var(--panel-raised);color:var(--utono-text);color-scheme:dark}
.theme-dark .utono-sc-segment{background:var(--utono-surface-muted)}
.theme-dark .utono-sc-segment button.active{background:#3B5040;color:#F3F6F1}
.theme-dark .utono-sc-segment button:not(.active){color:#CEDACE}
.theme-dark :is(.utono-sc-feature button,.utono-sc-media-heading button,
  .utono-sc-image-actions button,.utono-sc-diagnostics button,.utono-sc-footer button){
  color:var(--utono-text);background:#2B352E;border-color:#465248;
}
.theme-dark :is(.utono-sc-feature button,.utono-sc-media-heading button,
  .utono-sc-image-actions button,.utono-sc-diagnostics button,.utono-sc-footer button):hover{
  background:#37483B;border-color:#6A8E71;
}
.theme-dark .utono-sc-warning{background:#25332A;color:#CBD6C9}
.theme-dark .utono-sc-summary span{background:#25332A;color:#CBD6C9;border-color:#445B48}
.theme-dark .utono-sc-diagnostics{color:var(--utono-text)}
.theme-dark :is(.v2-search-sheet,.v2-setting-card,.v2-profile-card,.utono-editor-inspector,
 .utono-toolbar-style-menu,.modal,.popover,.utono-sc-dialog){color-scheme:dark}
.theme-dark :is(.v2-search-sheet,.v2-setting-card,.utono-editor-inspector,
  .utono-toolbar-style-menu){color:var(--utono-text)}
.theme-dark :is(.text-field,.select-control,.v2-setting-card select,.utono-e2-toolbar select){
  color:var(--utono-text);
}
.theme-dark :is(.text-field,input,textarea,select)::placeholder{color:#AEBDAF}
/* Touch / keyboard affordances must be available without color-only cues. */
.theme-dark :is(.utono-e2-toolbar,.utono-yt-popup,.utono-sc-dialog) :is(button,a,input,textarea,select):focus-visible{
  outline:2px solid var(--utono-contrast-ring)!important;outline-offset:2px;
}
@media(forced-colors:active){
  .utono-e2-toolbar,.utono-yt-popup,.utono-yt-node{border:1px solid CanvasText}
  .utono-e2-toolbar button,.utono-yt-popup button{forced-color-adjust:auto}
}
@media(prefers-reduced-motion:reduce){
  .utono-e2-toolbar *,.utono-yt-popup *{transition:none!important}
}
/* Light-blue send action: use dark ink, not low-contrast white glyphs. */
.theme-dark .utono-yt-popup .utono-yt-comment-form button{
  background:#A9CEF6;color:#17293A;border:1px solid #BEDDF8;
}
.theme-dark .utono-yt-popup .utono-yt-comment-form button:hover,
.theme-dark .utono-yt-popup .utono-yt-comment-form button:focus-visible{
  background:#CAE4FF;color:#102032;
}
