/* Dark theme. Colours follow the download page's Office workflow demo (its body.dark palette, as in
   Kimi-Cards-Standalone.html) so both embedded demos read the same on a dark page.
   Active when html[data-theme=dark]; main.js sets it from ?theme=, then prefers-color-scheme, and the host page
   overrides it with a kimi-office-theme message. Appearance only: nothing here changes layout or timing. */
html[data-theme=dark]{color-scheme:dark}
/* Embedded, the page's own colour scheme (normal) keeps the frame transparent: a mismatch paints it opaque. */
html[data-theme=dark]:has(body.embed){color-scheme:normal}
html[data-theme=dark] body{background:#121212;color:rgba(255,255,255,.84)}
html[data-theme=dark] body.embed{background:transparent}
html[data-theme=dark] .win{background:#121212}
html[data-theme=dark] body.embed .stage-fit{box-shadow:none}

/* Title bar, file tabs, ribbon */
html[data-theme=dark] .win-top{background:#121212;color:rgba(255,255,255,.42)}
html[data-theme=dark] .ribbon{background:#121212;color:rgba(255,255,255,.26);border-bottom-color:rgba(255,255,255,.08)}
html[data-theme=dark] .ribbon [data-copy="file"]{color:rgba(255,255,255,.56)}
html[data-theme=dark] .rb-div{background:rgba(255,255,255,.12)}
html[data-theme=dark] .rb-kimi{color:#1a88ff}

/* Workspace, document frame, format and status bars */
html[data-theme=dark] .workspace{background:#121212}
html[data-theme=dark] .doc{background:rgba(255,255,255,.05);border-color:rgba(255,255,255,.06)}
html[data-theme=dark] .format-bar{background:transparent;color:rgba(255,255,255,.55);border-bottom-color:rgba(255,255,255,.08)}
html[data-theme=dark] .format-bar i{background:rgba(255,255,255,.1)}
html[data-theme=dark] .format-bar .fb-font{background:transparent;border-color:rgba(255,255,255,.12)}
html[data-theme=dark] .format-bar .fb-end{color:rgba(255,255,255,.3)}
html[data-theme=dark] .doc-status{background:transparent;color:rgba(255,255,255,.4);border-top-color:rgba(255,255,255,.08)}

/* Spreadsheet */
html[data-theme=dark] .xl{background:#1b1b1b}
html[data-theme=dark] .fx{border-bottom-color:rgba(255,255,255,.12);color:rgba(255,255,255,.56)}
html[data-theme=dark] .fx-addr{color:rgba(255,255,255,.56)}
html[data-theme=dark] .fx-ico{color:rgba(255,255,255,.4)}
html[data-theme=dark] .fx-formula{color:#b4cce3}
html[data-theme=dark] .fx-caret{background:rgba(255,255,255,.84)}
html[data-theme=dark] .xl-grid table{color:rgba(255,255,255,.84)}
html[data-theme=dark] .xl-grid th,html[data-theme=dark] .xl-grid td{border-bottom-color:rgba(255,255,255,.08)}
html[data-theme=dark] .xl-grid thead th,html[data-theme=dark] .xl-grid tbody th{background:#242424;color:rgba(255,255,255,.4);border-color:rgba(255,255,255,.12)}
html[data-theme=dark] .x-title .x-label,html[data-theme=dark] .x-head td{background:#243d5b;color:rgba(255,255,255,.84)}
html[data-theme=dark] .x-sub .x-label{color:rgba(255,255,255,.4)}
html[data-theme=dark] .x-period td{background:#242424;color:rgba(255,255,255,.56)}
html[data-theme=dark] .x-section td{background:#303030;color:rgba(255,255,255,.84);border-color:rgba(255,255,255,.18)}
html[data-theme=dark] .x-memo td{color:rgba(255,255,255,.56)}
html[data-theme=dark] .xl-cursor{border-color:#2ea866}
html[data-theme=dark] .xl-tabs{background:#242424;border-top-color:rgba(255,255,255,.12);color:rgba(255,255,255,.56)}
html[data-theme=dark] .xl-tab{border-right-color:rgba(255,255,255,.08)}
html[data-theme=dark] .xl-tab.on{background:#263a50;color:#a8cbff;border-bottom-color:#87b7ff}

/* Report pages */
html[data-theme=dark] .wd{background:#1b1b1b}
html[data-theme=dark] .wd-ruler{background:repeating-linear-gradient(to bottom,transparent 0 10px,#ffffff26 10px 11px,transparent 11px 20px)}
html[data-theme=dark] .wp{background:#1f1f1f;color:rgba(255,255,255,.84);box-shadow:0 2px 7px #0003}
html[data-theme=dark] .ty-live .caret{background:#1a88ff}
html[data-theme=dark] .wp-head{border-color:#7f9db7}
html[data-theme=dark] .wp-head b,html[data-theme=dark] .wp-title,html[data-theme=dark] .wp-rr b,html[data-theme=dark] .wp-ch,html[data-theme=dark] .wp-p b,html[data-theme=dark] .wp-fig{color:#b4cce3}
html[data-theme=dark] .wp-head span,html[data-theme=dark] .wp-rr,html[data-theme=dark] .wp-crumb,html[data-theme=dark] .wp-bcol small,html[data-theme=dark] .wp-bcol label,html[data-theme=dark] .wp-src{color:rgba(255,255,255,.4)}
html[data-theme=dark] .wp-strap{color:#7fa9d0}
html[data-theme=dark] .wp-abs,html[data-theme=dark] .wp-p,html[data-theme=dark] .wp-table td{color:rgba(255,255,255,.68)}
html[data-theme=dark] .wp-rate{background:rgba(255,255,255,.03);border-color:rgba(255,255,255,.12);border-top-color:#7f9db7}
html[data-theme=dark] .wp-rr,html[data-theme=dark] .wp-ch,html[data-theme=dark] .wp-crumb,html[data-theme=dark] .wp-table td{border-color:rgba(255,255,255,.12)}
html[data-theme=dark] .wp-fig{border-left-color:#7f9db7}
html[data-theme=dark] .wp-table th{background:#283d50;color:rgba(255,255,255,.84)}
html[data-theme=dark] .wp-table tr.wp-sum td{background:#243442;color:#b4cce3}
html[data-theme=dark] .wp-chart{background:rgba(255,255,255,.03);border-color:rgba(255,255,255,.12)}
html[data-theme=dark] .wp-bar{background:#6794be}
html[data-theme=dark] .wp-bar.est{background:#59a9cc}

/* Slides: the editor goes dark; slide images and the code-rendered canvas are inverted with the hue kept,
   as the workflow demo does, so the red/blue recolour still reads. */
html[data-theme=dark] .pp{background:#1b1b1b}
html[data-theme=dark] .pp-strip{background:#1b1b1b;border-right-color:rgba(255,255,255,.12)}
html[data-theme=dark] .pp-thumb span,html[data-theme=dark] .pp-notes{color:rgba(255,255,255,.4)}
html[data-theme=dark] .pp-timg{box-shadow:0 0 0 1px rgba(255,255,255,.12)}
/* The inverted slide is ~#1a1a1a, so the editor ground goes a step darker and the slide gets a ring to keep its edge. */
html[data-theme=dark] .pp-main{background:#121212}
html[data-theme=dark] .pp-canvas{box-shadow:0 0 0 1px rgba(255,255,255,.14)}
html[data-theme=dark] .pp-canvas,html[data-theme=dark] .pp-timg{filter:invert(.9) hue-rotate(180deg)}

/* Kimi Office task pane */
html[data-theme=dark] .sidebar{background:rgba(255,255,255,.05);border-color:rgba(255,255,255,.06);color:rgba(255,255,255,.84)}
html[data-theme=dark] .sb-group{background:#242424;box-shadow:0 2px 12px #00000066}
html[data-theme=dark] .sb-ghost{color:rgba(255,255,255,.84)}
html[data-theme=dark] .bubble{background:rgba(255,255,255,.08);color:rgba(255,255,255,.84)}
html[data-theme=dark] .agent-copy{color:#d6d6d6}
html[data-theme=dark] .trace,html[data-theme=dark] .tsum-icon{color:rgba(255,255,255,.56)}
html[data-theme=dark] .trace.active .tsum{color:rgba(255,255,255,.84)}
html[data-theme=dark] .tdet::before{background:repeating-linear-gradient(to bottom,rgba(255,255,255,.18) 0 2px,transparent 2px 4px)}
html[data-theme=dark] .tdet-text,html[data-theme=dark] .src-in b,html[data-theme=dark] .card-meta{color:rgba(255,255,255,.4)}
html[data-theme=dark] .src-in{color:rgba(255,255,255,.56)}
html[data-theme=dark] .spinner{border-color:#3f3f3f;border-top-color:#b5b5b5}
html[data-theme=dark] .card{background:rgba(255,255,255,.07)}
html[data-theme=dark] .card-name{color:rgba(255,255,255,.84)}
html[data-theme=dark] .pill{background:rgba(255,255,255,.08);color:#b5b5b5}
html[data-theme=dark] .pill-div{background:rgba(255,255,255,.18)}
html[data-theme=dark] .composer{background:#1d1d1d;border-color:rgba(255,255,255,.12)}
html[data-theme=dark] .cmp-text{color:rgba(255,255,255,.84)}
html[data-theme=dark] .cmp-ph{color:rgba(255,255,255,.26)}
html[data-theme=dark] .caret{background:#1a88ff}
html[data-theme=dark] .cmp-add{color:#c9c9c9}
html[data-theme=dark] .cmp-model{color:rgba(255,255,255,.56)}
html[data-theme=dark] .cmp-btn{background:#ededed;color:#121212}
html[data-theme=dark] .cmp-btn.idle{background:rgba(255,255,255,.12)}
html[data-theme=dark] .cmp-stop{background:#121212}
html[data-theme=dark] .cmp-ref{background:rgba(255,255,255,.06);color:rgba(255,255,255,.56)}
html[data-theme=dark] .cmp-ref b{background:rgba(255,255,255,.4)}
html[data-theme=dark] .q-ref{background:rgba(255,255,255,.08);color:rgba(255,255,255,.56)}

/* Covers and the lifted window's ground: deep tints of each chapter's pastel instead of the light grounds. */
html[data-theme=dark] .cover[data-kind=intro]{--cv-ground:#17213a}
html[data-theme=dark] .cover[data-kind=excel],html[data-theme=dark] .lift[data-kind=excel]{--cv-ground:#13281a}
html[data-theme=dark] .cover[data-kind=word],html[data-theme=dark] .lift[data-kind=word]{--cv-ground:#112433}
html[data-theme=dark] .cover[data-kind=ppt],html[data-theme=dark] .lift[data-kind=ppt]{--cv-ground:#2f1c10}
html[data-theme=dark] .cv-line,html[data-theme=dark] .cv-card{color:rgba(255,255,255,.9)}
html[data-theme=dark] .cv-sub{color:rgba(255,255,255,.56)}

/* Transport (standalone page only; hidden when embedded) */
html[data-theme=dark] .transport{background:#1d1d1d;box-shadow:0 4px 18px #00000050;color:#9a9a9a}
html[data-theme=dark] .transport button{background:transparent;border-color:rgba(255,255,255,.12);color:#e5e5e5}
html[data-theme=dark] .transport button.on{background:rgba(26,136,255,.12);border-color:rgba(26,136,255,.4);color:#1a88ff}
html[data-theme=dark] #chapter-label{color:#b5b5b5}
html[data-theme=dark] .marks{color:rgba(255,255,255,.4)}

/* App windows */
html[data-theme=dark] .win{--acc:#2fbf71}
html[data-theme=dark] .win[data-kind="word"]{--acc:#4b9cff}
html[data-theme=dark] .win[data-kind="ppt"]{--acc:#ff7a45}
html[data-theme=dark] .win-qat{color:rgba(255,255,255,.56)}
html[data-theme=dark] .win-title{color:rgba(255,255,255,.84)}
html[data-theme=dark] .win-search{background:rgba(255,255,255,.08);color:rgba(255,255,255,.4)}
html[data-theme=dark] .rb-tabs span{color:rgba(255,255,255,.56)}
html[data-theme=dark] .rb-tabs span.on{color:var(--acc)}
html[data-theme=dark] .win,html[data-theme=dark] .sm-ghost{--win-ring:rgba(255,255,255,.18)}
html[data-theme=dark] .sm-app{--shot-ring:rgba(255,255,255,.18)}
html[data-theme=dark] .sm-app{--shot-hover:rgba(255,255,255,.5)}
html[data-theme=dark] .sm-app[data-kind="excel"]{--app:#2fbf71}
html[data-theme=dark] .sm-app[data-kind="word"]{--app:#4b9cff}
html[data-theme=dark] .sm-app[data-kind="ppt"]{--app:#ff7a45}
