/* EraGlassPattern theme switch and dark palette */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:none;margin-left:auto;padding:7px 11px;border:1px solid var(--line,#e5e1d8);border-radius:999px;background:var(--card,#fff);color:var(--ink,#1f2328);font-family:inherit;font-size:13px;font-weight:600;line-height:1.2;cursor:pointer;white-space:nowrap}
.theme-toggle:hover{border-color:var(--acc,#2563eb)}.theme-toggle .theme-icon{font-size:15px;line-height:1}
header.top .tabs{margin-left:8px}
html[data-theme="dark"]{color-scheme:dark;--bg:#15191f;--card:#20262e;--ink:#e7eaf0;--mut:#a7b0bd;--line:#39424e;--acc:#8ab4ff;--accl:#263a57}
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] header.top,html[data-theme="dark"] footer.site-footer,html[data-theme="dark"] footer.site,html[data-theme="dark"] #tb,html[data-theme="dark"] #bb,html[data-theme="dark"] #hint,html[data-theme="dark"] #pvBox{background:var(--card);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .card,html[data-theme="dark"] .note,html[data-theme="dark"] .related a,html[data-theme="dark"] .pcard article,html[data-theme="dark"] .starter,html[data-theme="dark"] .pp-hero figure,html[data-theme="dark"] .faq-toc,html[data-theme="dark"] .faq-cta,html[data-theme="dark"] table,html[data-theme="dark"] .pcard .like,html[data-theme="dark"] .sortbar button{background:var(--card);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .lead,html[data-theme="dark"] .info details p,html[data-theme="dark"] details p,html[data-theme="dark"] .pcard .pbody p,html[data-theme="dark"] .gd figcaption,html[data-theme="dark"] .sp-q,html[data-theme="dark"] .faq-toc{color:#c3cad4}
html[data-theme="dark"] th,html[data-theme="dark"] .pcard .thumb,html[data-theme="dark"] .pcard .thumb .tpl,html[data-theme="dark"] .pcard .like,html[data-theme="dark"] .sortbar button,html[data-theme="dark"] kbd{background:#29313b;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .tabs a:hover,html[data-theme="dark"] .topnav a:hover{background:#29313b;color:var(--ink)}
html[data-theme="dark"] .btn,html[data-theme="dark"] select,html[data-theme="dark"] .num,html[data-theme="dark"] input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),html[data-theme="dark"] textarea{background:#29313b;color:var(--ink);border-color:#4a5665}
html[data-theme="dark"] .btn:hover:not(:disabled){background:#354253}html[data-theme="dark"] .btn.pri,html[data-theme="dark"] .cta,html[data-theme="dark"] .topnav #etsyTop{background:#2563eb;color:#fff;border-color:#2563eb}
html[data-theme="dark"] .btn.on{background:#263a57;color:#a9c9ff;border-color:#6d9de8}
html[data-theme="dark"] .dz{background:#252d37;color:var(--ink);border-color:#596575}html[data-theme="dark"] .dz:hover,html[data-theme="dark"] .dz.drag{background:#263a57}
html[data-theme="dark"] #stage,html[data-theme="dark"] #pvBody{background:#111820;border-color:var(--line)}
html[data-theme="dark"] #notice{background:#493b1d;color:#ffe4a3;border-color:#75602e}
html[data-theme="dark"] .ct td,html[data-theme="dark"] .ct th{border-color:var(--line)}html[data-theme="dark"] .ct tr[data-ids]:hover{background:#29313b}
html[data-theme="dark"] .fchip,html[data-theme="dark"] .seg,html[data-theme="dark"] .seg .btn,html[data-theme="dark"] .pp-hero figure,html[data-theme="dark"] .faq-toc{border-color:var(--line)}
html[data-theme="dark"] .sp,html[data-theme="dark"] .gd .warn{background:#352b1d;border-color:#66502b;color:#f2d9a7}html[data-theme="dark"] .sp-q,html[data-theme="dark"] .sp ul{background:#29251f;color:#eadfc9}
html[data-theme="dark"] .gd .fl,html[data-theme="dark"] .gd figure{background:var(--card);border-color:var(--line)}html[data-theme="dark"] .gd #gdV{background:#263a57;color:#a9c9ff}
html[data-theme="dark"] .pcard .chips span{background:#263a57;color:#a9c9ff}html[data-theme="dark"] .pcard .dl{color:var(--mut)}
html[data-theme="dark"] #toast{background:#e7eaf0;color:#15191f}html[data-theme="dark"] #toast.err{background:#b3261e;color:#fff}
html[data-theme="dark"] #pv{background:#000c}html[data-theme="dark"] #pvHead,html[data-theme="dark"] #pvNote{border-color:var(--line)}
html[data-theme="dark"] .theme-toggle{background:#29313b;color:#f2d28b;border-color:#4a5665}
html[data-theme="dark"] .pl{color:#333}
@media(max-width:700px){.theme-toggle{margin-left:auto;padding:6px 9px}.theme-toggle .theme-label{display:none}header.top .tabs{order:5}}
@media print{html[data-theme="dark"]{color-scheme:light}html[data-theme="dark"] body{background:#fff!important;color:#000!important}}

/* Studio-specific dark theme fixes: keep every control readable */
html[data-theme="dark"] #app{color:var(--ink)}
html[data-theme="dark"] #left,
html[data-theme="dark"] #right{
  background:#20262e!important;
  color:#e7eaf0!important;
  border-color:#39424e!important;
}
html[data-theme="dark"] #left .card,
html[data-theme="dark"] #right .card{
  background:transparent!important;
  color:#e7eaf0!important;
  border-color:#39424e!important;
}
html[data-theme="dark"] #left .card h2,
html[data-theme="dark"] #right .card h2,
html[data-theme="dark"] #left .lbl,
html[data-theme="dark"] #right .lbl,
html[data-theme="dark"] #left label,
html[data-theme="dark"] #right label,
html[data-theme="dark"] #left p,
html[data-theme="dark"] #right p,
html[data-theme="dark"] #left strong,
html[data-theme="dark"] #right strong,
html[data-theme="dark"] #left .rp,
html[data-theme="dark"] #right .rp{
  color:#e7eaf0!important;
}
html[data-theme="dark"] #left small,
html[data-theme="dark"] #right small,
html[data-theme="dark"] #left .muted,
html[data-theme="dark"] #right .muted,
html[data-theme="dark"] #left .sub,
html[data-theme="dark"] #right .sub{
  color:#aeb8c6!important;
}
html[data-theme="dark"] #left .rp,
html[data-theme="dark"] #right .rp,
html[data-theme="dark"] #left .fchip,
html[data-theme="dark"] #right .fchip,
html[data-theme="dark"] #left .dz,
html[data-theme="dark"] #right .dz{
  background:#29313b!important;
  border-color:#465262!important;
}
html[data-theme="dark"] #left .dz:hover,
html[data-theme="dark"] #right .dz:hover,
html[data-theme="dark"] #left .dz.drag,
html[data-theme="dark"] #right .dz.drag{
  background:#263a57!important;
}
html[data-theme="dark"] #left input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),
html[data-theme="dark"] #right input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),
html[data-theme="dark"] #left select,
html[data-theme="dark"] #right select,
html[data-theme="dark"] #left textarea,
html[data-theme="dark"] #right textarea{
  background:#151b23!important;
  color:#edf1f7!important;
  border-color:#4a5665!important;
}
html[data-theme="dark"] #left input::placeholder,
html[data-theme="dark"] #right input::placeholder,
html[data-theme="dark"] #left textarea::placeholder,
html[data-theme="dark"] #right textarea::placeholder{
  color:#9aa6b5!important;
}
html[data-theme="dark"] #work{
  background:#20262e!important;
  border-color:#39424e!important;
}
html[data-theme="dark"] #tb,
html[data-theme="dark"] #bb,
html[data-theme="dark"] #hint{
  background:#20262e!important;
  color:#e7eaf0!important;
  border-color:#39424e!important;
}
html[data-theme="dark"] #tb .btn,
html[data-theme="dark"] #bb .btn{
  background:#29313b;
  color:#e7eaf0;
  border-color:#465262;
}
html[data-theme="dark"] #tb .btn:hover:not(:disabled),
html[data-theme="dark"] #bb .btn:hover:not(:disabled){background:#354253}
html[data-theme="dark"] #stage{background:#111820!important}
/* The white paper/artboard intentionally stays white for accurate print preview. */
html[data-theme="dark"] footer.toolfoot{
  background:#20262e!important;
  color:#aeb8c6!important;
  border-top:1px solid #39424e!important;
}
html[data-theme="dark"] footer.toolfoot a{color:#9fc1ff!important}
html[data-theme="dark"] #left .card h2::after,
html[data-theme="dark"] #right .card h2::after{border-color:#aeb8c6!important}


/* Draw Pattern page: complete dark theme for the drawing workspace and side panels */
html[data-theme="dark"] main.dw-page{color:#e7eaf0}
html[data-theme="dark"] .dw-tools,
html[data-theme="dark"] .dw-ctrl,
html[data-theme="dark"] .dw-card,
html[data-theme="dark"] .shm{
  background:#20262e!important;color:#e7eaf0!important;border-color:#39424e!important;
}
html[data-theme="dark"] .tb{color:#dce3ec;border-color:transparent}
html[data-theme="dark"] .tb:hover:not(:disabled),
html[data-theme="dark"] .shm button:hover{background:#354253!important}
html[data-theme="dark"] .tb[aria-pressed=true],
html[data-theme="dark"] .shm button.on{background:#263a57!important;border-color:#6d9de8!important;color:#a9c9ff!important}
html[data-theme="dark"] .tb-sep{background:#465262}
html[data-theme="dark"] .dw-ctrl strong{color:#9fc1ff}
html[data-theme="dark"] .dw-ctrl span,
html[data-theme="dark"] .dw-sub,
html[data-theme="dark"] .dw-card small,
html[data-theme="dark"] .rc span{color:#aeb8c6!important}
html[data-theme="dark"] .dw-card h2,
html[data-theme="dark"] .dw-card .dw-ct,
html[data-theme="dark"] .dw-card summary,
html[data-theme="dark"] .dw-card label,
html[data-theme="dark"] .dw-stat,
html[data-theme="dark"] .shm button{color:#e7eaf0!important}
html[data-theme="dark"] .dw-btn,
html[data-theme="dark"] .dw-card input[type="number"],
html[data-theme="dark"] .dw-card select,
html[data-theme="dark"] .shm button{
  background:#29313b!important;color:#e7eaf0!important;border-color:#4a5665!important;
}
html[data-theme="dark"] .dw-btn:hover:not(:disabled){background:#354253!important}
html[data-theme="dark"] .dw-btn.danger{color:#ffaaa4!important}
html[data-theme="dark"] .dw-card input::placeholder{color:#9aa6b5}
html[data-theme="dark"] .dw-card input[type="range"]{accent-color:#8ab4ff}
html[data-theme="dark"] .dw-stage{background:#171e27!important;border-color:#465262!important}
html[data-theme="dark"] .dw-pos{background:rgba(32,38,46,.94)!important;color:#dce3ec!important}
html[data-theme="dark"] .dw-empty{background:rgba(32,38,46,.96)!important;color:#e7eaf0!important;border-color:#465262!important}
html[data-theme="dark"] .rc{background:#252d37!important;border-color:#465262!important;color:#e7eaf0!important}
html[data-theme="dark"] .rc:hover{background:#303b49!important}
html[data-theme="dark"] .rc.on{background:#263a57!important;border-color:#6d9de8!important}
html[data-theme="dark"] .rc svg{background:#fff;border-color:#596575}
html[data-theme="dark"] .rx{color:#ffaaa4!important}
html[data-theme="dark"] .rx:hover{background:#49302f!important}
html[data-theme="dark"] .dw-warn{color:#ffaaa4!important}
html[data-theme="dark"] .dw-ok{color:#80d6a8!important}
html[data-theme="dark"] .dw-note{background:#352b1d!important;border-color:#66502b!important;color:#f2d9a7!important}
html[data-theme="dark"] .dw-card a{color:#9fc1ff}
html[data-theme="dark"] .dw-card input[type="checkbox"]{accent-color:#8ab4ff}
