/* HOTFIX 51: Live palettes. Applied after the legacy workstation styles. */
body[data-theme="dos"]{--ck51-accent:#88ee93;--ck51-dim:#0a2117;--ck51-main:#edf7e9;--ck51-panel:#f5fff2;--ck51-line:#367752;--ck51-ink:#193526;--ck51-highlight:#daff9c}
body[data-theme="amiga"]{--ck51-accent:#82dfff;--ck51-dim:#152d69;--ck51-main:#e9f3ff;--ck51-panel:#f6fbff;--ck51-line:#5385c3;--ck51-ink:#1b2d54;--ck51-highlight:#d3d0ff}
body[data-theme="amber"]{--ck51-accent:#ffc15c;--ck51-dim:#452c15;--ck51-main:#fff5df;--ck51-panel:#fffaf0;--ck51-line:#aa7534;--ck51-ink:#4d2c14;--ck51-highlight:#ffe6a4}
/* Keep the normal brand look completely unchanged when the default theme is chosen. */
.admin-body[data-theme]:not([data-theme="default"]){background:var(--ck51-dim)!important;color:var(--ck51-ink)}
.admin-body[data-theme]:not([data-theme="default"]) .admin-main{background:var(--ck51-main)!important;outline-color:var(--ck51-accent)}
.admin-body[data-theme]:not([data-theme="default"]) .admin-sidebar{background:var(--ck51-dim)!important;color:#fff}
.admin-body[data-theme]:not([data-theme="default"]) .admin-topbar,
.admin-body[data-theme]:not([data-theme="default"]) .window-chrome{background:var(--ck51-dim)!important;color:#fff!important;border-color:var(--ck51-accent)!important}
.admin-body[data-theme]:not([data-theme="default"]) .admin-content,
.admin-body[data-theme]:not([data-theme="default"]) .admin-footer{background:var(--ck51-main)!important;color:var(--ck51-ink)!important}
.admin-body[data-theme]:not([data-theme="default"]) .sidebar-nav a.selected{background:var(--ck51-accent)!important;color:#101e1b!important}
.admin-body[data-theme]:not([data-theme="default"]) :is(.admin-panel,.editor-side-panel,.settings-panel,.stat-card,.os-row,.ck51-page-settings){border-color:var(--ck51-line)!important;box-shadow:3px 3px 0 var(--ck51-line)!important}
.admin-body[data-theme]:not([data-theme="default"]) :is(.button-primary,.os-toolbar a,.os-toolbar button){background:var(--ck51-accent)!important;color:#101c20!important;border-color:var(--ck51-line)!important}
.admin-body[data-theme]:not([data-theme="default"]) :is(.admin-heading h1,.editor-title-area input,.sidebar-section-label){accent-color:var(--ck51-line)}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]){background-color:var(--ck51-main);color:var(--ck51-ink)}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]) :is(.site-header,.retro-taskbar){border-color:var(--ck51-accent)!important;box-shadow:0 4px 0 var(--ck51-accent)}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]) :is(.post-card,.hero-search,.search-box){border-color:var(--ck51-line)!important;box-shadow:5px 5px 0 var(--ck51-line)!important}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]) :is(.button-primary,.main-nav a.active,.hero-search button){background:var(--ck51-accent)!important;color:#101c20!important}
body[data-theme]:not([data-theme="default"]) .os-theme-panel select{border-color:var(--ck51-accent);box-shadow:0 0 0 2px var(--ck51-dim)}
/* Page workbench remains distinct from the article publishing interface. */
.ck51-page-editor{max-width:1350px}
.ck51-title-area{padding:20px 24px;border:1px solid #c9c6d2;background:#fffdf8;margin:18px 0}
.ck51-title-area .tiny-label{display:block;margin:0 0 9px}
.ck51-title-area .editor-title-input{display:block;box-sizing:border-box;width:100%;margin:0 0 21px}
.ck51-title-area .editor-slug{display:block;box-sizing:border-box;width:min(620px,100%);margin:0}
.ck51-url-note{font-size:12px;line-height:1.6;color:#594d6d;margin:9px 0 0}
.ck51-page-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,290px);gap:20px;align-items:start}
.ck51-page-grid .editor-area{min-width:0}
.ck51-page-grid .editor-textarea{min-height:450px}
.ck51-page-grid .ck25-editor-surface{min-width:0}
.ck51-page-grid .editor-bottom{flex-wrap:wrap}
.ck51-page-settings .side-panel-body{display:grid;gap:14px}
.ck51-page-settings .side-panel-body button{width:100%}
.ck51-page-settings details{border-top:1px solid #ccc;padding-top:11px}
.ck51-page-settings summary{cursor:pointer;font-weight:800}
.ck51-page-settings textarea{box-sizing:border-box;width:100%;margin-top:8px;padding:10px;min-height:75px}
.ck51-save-tip{font:700 11px ui-monospace,monospace;opacity:.8}
@media(max-width:1000px){.ck51-page-grid{grid-template-columns:1fr}.ck51-page-settings{grid-row:1}.ck51-page-settings .side-panel-body{grid-template-columns:repeat(2,minmax(0,1fr))}.ck51-page-settings .side-panel-body p,.ck51-page-settings .side-panel-body details{grid-column:1/-1}}
@media(max-width:580px){.ck51-page-settings .side-panel-body{grid-template-columns:1fr}.ck51-page-grid .editor-toolbar{overflow-x:auto}.ck51-title-area{padding:15px}.ck51-save-tip{display:none}}

.ck51-mobile-group{display:block;font:900 10px ui-monospace,monospace;letter-spacing:.08em;opacity:.72;margin:9px 0 3px;padding:5px 8px;border-bottom:1px solid currentColor}

/* HOTFIX 52: The public website is built on a dark-reading palette.  HOTFIX 51
   accidentally placed its white text on pale theme backgrounds.  Preserve
   readable light-on-dark text outdoors and dark-on-light panels in Studio. */
body[data-theme="dos"]{--ck52-public-bg:#0b2117;--ck52-public-text:#edfff0;--ck52-public-muted:#c2e9cd;--ck52-public-link:#8df5ac}
body[data-theme="amiga"]{--ck52-public-bg:#111f48;--ck52-public-text:#f0f5ff;--ck52-public-muted:#ccdcf8;--ck52-public-link:#88eaff}
body[data-theme="amber"]{--ck52-public-bg:#302014;--ck52-public-text:#fff1db;--ck52-public-muted:#ead3b3;--ck52-public-link:#ffcf79}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]){
  background:var(--ck52-public-bg)!important;color:var(--ck52-public-text)!important;
  --bg:var(--ck52-public-bg);--bg2:var(--ck52-public-bg);
  --paper:var(--ck52-public-text);
}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]) :is(.site-header,.site-footer,.retro-taskbar){
  background:var(--ck52-public-bg)!important;color:var(--ck52-public-text)!important;
}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]) :is(.hero-copy>p,.archive-hero>p,.section-heading p,.footer-main p,.footer-aside p,.prose,.ck50-page-content,.ck50-page-head){
  color:var(--ck52-public-muted)!important;
}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]) :is(.hero-copy h1,.archive-hero h1,.section-heading h2,.prose h1,.prose h2,.prose h3,.prose h4,.ck50-page-head h1){
  color:var(--ck52-public-text)!important;
}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]) :is(.main-nav a,.site-footer a,.prose a,.ck50-search-pages a){color:var(--ck52-public-link)!important}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]) .post-card{background:#fffdf6!important;color:#202334!important}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]) .post-card :is(h2,h3,p,small,span){color:inherit}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]) :is(.search-box,.hero-search){background:#11192a!important;color:#f6f8ff!important}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]) :is(.search-box input,.hero-search input){color:#f6f8ff!important;caret-color:#fff}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]) :is(.search-box input,.hero-search input)::placeholder{color:#c8cedb!important;opacity:1}
body:not(.admin-body):not(.login-body)[data-theme]:not([data-theme="default"]) .ck50-search-pages li{background:#152038;color:#f1f5ff}
/* Studio: colored chrome, but keep all reading and form surfaces consistently
   bright; explicit ink prevents legacy low-contrast muted text inheritance. */
.admin-body[data-theme]:not([data-theme="default"]){--ink:#202334;--admin-border:#9294a6;--ck45-input:#fffef8}
.admin-body[data-theme]:not([data-theme="default"]) :is(.admin-main,.admin-content,.admin-footer){background:var(--ck51-main)!important;color:#202334!important}
.admin-body[data-theme]:not([data-theme="default"]) :is(.admin-panel,.editor-side-panel,.settings-panel,.stat-card,.editor-title-area,.editor-area,.ck25-workbench-panel,.ck51-page-settings){background:#fffdf6!important;color:#202334!important}
.admin-body[data-theme]:not([data-theme="default"]) :is(.admin-heading h1,.admin-heading p,.admin-heading .tiny-label,.editor-actionbar .editor-hint,.editor-actionbar .back-link,.editor-title-area .tiny-label,.editor-title-area .editor-title-input,.editor-title-area .editor-slug,.ck51-url-note,.side-panel-body,.side-panel-body p,.side-panel-body label,.side-panel-body summary,.ck52-page-help){color:#293044!important}
.admin-body[data-theme]:not([data-theme="default"]) :is(.sidebar-nav a,.sidebar-label,.sidebar-section-label,.sidebar-bottom a,.sidebar-bottom button,.admin-sidebar .brand,.studio-name){color:#e9efff!important}
.admin-body[data-theme]:not([data-theme="default"]) .sidebar-nav a.selected{background:var(--ck51-accent)!important;color:#121f24!important}
.admin-body[data-theme]:not([data-theme="default"]) :is(.admin-topbar .admin-breadcrumb,.admin-topbar .admin-status,.window-chrome span){color:#f9fbff!important}
.admin-body[data-theme]:not([data-theme="default"]) :is(.editor-textarea,.editor-preview,.editor-visual,.ck51-page-settings input,.ck51-page-settings textarea,.ck51-page-settings select){background:#fffef9!important;color:#202334!important;opacity:1}
.admin-body[data-theme]:not([data-theme="default"]) :is(.editor-textarea,.ck51-page-settings textarea)::placeholder{color:#626a79!important;opacity:1}
.admin-body[data-theme]:not([data-theme="default"]) .editor-area .editor-preview :is(h1,h2,h3,h4,p,li){color:#202334!important}
.admin-body[data-theme]:not([data-theme="default"]) :is(.editor-area .editor-tabs,.editor-area .editor-toolbar){color:#202334}
.admin-body[data-theme]:not([data-theme="default"]) .editor-bottom{color:#344155!important}
.admin-body[data-theme]:not([data-theme="default"]) :is(a,button,input,select,textarea):focus-visible{outline:3px solid var(--ck51-line);outline-offset:2px}
/* The page editor uses WRITE's native grid, actionbar, dialog and toolbar. */
.ck52-page-grid .editor-left,.ck52-page-grid .editor-aside{min-width:0}
.ck52-page-grid .editor-aside{display:grid;gap:18px;align-content:start}
.ck52-page-grid .editor-area{width:100%}
.ck52-page-help{font-size:12px;line-height:1.6}
.ck51-page-editor .ck51-title-area{margin:0 0 20px;padding:30px 32px}
.ck51-page-editor .ck51-title-area .editor-title-input{margin:15px 0 18px}
.ck51-page-editor .ck51-title-area .editor-slug{width:min(100%,370px);padding-left:8px}
.ck51-page-editor .ck51-page-settings .side-panel-body{display:grid;grid-template-columns:1fr;gap:12px}
.ck51-page-editor .editor-actions .button{white-space:nowrap}
@media(max-width:800px){.ck51-page-editor .editor-actionbar{flex-wrap:wrap}.ck51-page-editor .editor-actions{width:100%;justify-content:flex-end}}
@media(max-width:500px){.ck51-page-editor .editor-actions .editor-hint{display:none}.ck51-page-editor .editor-actions .button{flex:1;justify-content:center}.ck51-page-editor .ck51-title-area{padding:18px}}
/* HOTFIX 52 browser QA: the old page danger card was nearly black with dark text.
   This also repairs its contrast in the unmodified default Studio palette. */
.admin-body .ck50-page-danger{background:#fff4ee!important;color:#342333!important;border:2px solid #b94951!important;box-shadow:4px 4px 0 #9b5962;max-width:none;margin-top:24px}
.admin-body .ck50-page-danger :is(h2,p){color:#342333!important;opacity:1}
.admin-body[data-theme]:not([data-theme="default"]) .admin-heading .tiny-label{color:#f9fbff!important}
.admin-body .ck51-page-editor #post-body[hidden]{display:none!important}
.admin-body .ck51-page-editor :is(#editor-preview,#editor-visual)[hidden]{display:none!important}

/* HOTFIX 53 · Page actions stay in the same editor sidebar as other settings. */
.ck51-page-settings #ck53-page-eyebrow{box-sizing:border-box;width:100%;min-height:74px;resize:vertical;padding:11px 12px;border:1px solid #818b9d;border-radius:7px;background:#fffef9;color:#202334;font:inherit;line-height:1.5}
.ck51-page-settings #ck53-page-eyebrow::placeholder{color:#606979;opacity:1}
.ck51-page-settings .ck53-eyebrow-help{display:block;font-size:12px;line-height:1.55;color:inherit;opacity:.85}
.ck51-page-editor .ck53-page-danger{border:1px solid #ab5862;background:var(--surface,#21212c);color:inherit}
.ck51-page-editor .ck53-page-danger .side-panel-body{display:grid;gap:12px}
.ck51-page-editor .ck53-page-danger h2{margin:0;font-size:1.05rem;line-height:1.3;color:inherit}
.ck51-page-editor .ck53-page-danger p{margin:0;font-size:.88rem;line-height:1.5;color:inherit}
.ck51-page-editor .ck53-page-danger .button-danger{width:100%;min-height:44px;white-space:normal}
.admin-body[data-theme]:not([data-theme="default"]) .ck51-page-editor .ck53-page-danger{background:#fff4ef!important;color:#342333!important;border-color:#ab5862!important}
.admin-body[data-theme]:not([data-theme="default"]) .ck51-page-editor .ck53-page-danger :is(h2,p){color:#342333!important}

/* HOTFIX 55: compact worklist in existing dashboard style */
/* Open work items use the regular Studio cards, not a new admin theme. */
.admin-body .ck55-open-tasks .ck55-task-links{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.admin-body .ck55-open-tasks .ck55-task-links a{display:grid;gap:7px;padding:16px;border:1px solid currentColor;border-radius:6px;color:inherit;text-decoration:none}
.admin-body .ck55-open-tasks .ck55-task-links a:hover,.admin-body .ck55-open-tasks .ck55-task-links a:focus-visible{outline:2px solid currentColor;outline-offset:2px}
.admin-body .ck55-open-tasks .ck55-task-links span{font-size:.82rem}
