/* HK v1.1.6 theme toggle: dark is default (html[data-theme=dark]); light via toggle (localStorage hk-theme) */
html[data-theme="dark"]{--color-primary-text:#e6e8eb;--color-secondary-text:#9aa3ad;--color-white:#0f1115;--color-lighter-gray:#171a20;--color-light-gray:#262a32;--color-mid-gray:#3a3f48;--color-dark-gray:#c9ced6;--color-darker-gray:#f1f3f5;--color-black:#fff;color-scheme:dark}
html[data-theme="dark"],html[data-theme="dark"] body,html[data-theme="dark"] .site,html[data-theme="dark"] .gh-viewport{background-color:#0f1115!important;color:#e6e8eb}
html[data-theme="dark"] .gh-head,html[data-theme="dark"] .gh-footer,html[data-theme="dark"] .gh-cta,html[data-theme="dark"] .gh-subscribe{background-color:#0f1115}
html[data-theme="dark"] .gh-content a,html[data-theme="dark"] .gh-article-excerpt{color:inherit}
/* light: undo the prefers-color-scheme:dark code-injection block */
html[data-theme="light"]{--color-primary-text:#15171a;--color-secondary-text:#5f6670;--color-white:#fff;--color-lighter-gray:#f6f6f6;--color-light-gray:#e6e6e6;--color-mid-gray:#ccc;--color-dark-gray:#444;--color-darker-gray:#15171a;--color-black:#000;color-scheme:light}
html[data-theme="light"],html[data-theme="light"] body,html[data-theme="light"] .site,html[data-theme="light"] .gh-viewport{background-color:#fff!important;color:#15171a}
html[data-theme="light"] .gh-head,html[data-theme="light"] .gh-footer,html[data-theme="light"] .gh-cta,html[data-theme="light"] .gh-subscribe{background-color:#fff}
html[data-theme="light"] img{opacity:1}
/* contact card follows theme */
html[data-theme="dark"] .hk-contact{--c-bg:#0f1115;--c-card:#171a20;--c-line:#262a32;--c-text:#e6e8eb;--c-muted:#9aa3ad}
html[data-theme="light"] .hk-contact{--c-bg:#f6f7f9;--c-card:#fff;--c-line:#e4e7ec;--c-text:#15171a;--c-muted:#5b6470}
/* toggle button (same box as search icon) */
.hk-theme-toggle{color:var(--color-darker-gray)}
.hk-theme-toggle:hover{opacity:.8}
.hk-theme-toggle .hk-ico-sun{display:none}
html[data-theme="dark"] .hk-theme-toggle .hk-ico-sun{display:block}
html[data-theme="dark"] .hk-theme-toggle .hk-ico-moon{display:none}
/* HK v1.1.7: Share button readable in both modes */
html[data-theme="dark"] .gh-button-share{color:#e5e7eb;border-color:rgba(229,231,235,.28);background:transparent}
html[data-theme="dark"] .gh-button-share:hover,html[data-theme="dark"] .gh-button-share:focus-visible{color:#fff;border-color:rgba(229,231,235,.6);background:rgba(255,255,255,.06)}
html[data-theme="light"] .gh-button-share{color:#15171a;border-color:rgba(0,0,0,.2)}
html[data-theme="light"] .gh-button-share:hover,html[data-theme="light"] .gh-button-share:focus-visible{border-color:rgba(0,0,0,.5);background:rgba(0,0,0,.04)}
.gh-button-share svg{color:inherit;stroke:currentColor}
/* HK v1.1.7: wide tables scroll inside the article instead of widening the whole page on phones */
.gh-content table:not(.gist table){display:block;min-width:0;width:auto;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}

/* v1.1.8 status page */
.hk-status{--st-card:#fff;--st-bd:rgba(0,0,0,.1);--st-mut:#6b7280;--st-empty:rgba(0,0,0,.08);margin-top:1.5rem}
html[data-theme="dark"] .hk-status{--st-card:#1b1e24;--st-bd:rgba(255,255,255,.1);--st-mut:#9ca3af;--st-empty:rgba(255,255,255,.08)}
.hk-st-banner{display:flex;align-items:center;gap:.7rem;padding:1rem 1.2rem;border-radius:10px;font-weight:600;font-size:1.05em;border:1px solid var(--st-bd);background:var(--st-card)}
.hk-st-dot{width:12px;height:12px;border-radius:50%;background:#9ca3af;flex:none}
.hk-st-banner.is-up{border-color:rgba(34,197,94,.45);background:rgba(34,197,94,.1)}.hk-st-banner.is-up .hk-st-dot{background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.2)}
.hk-st-banner.is-degraded{border-color:rgba(245,158,11,.5);background:rgba(245,158,11,.1)}.hk-st-banner.is-degraded .hk-st-dot{background:#f59e0b}
.hk-st-banner.is-down{border-color:rgba(239,68,68,.5);background:rgba(239,68,68,.1)}.hk-st-banner.is-down .hk-st-dot{background:#ef4444}
.hk-st-banner.is-maint{border-color:rgba(59,130,246,.5);background:rgba(59,130,246,.1)}.hk-st-banner.is-maint .hk-st-dot{background:#3b82f6}
.gh-content .hk-st-list{list-style:none;margin:1.2rem 0 0;padding:0;display:grid;gap:.8rem}
.gh-content .hk-st-item{margin:0;padding:1rem 1.2rem;border:1px solid var(--st-bd);border-radius:10px;background:var(--st-card)}
.hk-st-row{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap}
.hk-st-name{font-weight:600;flex:1 1 auto}
.hk-st-up{font-size:.9em;color:var(--st-mut);font-variant-numeric:tabular-nums}.hk-st-up small{font-size:.8em}
.hk-st-badge{font-size:.75em;font-weight:700;padding:.2em .7em;border-radius:999px;text-transform:uppercase;letter-spacing:.03em}
.hk-st-badge.is-up{background:rgba(34,197,94,.15);color:#16a34a}.hk-st-badge.is-down{background:rgba(239,68,68,.15);color:#dc2626}
.hk-st-badge.is-degraded{background:rgba(245,158,11,.18);color:#b45309}.hk-st-badge.is-maint{background:rgba(59,130,246,.15);color:#2563eb}
.hk-st-badge.is-unknown{background:var(--st-empty);color:var(--st-mut)}
html[data-theme="dark"] .hk-st-badge.is-up{color:#4ade80}html[data-theme="dark"] .hk-st-badge.is-down{color:#f87171}
html[data-theme="dark"] .hk-st-badge.is-degraded{color:#fbbf24}html[data-theme="dark"] .hk-st-badge.is-maint{color:#60a5fa}
.hk-st-bars{display:flex;gap:3px;height:28px;margin:.8rem 0 .5rem}
.hk-st-bars i{flex:1 1 0;min-width:2px;border-radius:3px;background:var(--st-empty)}
.hk-st-bars i.b-up{background:#22c55e}.hk-st-bars i.b-down{background:#ef4444}.hk-st-bars i.b-pend{background:#f59e0b}.hk-st-bars i.b-maint{background:#3b82f6}
.hk-st-meta,.hk-st-foot{font-size:.8em;color:var(--st-mut);margin:0}
.gh-content .hk-st-foot{margin-top:1rem}
@media (max-width:600px){.hk-st-bars{gap:2px}.hk-st-bars i:nth-child(-n+10){display:none}}

/* v1.1.8 footer follows the theme toggle */
html[data-theme="dark"] .hk-foot{--hk-bg:#0f1115;--hk-card:#171a20;--hk-line:#262a32;--hk-text:#e6e8eb;--hk-muted:#9aa3ad}
html[data-theme="light"] .hk-foot{--hk-bg:#f6f7f9;--hk-card:#fff;--hk-line:#e4e7ec;--hk-text:#15171a;--hk-muted:#5b6470}
/* HK v1.1.9 Trending this week strip */
.hk-trending{margin:0 0 clamp(28px,4vw,48px);padding:18px 20px;border:1px solid var(--color-light-gray);border-radius:12px;background:var(--color-lighter-gray)}
.hk-trending-title{display:flex;align-items:center;gap:8px;margin:0 0 14px;font-size:1.3rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--color-secondary-text)}
.hk-trending-dot{width:8px;height:8px;border-radius:50%;background:#ff5a36;box-shadow:0 0 0 3px rgba(255,90,54,.2)}
.hk-trending-list{display:grid;grid-template-columns:repeat(3,1fr);gap:14px 22px;margin:0;padding:0;list-style:none}
.hk-trending-item{margin:0;padding:0}
.hk-trending-item a{display:flex;align-items:center;gap:12px;color:var(--color-darker-gray);text-decoration:none}
.hk-trending-item a:hover .hk-trending-text{text-decoration:underline;text-underline-offset:3px}
.hk-trending-num{flex:0 0 auto;width:24px;font-size:2rem;font-weight:800;color:var(--color-mid-gray);text-align:center;line-height:1}
.hk-trending-img{flex:0 0 auto;width:64px;height:44px;object-fit:cover;border-radius:6px;background:var(--color-light-gray)}
.hk-trending-text{font-size:1.5rem;font-weight:600;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
@media(max-width:991px){.hk-trending-list{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.hk-trending{padding:14px}.hk-trending-list{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:12px;padding-bottom:12px;scrollbar-width:thin;scrollbar-color:var(--color-mid-gray) transparent}.hk-trending-list::-webkit-scrollbar{height:4px}.hk-trending-list::-webkit-scrollbar-track{background:transparent}.hk-trending-list::-webkit-scrollbar-thumb{background:var(--color-mid-gray);border-radius:4px}.hk-trending-item{flex:0 0 85%;scroll-snap-align:start}}
/* v1.1.12: tighten mobile homepage gap above Trending */
@media(max-width:767px){.home-template .gh-main{padding-top:20px}}
/* v1.1.13: Sodo Search popup - no white flash on first open; iframe stays transparent so the page shows through, lightly dimmed */
#sodo-search-root iframe{background:transparent!important;transition:opacity .12s ease}
#sodo-search-root iframe.hk-ss-wait{opacity:0!important}
