/* ============================================================================
   CODEAYAN DARK THEME  (/style/dark.css)
   Active when <html data-theme="dark">. Loaded on every page by
   /includes/theme-head.php (and by nav-bar.js as a fallback).

   Part 1 is generated from the site's own stylesheets: every fixed colour is
   remapped (surfaces darken, text lightens, pale borders go quiet, brand
   colours stay). Part 2 is hand-tuned. Anything not covered here, such as
   per-chapter styles or inline style="" colours in articles, is converted at
   runtime by /component/theme.js.
   ============================================================================ */

/* ── from global.css ──────────────────────────────────────────────────────── */
html[data-theme="dark"] .navbar {
    background: rgba(23, 28, 34, 0.95) !important;
}
html[data-theme="dark"] {
    --ink-dark:  #dfe3e7;
    --ink-medium:  #c8cfd5;
    --ink-light:  #a5b0bb;
    --surface-bg:  #151b20;
    --surface-card:  #171d23;
    --card-border:  #2d4b5a;
    --card-border-soft:  #274452;
}
html[data-theme="dark"] .btn-outline-ink:hover {
    color: #0d1117 !important;
}
html[data-theme="dark"] .btn-mint {
    color: #111111 !important;
}
html[data-theme="dark"] .btn-mint:hover {
    background: #171d23 !important;
    border-color: #2b333b !important;
}
html[data-theme="dark"] .icon-box {
    background-color: #171d23 !important;
}
html[data-theme="dark"] .finput:focus {
    background: #171d23 !important;
}
html[data-theme="dark"] .u-column1.col-1,
html[data-theme="dark"] .u-column2.col-2 {
    background: #171d23 !important;
}
html[data-theme="dark"] .woocommerce form .form-row input.input-text {
    background: #161b21 !important;
    border: 1px solid #354145 !important;
}
html[data-theme="dark"] .woocommerce form .form-row input.input-text:focus {
    background: #171d23 !important;
}
html[data-theme="dark"] .woocommerce button.button,
html[data-theme="dark"] .woocommerce a.button,
html[data-theme="dark"] .woocommerce input[type="submit"].button,
html[data-theme="dark"] .woocommerce #place_order {
    color: #111111 !important;
}
html[data-theme="dark"] .woocommerce-MyAccount-navigation {
    background: #171d23 !important;
}
html[data-theme="dark"] .woocommerce-MyAccount-navigation ul li a:hover {
    background: #161b21 !important;
}
html[data-theme="dark"] .woocommerce-MyAccount-content {
    background: #171d23 !important;
}
html[data-theme="dark"] #order_review {
    background: #171d23 !important;
}
html[data-theme="dark"] .back-to-top:hover {
    color: #111111 !important;
}
html[data-theme="dark"] .article-body h2 code.ca-inline-code,
html[data-theme="dark"] .article-body h3 code.ca-inline-code,
html[data-theme="dark"] .article-body h4 code.ca-inline-code {
    background: rgba(255, 255, 255, 0.06) !important;
}
html[data-theme="dark"] body .free-card {
    border-color: #31505f !important;
}

/* ── from nav-bar.css ─────────────────────────────────────────────────────── */
html[data-theme="dark"] .ca-strip-link {
    border-bottom: 1px solid rgba(43, 51, 59, 0.55) !important;
}
html[data-theme="dark"] .ca-strip-link:hover {
    border-color: #2b333b !important;
}
html[data-theme="dark"] .ca-dd-foot {
    border-top: 1px solid rgba(255, 255, 255, 0.114) !important;
}
html[data-theme="dark"] .ca-user-avatar {
    box-shadow: 0 0 0 2px #171d23,0 0 0 3px rgba(40,151,201,0.35) !important;
}
html[data-theme="dark"] .ca-user-btn:hover .ca-user-avatar,
html[data-theme="dark"] .ca-user-btn[aria-expanded="true"] .ca-user-avatar {
    box-shadow: 0 0 0 2px #171d23,0 0 0 4px #23A0C9 !important;
}
html[data-theme="dark"] .ca-user-head {
    border-bottom: 1px solid rgba(255, 255, 255, 0.102) !important;
}

/* ── from site-footer.css ─────────────────────────────────────────────────── */
html[data-theme="dark"] .ca-ct-chip--li i {
    color: #6db0f3 !important;
}

