:root{--blue:#b82f75;--theme-hover:#94215d;--theme-soft:#fceaf3;--theme-border:#edbcd4;--theme-page:#fff6fa}
:root[data-theme=blue]{--blue:#215ccc;--theme-hover:#174bad;--theme-soft:#edf3fc;--theme-border:#c4d5ee;--theme-page:#f4f6fb}
:root[data-theme=purple]{--blue:#7542b5;--theme-hover:#5e3295;--theme-soft:#f2ebfc;--theme-border:#d7c2ed;--theme-page:#f9f6fe}
:root[data-theme=green]{--blue:#16754e;--theme-hover:#105d3d;--theme-soft:#e8f6ef;--theme-border:#b8dfcc;--theme-page:#f3faf6}
:root[data-theme=orange]{--blue:#ad4b14;--theme-hover:#8c3b0e;--theme-soft:#fff0e5;--theme-border:#edc6aa;--theme-page:#fff8f2}
@media screen{
  :root,body{background:var(--theme-page)}
  .topbar{background:linear-gradient(110deg,#fff,var(--theme-soft))}
  .topbar #print,.task-next,.workspace-continue{background:var(--blue);border-color:var(--blue);color:#fff}
  .topbar #print:hover,.task-next:hover,.workspace-continue:hover{background:var(--theme-hover)}
  .theme-control{display:flex;flex-wrap:wrap;align-items:center;gap:7px;color:#41566a;font-size:12px;white-space:nowrap;min-width:0}
  .theme-control select{width:145px;min-height:44px;border-color:var(--theme-border);color:var(--blue);background:#fff;font-size:12px}
  .theme-picker{display:flex;align-items:center;gap:5px;cursor:pointer;font-size:11px}
  .theme-picker input{width:44px;height:44px;padding:3px;border:1px solid var(--theme-border);border-radius:7px;background:#fff;cursor:pointer}
  .theme-hex{display:flex;align-items:center;gap:5px;font-size:11px}
  .theme-hex input{width:104px;height:44px;border:1px solid var(--theme-border);border-radius:7px;padding:8px;color:#213448;background:#fff;font:13px Consolas,monospace;min-width:0}
  .theme-hex input[aria-invalid=true]{border-color:#a12a40}
  .theme-hex-error{flex-basis:100%;white-space:normal;font-size:11px;color:#a12a40;max-width:430px}
  :root[data-theme=custom] .topbar #print,:root[data-theme=custom] .task-next,:root[data-theme=custom] .workspace-continue,:root[data-theme=custom] .workspace-nav button[aria-selected=true]>span{background:var(--theme-surface);color:var(--theme-on);border-color:var(--theme-border)}
  :root[data-theme=custom] .topbar #print:hover,:root[data-theme=custom] .task-next:hover,:root[data-theme=custom] .workspace-continue:hover{background:var(--theme-hover);color:#fff}
  button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline-color:var(--blue)}
  input[type=checkbox],input[type=range]{accent-color:var(--blue)}
  .workspace-nav button[aria-selected=true],.task-shortcuts button[aria-pressed=true]{background:var(--theme-soft);color:var(--blue)}
  @media(max-width:1100px){
    .topbar{height:auto;min-height:68px;flex-wrap:wrap;gap:8px;padding-top:10px;padding-bottom:10px}
    .header-right{gap:8px;flex-wrap:wrap;justify-content:flex-end}
    .theme-control select{width:132px}
  }
  @media(max-width:480px){
    .header-right{width:100%;justify-content:space-between}
    .theme-control{width:100%;flex-wrap:wrap}
    .theme-control select{flex:1;min-width:150px;max-width:180px}
    .theme-picker span{display:none}
  }
}
@media print{.theme-control{display:none}}