/* ── from index.css ───────────────────────────────────────────────────────── */
html[data-theme="dark"] #hero::before {
    background-image: radial-gradient(rgba(255, 255, 255, 0.122) 1px,transparent 1.2px) !important;
}
html[data-theme="dark"] .hero-btn-ghost {
    background: rgba(23, 29, 35, 0.85) !important;
}
html[data-theme="dark"] .hero-btn-ghost:hover,
html[data-theme="dark"] .hero-btn-ghost:focus-visible {
    background: #171d23 !important;
}
html[data-theme="dark"] .hero-facts {
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
}
html[data-theme="dark"] .hx-tile {
    border: 1px solid rgba(255, 255, 255, 0.138) !important;
    background: rgba(23, 29, 35, 0.9) !important;
}
html[data-theme="dark"] .hx-go {
    border: 1px solid rgba(255, 255, 255, 0.174) !important;
}
html[data-theme="dark"] .co-card {
    border: 1px solid rgba(255, 255, 255, 0.138) !important;
}
html[data-theme="dark"] #practice .sec-link {
    border-color: rgba(43, 51, 59, 0.5) !important;
}
html[data-theme="dark"] .pr-card {
    border: 1px solid rgba(43, 51, 59, 0.1) !important;
}
html[data-theme="dark"] .pr-total {
    border: 1px solid rgba(43, 51, 59, 0.16) !important;
}
html[data-theme="dark"] .pr-facts {
    border-top: 1px solid rgba(43, 51, 59, 0.1) !important;
}
html[data-theme="dark"] .gh-card {
    border: 1px solid rgba(255, 255, 255, 0.138) !important;
}
html[data-theme="dark"] .gh-card:hover,
html[data-theme="dark"] .gh-card:focus-visible {
    border-color: rgba(255, 255, 255, 0.21) !important;
}
html[data-theme="dark"] .gh-count {
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}
html[data-theme="dark"] .gh-foot {
    border-top: 1px solid rgba(255, 255, 255, 0.114) !important;
}
html[data-theme="dark"] .tl-card {
    border: 1px solid rgba(255, 255, 255, 0.138) !important;
}
html[data-theme="dark"] .blog-card {
    border: 1px solid rgba(255, 255, 255, 0.138) !important;
}
html[data-theme="dark"] .blog-img {
    border-bottom: 1px solid rgba(255, 255, 255, 0.114) !important;
}
html[data-theme="dark"] .free-card {
    border: 1px dashed rgba(255, 255, 255, 0.22) !important;
}
html[data-theme="dark"] .ps-card {
    border: 1px solid rgba(255, 255, 255, 0.138) !important;
}
html[data-theme="dark"] .why-item {
    border: 1px solid rgba(255, 255, 255, 0.138) !important;
}

/* ── from hub.css ─────────────────────────────────────────────────────────── */
html[data-theme="dark"] .hub {
    --hb-line:  #2d3c46;
    --hb-soft:  #19282f;
}
html[data-theme="dark"] .hub-hero::before {
    background-image: radial-gradient(rgba(255, 255, 255, 0.11) 1px,transparent 1.2px) !important;
}
html[data-theme="dark"] .hub-stats li {
    background: #171d23 !important;
}
html[data-theme="dark"] .hub-card {
    background: #171d23 !important;
}
html[data-theme="dark"] .hub-btn--ghost {
    background: #171d23 !important;
}
html[data-theme="dark"] .hub-chip {
    color: #97cbe5 !important;
}
html[data-theme="dark"] .cr-syl {
    background: #161b21 !important;
}
html[data-theme="dark"] .gh-role {
    background: #171d23 !important;
}
html[data-theme="dark"] .gh-role.is-selected {
    background: color-mix(in srgb,var(--rc) 6%,#171d23) !important;
}
@supports not (background:color-mix(in srgb,red 10%,transparent)) {
    html[data-theme="dark"] .gh-role.is-selected {
        background: #161c21 !important;
    }
}
html[data-theme="dark"] .gh-topic {
    background: #171d23 !important;
}
html[data-theme="dark"] .gh-topic:hover {
    background: #161c21 !important;
}
html[data-theme="dark"] .gh-topic__n {
    color: #97cbe5 !important;
}
html[data-theme="dark"] .hub-band .hub-btn:hover {
    background: #171d23 !important;
    border-color: #2b333b !important;
}
html[data-theme="dark"] .rd-search {
    background: #171d23 !important;
}
html[data-theme="dark"] .rd-pill {
    background: #171d23 !important;
}
html[data-theme="dark"] .hub-pager a,
html[data-theme="dark"] .hub-pager span {
    background: #171d23 !important;
}
html[data-theme="dark"] .post-share a,
html[data-theme="dark"] .post-share button {
    background: #171d23 !important;
}
html[data-theme="dark"] .post-hero-img {
    background: #171d23 !important;
}
html[data-theme="dark"] .post-body {
    color: #cad1d7 !important;
}
html[data-theme="dark"] .post-body th {
    background: #161b20 !important;
}
html[data-theme="dark"] .post-body :not(pre)>code {
    color: #89c8e5 !important;
}
html[data-theme="dark"] .post-tags a {
    background: #171d23 !important;
}
html[data-theme="dark"] .side-card--dark .hub-btn:hover {
    background: #171d23 !important;
    border-color: #2b333b !important;
}

/* ── from practice.css ────────────────────────────────────────────────────── */
html[data-theme="dark"] .ca-prac-hero {
    background: linear-gradient(180deg,#19282f 0%,rgba(238,247,251,0) 100%) !important;
}
html[data-theme="dark"] .ca-chip {
    border: 1px solid #384146 !important;
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-prac-rolenote {
    background: #19282f !important;
    border: 1px solid #274351 !important;
    color: #97cbe5 !important;
}
html[data-theme="dark"] .ca-prac-card {
    background: #171d23 !important;
    border: 1px solid rgba(255, 255, 255, 0.126) !important;
}
html[data-theme="dark"] .ca-prac-levels li {
    background: #161b20 !important;
}
html[data-theme="dark"] .ca-prac-faq details {
    background: #171d23 !important;
    border: 1px solid rgba(255, 255, 255, 0.126) !important;
}
html[data-theme="dark"] .ca-opt__box {
    border: 1px solid #384146 !important;
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-opt input:checked+.ca-opt__box {
    background: #19282f !important;
}
html[data-theme="dark"] .ca-prac-rolelist a {
    background: #161b20 !important;
}
html[data-theme="dark"] .ca-prac-rolelist a:hover,
html[data-theme="dark"] .ca-prac-rolelist a.is-on {
    background: #19282f !important;
}
html[data-theme="dark"] .ca-prac-q code,
html[data-theme="dark"] .ca-prac-rq__opts code,
html[data-theme="dark"] .ca-prac-rq__why code {
    background: #151a1f !important;
}
html[data-theme="dark"] .ca-prac-letter {
    background: #151a1f !important;
}
html[data-theme="dark"] .ca-prac-score {
    background: #171d23 !important;
    border: 1px solid rgba(255, 255, 255, 0.126) !important;
}
html[data-theme="dark"] .ca-prac-score__ring {
    background: conic-gradient(var(--ring, #2897C9) calc(var(--pct)*1%),#20272c 0) !important;
}
html[data-theme="dark"] .ca-prac-score__ring::before {
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-prac-rq {
    background: #171d23 !important;
    border: 1px solid rgba(255, 255, 255, 0.126) !important;
    border-left: 4px solid #384146 !important;
}
html[data-theme="dark"] .ca-prac-rq__opts li.is-answer {
    background: #151a1f !important;
    color: #a3e7cf !important;
}
html[data-theme="dark"] .ca-prac-rq__opts li.is-given {
    background: #151b20 !important;
    color: #d68582 !important;
}
html[data-theme="dark"] .ca-prac-rq__why {
    background: #161b20 !important;
}
html[data-theme="dark"] .ca-exam {
    --ex-line:  #2d3c46;
}
html[data-theme="dark"] .ca-exam-bar {
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-exam-exit:hover {
    background: #151a1f !important;
}
html[data-theme="dark"] .ca-exam-timer {
    background: #19282f !important;
    color: #97cbe5 !important;
    border: 1px solid #284754 !important;
}
html[data-theme="dark"] .ca-exam-timer.is-warn {
    background: #322816 !important;
    color: #f5c989 !important;
    border-color: #5e4a24 !important;
}
html[data-theme="dark"] .ca-exam-timer.is-low {
    background: #151b20 !important;
    color: #d68582 !important;
    border-color: #562725 !important;
}
html[data-theme="dark"] .ca-exam-q {
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-exam-level {
    background: #19282f !important;
    color: #97cbe5 !important;
}
html[data-theme="dark"] .ca-exam-level.is-easy {
    background: #151a1f !important;
    color: #a3e7cf !important;
}
html[data-theme="dark"] .ca-exam-level.is-medium {
    background: #322816 !important;
    color: #f5c989 !important;
}
html[data-theme="dark"] .ca-exam-level.is-hard {
    background: #151b20 !important;
    color: #d68582 !important;
}
html[data-theme="dark"] .ca-exam-flag {
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-exam-flag.is-on {
    background: #1a182f !important;
    color: #8782cf !important;
}
html[data-theme="dark"] .ca-exam-qtext code {
    background: #151a1f !important;
}
html[data-theme="dark"] .ca-exam-choice {
    border: 1.5px solid #313e47 !important;
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-exam-choice:hover {
    background: #161c21 !important;
}
html[data-theme="dark"] .ca-exam-choice.is-on {
    background: #19282f !important;
}
html[data-theme="dark"] .ca-exam-choice__text code {
    background: #151a1f !important;
}
html[data-theme="dark"] .ca-exam-letter {
    border: 1.5px solid #36424a !important;
}
html[data-theme="dark"] .ca-exam-q__foot {
    background: #171c22 !important;
}
html[data-theme="dark"] .ca-exam-clear:hover {
    color: #d68582 !important;
}
html[data-theme="dark"] .ca-exam-save.is-ok {
    color: #a3e7cf !important;
}
html[data-theme="dark"] .ca-exam-save.is-warn {
    color: #f5c989 !important;
}
html[data-theme="dark"] .ca-exam-side {
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-exam-stats>div {
    background: #161b20 !important;
}
html[data-theme="dark"] .ca-exam-stats .is-done {
    background: #19282f !important;
}
html[data-theme="dark"] .ca-exam-stats .is-flag {
    background: #1a182f !important;
}
html[data-theme="dark"] .ca-exam-stats .is-flag b {
    color: #8782cf !important;
}
html[data-theme="dark"] .ca-exam-palette button {
    border: 1.5px solid #313e47 !important;
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-exam-palette button.is-flag::after {
    border: 2px solid #2b333b !important;
}
html[data-theme="dark"] .ca-exam-palette button.is-flag.is-left {
    color: #8782cf !important;
    background: #161b21 !important;
}
html[data-theme="dark"] .ca-exam-palette button.is-cur {
    box-shadow: 0 0 0 2px #171d23,0 0 0 4px var(--ink-dark, #111) !important;
}
html[data-theme="dark"] .ca-exam-legend .k {
    border: 1.5px solid #313e47 !important;
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-exam-legend .k--flag {
    background: #161b21 !important;
}
html[data-theme="dark"] .ca-exam-legend .k--cur {
    box-shadow: 0 0 0 1px #171d23,0 0 0 2.5px var(--ink-dark, #111) !important;
}
html[data-theme="dark"] .ca-exam-keys kbd {
    border: 1px solid #313e47 !important;
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-exam-modal__box {
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-exam-modal__jump p.is-all {
    color: #a3e7cf !important;
}
html[data-theme="dark"] .ca-exam-modal__jump button {
    border: 1.5px solid #313e47 !important;
    background: #171d23 !important;
}
@media (max-width:991.98px) {
    html[data-theme="dark"] .ca-exam-sheetbtn {
        background: #171d23 !important;
    }
    html[data-theme="dark"] .ca-exam-q__foot {
        background: #171d23 !important;
    }
    html[data-theme="dark"] .ca-exam-save {
        background: #171d23 !important;
    }
    html[data-theme="dark"] .ca-exam-side::before {
        background: #222a2f !important;
    }
    html[data-theme="dark"] .ca-exam-side__close {
        background: #151a1f !important;
    }
}
html[data-theme="dark"] .ca-prac-bd__bar {
    background: rgba(255, 255, 255, 0.085) !important;
}
html[data-theme="dark"] .ca-prac-bd__bar .skip {
    background: #2a2e32 !important;
}
html[data-theme="dark"] .ca-prac-adminreview__tag {
    color: #9875dd !important;
}

/* ── from tools.css ───────────────────────────────────────────────────────── */
html[data-theme="dark"] .tools-preview-bar {
    background: #322816 !important;
    border-bottom: 1px solid #6a4f28 !important;
    color: #f7d29a !important;
}
html[data-theme="dark"] .tools-chip.is-active {
    color: #0d1117 !important;
}
html[data-theme="dark"] .tool-card-foot {
    border-top: 1px solid rgba(255, 255, 255, 0.102) !important;
}
html[data-theme="dark"] .tool-status-planned {
    background: rgba(255, 255, 255, 0.073) !important;
}
html[data-theme="dark"] .tool-status-draft {
    color: #f5c684 !important;
}
html[data-theme="dark"] .tools-faq details {
    border-bottom: 1px solid rgba(255, 255, 255, 0.126) !important;
}
html[data-theme="dark"] .tool-input,
html[data-theme="dark"] .tool-textarea {
    border: 1px solid #354145 !important;
    background: #161b21 !important;
}
html[data-theme="dark"] .tool-input:focus,
html[data-theme="dark"] .tool-textarea:focus {
    background: #171d23 !important;
}
html[data-theme="dark"] .tool-btn-primary:hover {
    color: #dfe3e7 !important;
}
html[data-theme="dark"] .tool-msg.is-error {
    color: #dd8986 !important;
}
html[data-theme="dark"] .tool-msg.is-note {
    color: #f7d29a !important;
}
html[data-theme="dark"] .tool-equation {
    color: #0d1117 !important;
}
html[data-theme="dark"] .tool-kpi {
    border: 1px solid rgba(255, 255, 255, 0.126) !important;
}
html[data-theme="dark"] .tool-tab.is-active {
    color: #0d1117 !important;
}
html[data-theme="dark"] .ca-plot .ca-grid {
    stroke: rgba(255, 255, 255, 0.102) !important;
}
html[data-theme="dark"] .ca-plot .ca-frame {
    stroke: rgba(255, 255, 255, 0.21) !important;
}
html[data-theme="dark"] .ca-plot .ca-tick {
    fill: #9ca8b4 !important;
}
html[data-theme="dark"] .ca-plot .ca-axis-title {
    fill: #bcc4cd !important;
}
html[data-theme="dark"] .ca-plot .ca-pt {
    stroke: #2b333b !important;
}
html[data-theme="dark"] .ca-plot .ca-pt-hi {
    stroke: #2b333b !important;
}
html[data-theme="dark"] .tool-table th,
html[data-theme="dark"] .tool-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.114) !important;
}
html[data-theme="dark"] .tool-steps details {
    border: 1px solid rgba(255, 255, 255, 0.126) !important;
}
html[data-theme="dark"] .tool-steps code,
html[data-theme="dark"] .tool-article code {
    color: #89cbe9 !important;
}

/* ── from auth.css ────────────────────────────────────────────────────────── */
html[data-theme="dark"] .ca-auth-card {
    background: #171d23 !important;
    border: 1px solid rgba(255, 255, 255, 0.126) !important;
}
html[data-theme="dark"] .ca-field input[type="text"],
html[data-theme="dark"] .ca-field input[type="email"],
html[data-theme="dark"] .ca-field input[type="password"] {
    border: 1px solid #353f49 !important;
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-btn--ghost {
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-btn--danger {
    background: #171d23 !important;
}
html[data-theme="dark"] .ca-btn--danger:hover {
    background: #151b20 !important;
}
html[data-theme="dark"] .ca-divider::before,
html[data-theme="dark"] .ca-divider::after {
    background: rgba(255, 255, 255, 0.135) !important;
}
html[data-theme="dark"] .ca-msg.is-error {
    background: #151b20 !important;
    color: #d68582 !important;
    border: 1px solid #562725 !important;
}
html[data-theme="dark"] .ca-msg.is-success {
    background: #151a1f !important;
    color: #a3e7cf !important;
    border: 1px solid #2d5544 !important;
}
html[data-theme="dark"] .ca-msg.is-info {
    background: #19282f !important;
    color: #97cbe5 !important;
    border: 1px solid #284754 !important;
}
html[data-theme="dark"] .ca-account-head {
    background: #171d23 !important;
    border: 1px solid rgba(255, 255, 255, 0.126) !important;
}
html[data-theme="dark"] .ca-badge--ok {
    background: #151a1f !important;
    color: #a3e7cf !important;
}
html[data-theme="dark"] .ca-badge--warn {
    background: #322816 !important;
    color: #f5c989 !important;
}
html[data-theme="dark"] .ca-notice--warn {
    background: #322816 !important;
    border: 1px solid #604a24 !important;
    color: #f8d7a3 !important;
}
html[data-theme="dark"] .ca-notice--ok {
    background: #151a1f !important;
    border: 1px solid #2d5544 !important;
    color: #a3e7cf !important;
}
html[data-theme="dark"] .ca-tabs {
    border-bottom: 1px solid rgba(255, 255, 255, 0.126) !important;
}
html[data-theme="dark"] .ca-tab__count {
    background: #19282f !important;
}
html[data-theme="dark"] .ca-stat {
    background: #171d23 !important;
    border: 1px solid rgba(255, 255, 255, 0.126) !important;
}
html[data-theme="dark"] .ca-panel {
    background: #171d23 !important;
    border: 1px solid rgba(255, 255, 255, 0.126) !important;
}
html[data-theme="dark"] .ca-heat .l4 {
    fill: #92ceed !important;
}
html[data-theme="dark"] .ca-heat__legend .l0 {
    background: #1e262c !important;
}
html[data-theme="dark"] .ca-heat__legend .l1 {
    background: #1d2f39 !important;
}
html[data-theme="dark"] .ca-subjbars__bar {
    background: #1e262c !important;
}
html[data-theme="dark"] .ca-quick a {
    background: #161b20 !important;
}
html[data-theme="dark"] .ca-quick a:hover {
    background: #19282f !important;
}
html[data-theme="dark"] .ca-attempt,
html[data-theme="dark"] .ca-dl__row {
    border: 1px solid rgba(255, 255, 255, 0.102) !important;
    background: #161c22 !important;
}
html[data-theme="dark"] .ca-attempt__score {
    background: #1e262c !important;
    color: #92ceed !important;
}
html[data-theme="dark"] .ca-attempt__score.is-pass {
    background: #151a1f !important;
    color: #a3e7cf !important;
}
html[data-theme="dark"] .ca-attempt__score.is-fail {
    background: #322816 !important;
    color: #f5c989 !important;
}

/* ── from checkout.css ────────────────────────────────────────────────────── */
html[data-theme="dark"] .woocommerce-checkout {
    --ca-bg:          #171c22;
}
html[data-theme="dark"] .woocommerce-checkout .woocommerce-billing-fields h3,
html[data-theme="dark"] .woocommerce-checkout .woocommerce-checkout-review-order>h3 {
    color: #dfe3e7 !important;
}
html[data-theme="dark"] .woocommerce-checkout form.checkout_coupon input.input-text {
    border: 1px solid #37414c !important;
    background: #171d23 !important;
    color: #d3d9de !important;
}
html[data-theme="dark"] .woocommerce-checkout .woocommerce-checkout-review-order-table th,
html[data-theme="dark"] .woocommerce-checkout .woocommerce-checkout-review-order-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.102) !important;
}
html[data-theme="dark"] .woocommerce-checkout .woocommerce-order-downloads td,
html[data-theme="dark"] .woocommerce-checkout .woocommerce-order-downloads th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.102) !important;
}
html[data-theme="dark"] .woocommerce-checkout #payment {
    background: #171d23 !important;
}

/* ── from blog-design-system.css ──────────────────────────────────────────── */
html[data-theme="dark"] .codeayan-blog {
    --blue-dark: #7dbee9;
    --blue-pale: #162633;
    --blue-xpale: #152431;
    --teal-dark: #91e9f2;
    --teal-pale: #1b2f31;
    --teal-xpale: #182d2f;
    --amber-pale: #383218;
    --green-pale: #183727;
    --violet: #9663ee;
    --violet-pale: #1b1632;
    --rose-pale: #331618;
    color: #dfe3e7 !important;
}
html[data-theme="dark"] .codeayan-blog p {
    color: #dfe3e7 !important;
}
html[data-theme="dark"] .codeayan-blog code.cb-inline {
    background: #13181d !important;
    border: 1px solid #323c45 !important;
    color: #d9dee2 !important;
}
html[data-theme="dark"] .cb-callout-takeaways code.cb-inline,
html[data-theme="dark"] .cb-aside code.cb-inline,
html[data-theme="dark"] .cb-callout-next code.cb-inline {
    background: rgba(255, 255, 255, 0.085) !important;
    border-color: rgba(255, 255, 255, 0.126) !important;
}
html[data-theme="dark"] .cb-hero {
    background: linear-gradient(135deg,#161c22 0%,var(--blue-pale) 50%,var(--teal-pale) 100%) !important;
}
html[data-theme="dark"] .cb-hero p {
    color: #d3d9de !important;
}
html[data-theme="dark"] .cb-answer p {
    color: #dfe3e7 !important;
}
html[data-theme="dark"] .cb-table {
    border: 1.5px solid #333d47 !important;
    color: #dfe3e7 !important;
}
html[data-theme="dark"] .cb-table th {
    border-bottom: 2px solid #38424d !important;
    border-right: 1px solid #333d47 !important;
}
html[data-theme="dark"] .cb-table td {
    border-bottom: 1px solid #2f3841 !important;
    border-right: 1px solid #2f3841 !important;
}
html[data-theme="dark"] .cb-table tbody tr:nth-child(odd) {
    background: #171d22 !important;
}
html[data-theme="dark"] .cb-table tbody tr:nth-child(even) {
    background: #161b20 !important;
}
html[data-theme="dark"] .cb-idx-type {
    border: 1px solid #233f58 !important;
}
html[data-theme="dark"] .cb-table td.cb-warn {
    color: #d29b9b !important;
}
html[data-theme="dark"] .cb-table td.cb-good {
    color: #a3e4cc !important;
}
html[data-theme="dark"] .cb-sub {
    color: #a5b0bb !important;
}
html[data-theme="dark"] .cb-aside {
    color: #b4c2d4 !important;
}
html[data-theme="dark"] .cb-callout-insight p {
    color: #d3d9de !important;
}
html[data-theme="dark"] .cb-callout-result p {
    color: #a6f7e1 !important;
}
html[data-theme="dark"] .cb-callout-caution {
    background: linear-gradient(135deg,var(--amber-pale),#161c21) !important;
}
html[data-theme="dark"] .cb-callout-caution p {
    color: #f7cf97 !important;
}
html[data-theme="dark"] .cb-callout-takeaways li {
    color: #dfe3e7 !important;
}
html[data-theme="dark"] .cb-callout-next {
    background: linear-gradient(135deg,var(--blue-xpale),#171d23) !important;
}
html[data-theme="dark"] .cb-callout-next p {
    color: #d3d9de !important;
}
html[data-theme="dark"] .cb-pipeline-outer::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06) !important;
}
html[data-theme="dark"] .cb-pn1 {
    background: #172435 !important;
    color: #7993e6 !important;
    border: 1.5px solid #254262 !important;
}
html[data-theme="dark"] .cb-pn3 {
    color: #a075e4 !important;
    border: 1.5px solid #2e225a !important;
}
html[data-theme="dark"] .cb-pn4 {
    border: 1.5px solid #685627 !important;
}
html[data-theme="dark"] .cb-app-card {
    background: #171d23 !important;
    border: 1px solid #313a43 !important;
}
html[data-theme="dark"] .cb-app-title {
    color: #dfe3e7 !important;
}
html[data-theme="dark"] .cb-app-desc {
    color: #b1bac4 !important;
}
html[data-theme="dark"] .cb-stat {
    background: linear-gradient(135deg,#171d23,var(--teal-xpale)) !important;
}
html[data-theme="dark"] .cb-stat-lab {
    color: #b1bac4 !important;
}
html[data-theme="dark"] .cb-quote {
    color: #b9aadc !important;
}
html[data-theme="dark"] .cb-quote cite {
    color: #a075e4 !important;
}
html[data-theme="dark"] .cb-faq-item {
    border: 1px solid #2f3845 !important;
    background: #171d22 !important;
}
html[data-theme="dark"] .cb-faq-a {
    color: #d3d9de !important;
}
html[data-theme="dark"] .cb-code-wrap {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}
html[data-theme="dark"] .cb-copy-btn {
    color: #9f9fc0 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}
html[data-theme="dark"] .cb-ln {
    color: #b4b4d0 !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   HAND-TUNED LAYER
   Comes last, so it wins over the generated rules above.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Palette ──────────────────────────────────────────────────────────── */
html { color-scheme: light; }
html[data-theme="dark"] {
    color-scheme: dark;
    --ink-dark: #E6EAEF;
    --ink-medium: #B8C2CC;
    --ink-light: #8E9BA8;
    --surface-bg: #0D1117;
    --surface-card: #151B23;
    --surface-raise: #1B232D;
    --border-subtle: #1E5662;
    --card-border: #263A49;
    --card-border-soft: #1E2D3A;
    --ca-link: #5DBBE6;

    /* Bootstrap 5.3 tokens, for components that read them */
    --bs-body-bg: #0D1117;
    --bs-body-color: #E6EAEF;
    --bs-emphasis-color: #F3F6F9;
    --bs-secondary-color: #8E9BA8;
    --bs-tertiary-bg: #151B23;
    --bs-secondary-bg: #1B232D;
    --bs-border-color: #263A49;
    --bs-link-color: #5DBBE6;
    --bs-link-hover-color: #8FD3F1;
    background-color: #0D1117;
}

html[data-theme="dark"] body { background-color: var(--surface-bg); color: var(--ink-dark); }
html[data-theme="dark"] ::selection { background: rgba(40, 151, 201, 0.45); color: #ffffff; }

/* No animated colour sweep while the theme flips. */
html.ca-theme-switching *,
html.ca-theme-switching *::before,
html.ca-theme-switching *::after { transition: none !important; }

/* ── Navigation ───────────────────────────────────────────────────────── */
html[data-theme="dark"] .navbar {
    background: rgba(13, 17, 23, 0.86) !important;
    border-bottom-color: #1C2A35 !important;
}
@media (max-width: 991.98px) {
    html[data-theme="dark"] .navbar .navbar-collapse { background: transparent !important; border: 0 !important; box-shadow: none !important; }
    html[data-theme="dark"] .ca-menu-panel { background: var(--surface-card) !important; border-color: var(--card-border) !important; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5) !important; }
    html[data-theme="dark"] .ca-nav-actions { border-top-color: var(--card-border-soft) !important; }
}
html[data-theme="dark"] .navbar-toggler i { color: var(--ink-dark) !important; }
html[data-theme="dark"] .brand-logo-slot { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }

/* The black cat would vanish on a dark bar: give it a soft rim light. */
html[data-theme="dark"] .ca-cat svg { filter: drop-shadow(0 0 1.1px rgba(230, 236, 242, 0.7)) drop-shadow(0 0 7px rgba(93, 187, 230, 0.28)); }

/* ── Bootstrap utilities used across pages ───────────────────────────── */
html[data-theme="dark"] :is(.bg-white, .bg-light) { background-color: var(--surface-card) !important; }
html[data-theme="dark"] :is(.text-dark, .text-black, .text-body) { color: var(--ink-dark) !important; }
html[data-theme="dark"] .text-muted { color: var(--ink-light) !important; }
html[data-theme="dark"] .text-secondary { color: var(--ink-light) !important; }
html[data-theme="dark"] :is(.border, .border-top, .border-bottom, .border-start, .border-end) { border-color: var(--card-border) !important; }
html[data-theme="dark"] .shadow-sm { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35) !important; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }

/* ── Reading surfaces: articles, chapters, Get Hired answers ─────────── */
html[data-theme="dark"] :is(.article-body, .post-body, .prep-answer) a:not([class]) { color: var(--ca-link) !important; }
html[data-theme="dark"] :is(.article-body, .post-body, .prep-answer) a:not([class]):hover { color: #8FD3F1 !important; }
html[data-theme="dark"] :is(.article-body, .post-body, .prep-answer) :is(th, td) { border-color: var(--card-border) !important; }
html[data-theme="dark"] :is(.article-body, .post-body, .prep-answer) th { background: rgba(255, 255, 255, 0.04) !important; }
html[data-theme="dark"] :is(.article-body, .post-body, .prep-answer) hr { background: var(--card-border) !important; border-color: var(--card-border) !important; }

/* Photos and diagrams: take the glare off without washing them out. */
html[data-theme="dark"] :is(.article-body, .post-body, .codeayan-blog, .prep-answer, .chapter-inner, .blog-img, .rd-thumb) img:not([src$=".svg"]) { filter: brightness(0.9) contrast(1.05); }

/* Code: lift blocks off the dark page with an edge rather than colour. */
html[data-theme="dark"] :is(.article-body pre.ca-code, .prep-answer pre, .post-body pre) { background: #0A0E13 !important; border: 1px solid #222C37 !important; }
html[data-theme="dark"] .cb-code-wrap { border-color: #252536 !important; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5) !important; }
html[data-theme="dark"] .article-body code.ca-inline-code,
html[data-theme="dark"] .prep-answer :not(pre) > code,
html[data-theme="dark"] .post-body :not(pre) > code:not([class]) {
    color: #7CCBEE !important;
    background: rgba(40, 151, 201, 0.14) !important;
    border-color: rgba(40, 151, 201, 0.3) !important;
}
html[data-theme="dark"] .codeayan-blog code.cb-inline { background: #1D2530 !important; border-color: #2C3845 !important; color: #E3E8ED !important; }

/* Blog design system: h2 gradient bar and gradient title text keep their brand colours. */
html[data-theme="dark"] .codeayan-blog h2 { color: #4FB0E3 !important; }
html[data-theme="dark"] .codeayan-blog h3 { color: #5CC9D3 !important; }
html[data-theme="dark"] .codeayan-blog .cb-table thead tr { background: linear-gradient(90deg, #13283A, #0F2C31) !important; }
html[data-theme="dark"] .codeayan-blog .cb-table tbody tr:hover { background: #172736 !important; }

/* Chapter page widgets */
html[data-theme="dark"] .custom-tooltip { background: #1F2833 !important; color: #E6EAEF !important; border: 1px solid #2C3A47; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important; }
html[data-theme="dark"] .custom-tooltip::after { border-top-color: #1F2833 !important; }
html[data-theme="dark"] .nav-btn.complete:hover { background: var(--surface-card) !important; }

/* ── Homepage: practice band stays a distinct deep band ──────────────── */
html[data-theme="dark"] #practice { background: #080B0F !important; border-top: 1px solid #18222C; border-bottom: 1px solid #18222C; }
html[data-theme="dark"] #hero::after { opacity: 0.7; }

/* ── Tools: charts drawn as SVG with fixed colours ───────────────────── */
html[data-theme="dark"] .ca-plot :is([fill="#111"], [fill="#222"], [fill="#333"], [fill="#444"], [fill="#555"]) { fill: #D5DCE3; }
html[data-theme="dark"] .ca-plot :is([fill="#666"], [fill="#777"], [fill="#999"]) { fill: #8E9BA8; }
html[data-theme="dark"] .ca-plot [fill="#fff"] { fill: #151B23; }
html[data-theme="dark"] .ca-plot [fill="#9c2f2b"] { fill: #F08A85; }
html[data-theme="dark"] .ca-plot [stroke="#111"] { stroke: #D5DCE3; }
html[data-theme="dark"] .ca-plot [stroke="#fff"] { stroke: #151B23; }
html[data-theme="dark"] .ca-plot [stroke^="rgba(0,0,0"] { stroke: rgba(255, 255, 255, 0.28); }
html[data-theme="dark"] .ca-plot :is([stroke^="rgba(0,0,0,.0"], [stroke^="rgba(0,0,0,0.0"]) { stroke: rgba(255, 255, 255, 0.07); }
html[data-theme="dark"] .ca-plot [stroke^="rgba(0,0,0,.1"] { stroke: rgba(255, 255, 255, 0.2); }
html[data-theme="dark"] .tool-chart :is([style*="background:#111"], [style*="background: #111"]) { background: #D5DCE3 !important; }

/* ── Forms ────────────────────────────────────────────────────────────── */
html[data-theme="dark"] :is(input, select, textarea)::placeholder { color: #6F7D8B !important; opacity: 1; }
html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink-dark) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--surface-raise) inset !important;
    caret-color: var(--ink-dark);
}
html[data-theme="dark"] select option { background: var(--surface-card); color: var(--ink-dark); }

/* ── Theme switch in the navbar ───────────────────────────────────────── */
html[data-theme="dark"] .ca-theme-btn { background: #1B232D; border-color: #2C3A47; color: #FFD27A; }
html[data-theme="dark"] .ca-theme-btn:hover { border-color: #4FB0E3; color: #FFE3A3; }

/* ── Images that are pure black line art (logos on transparent) ──────── */
html[data-theme="dark"] img[data-invert-dark] { filter: invert(1) hue-rotate(180deg); }

/* Result statement panel on tool pages: a raised dark panel, not an inverted one. */
html[data-theme="dark"] .tool-equation { background: linear-gradient(135deg, #0F1B26, #0E1720) !important; color: #E6EAEF !important; border: 1px solid #1F3445; }

/* Practice activity heatmap: dark ramp, empty cells recede, activity glows. */
html[data-theme="dark"] .ca-heat .l0 { fill: #18212B; }
html[data-theme="dark"] .ca-heat .l1 { fill: #0E3A52; }
html[data-theme="dark"] .ca-heat .l2 { fill: #15628A; }
html[data-theme="dark"] .ca-heat .l3 { fill: #2897C9; }
html[data-theme="dark"] .ca-heat .l4 { fill: #6CC4EC; }
html[data-theme="dark"] .ca-heat rect:hover { stroke: #8FD3F1; }
html[data-theme="dark"] .ca-heat__legend .l0 { background: #18212B !important; }
html[data-theme="dark"] .ca-heat__legend .l1 { background: #0E3A52 !important; }
html[data-theme="dark"] .ca-heat__legend .l2 { background: #15628A !important; }
html[data-theme="dark"] .ca-heat__legend .l3 { background: #2897C9 !important; }
html[data-theme="dark"] .ca-heat__legend .l4 { background: #6CC4EC !important; }
