/* Cloud Know-How Check (cloud-know-how-check.html). Builds on the .sp page shell (cb-support.css) and the .sg hero (cb-suggest.css). Scoped to .kh.
   One card changes between three states (start, question, result), so the page does not jump. Night mode is written here, with variables. */
.kh {
    --kh-surface: #fff; --kh-soft: #f6f2ff; --kh-line: #e2d9f3; --kh-ring: #e9e3f6; --kh-shadow: 0 10px 30px rgba(84, 27, 163, .08);
    --kh-good: #1f8a4c; --kh-good-bg: #eaf7ef; --kh-good-ink: #14532d;
    --kh-part: #c98a00; --kh-part-bg: #fff6df; --kh-part-ink: #6b4a00;
    --kh-miss: #c4283d; --kh-miss-bg: #fdeef0; --kh-miss-ink: #8a1d2c;
}
html[data-cb-theme="dark"] .kh {
    --kh-surface: #1a1624; --kh-soft: #221b33; --kh-line: #392f4e; --kh-ring: #2d2542; --kh-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --kh-good: #4cc486; --kh-good-bg: #12281c; --kh-good-ink: #9be6bd;
    --kh-part: #e0a92f; --kh-part-bg: #2b2210; --kh-part-ink: #f3d58a;
    --kh-miss: #ee7385; --kh-miss-bg: #2e1218; --kh-miss-ink: #f4aab5;
}
.kh .kh-stage { margin: 1.4rem 0 0; scroll-margin-top: 80px; }
.kh .kh-card { position: relative; min-height: 26rem; padding: 1.6rem 1.6rem 1.4rem; border: 1px solid var(--kh-line); border-top: 6px solid var(--y); border-radius: 24px; background: var(--kh-surface); box-shadow: var(--kh-shadow); }
.kh .kh-card:focus { outline: 0; }
.kh .kh-in { animation: kh-in .28s ease both; }
@keyframes kh-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .kh .kh-in { animation: none; } .kh * { transition: none !important; } }
.kh .kh-h { margin: 0 0 .25rem; font-size: 1.35rem; font-weight: 800; line-height: 1.3; color: var(--ink); }
.kh .kh-sub { margin: 0 0 1.1rem; color: var(--muted); }
.kh .kh-fine { margin: .9rem 0 0; font-size: .84rem; color: var(--muted); }
.kh .kh-fine i { margin-right: .3rem; color: var(--brand); }

/* start */
.kh .kh-areas { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.2rem; padding: 0; list-style: none; }
.kh .kh-areas li { display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .75rem .28rem .6rem; border: 1px solid var(--kh-line); border-radius: 999px; background: var(--kh-soft); font-size: .84rem; font-weight: 700; color: var(--ink); }
.kh .kh-areas i { color: var(--brand); font-size: .95rem; line-height: 1; }
.kh .kh-runs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin: 0 0 1.2rem; padding: 0; border: 0; min-width: 0; }
.kh .kh-run { position: relative; display: block; margin: 0; cursor: pointer; }
.kh .kh-run input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.kh .kh-run-in { display: grid; gap: .15rem; padding: 1rem 1.1rem; border: 2px solid var(--kh-line); border-radius: 16px; background: var(--kh-surface); transition: border-color .12s, background .12s, box-shadow .12s; }
.kh .kh-run-in b { font-size: 1.1rem; font-weight: 800; color: var(--ink); }
.kh .kh-run-in span { font-size: .88rem; color: var(--muted); }
.kh .kh-run-in em { justify-self: start; margin-top: .3rem; padding: .05rem .6rem; border-radius: 999px; background: var(--y); color: #3b1478; font-size: .72rem; font-style: normal; font-weight: 800; }
.kh .kh-run:hover .kh-run-in { border-color: #bda8e6; }
.kh .kh-run input:checked + .kh-run-in { border-color: var(--brand); background: var(--kh-soft); box-shadow: 0 0 0 3px rgba(84, 27, 163, .14); }
.kh .kh-run input:focus-visible + .kh-run-in { outline: 3px solid var(--y) !important; outline-offset: 2px; }
.kh .kh-go { display: inline-flex; align-items: center; gap: .5rem; padding: .85rem 1.6rem; border: 0; border-radius: 12px; background: var(--y); color: #3b1478; font-size: 1.05rem; font-weight: 800; cursor: pointer; box-shadow: 0 .125rem .3rem rgba(0, 0, 0, .12); }
.kh .kh-go:hover { background: #f5a800; }
.kh .kh-go:focus-visible, .kh .kh-btn:focus-visible, .kh .kh-opt:focus-visible, .kh .kh-link:focus-visible { outline: 3px solid var(--brand) !important; outline-offset: 2px; }

/* question */
.kh .kh-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: .4rem .9rem; margin: 0 0 .7rem; }
.kh .kh-count { margin: 0; font-size: .9rem; font-weight: 800; color: var(--muted); }
.kh .kh-dom { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .75rem .2rem .6rem; border-radius: 999px; background: var(--kh-soft); border: 1px solid var(--kh-line); font-size: .82rem; font-weight: 800; color: var(--brand); }
.kh .kh-prog { display: flex; gap: 4px; margin: 0 0 1.3rem; padding: 0; list-style: none; }
.kh .kh-prog li { flex: 1 1 0; height: 8px; border-radius: 999px; background: var(--kh-ring); transition: background .2s; }
.kh .kh-prog li.is-now { background: var(--brand); opacity: .55; }
.kh .kh-prog li.is-2 { background: var(--kh-good); }
.kh .kh-prog li.is-1 { background: var(--kh-part); }
.kh .kh-prog li.is-0 { background: var(--kh-miss); }
.kh .kh-q { margin: 0 0 1.1rem; font-size: clamp(1.18rem, 2.6vw, 1.5rem); font-weight: 800; line-height: 1.38; color: var(--ink); outline: 0; text-wrap: balance; }
.kh .kh-opts { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.kh .kh-opt { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .85rem; width: 100%; padding: .85rem 1rem; border: 2px solid var(--kh-line); border-radius: 16px; background: var(--kh-surface); color: var(--ink); font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.45; text-align: left; cursor: pointer; transition: border-color .12s, background .12s, transform .12s; }
.kh .kh-opt:hover:not(:disabled) { border-color: var(--brand); background: var(--kh-soft); }
.kh .kh-opt:active:not(:disabled) { transform: scale(.995); }
.kh .kh-letter { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--kh-soft); border: 1px solid var(--kh-line); font-size: .85rem; font-weight: 800; color: var(--brand); }
.kh .kh-opt:disabled { cursor: default; opacity: .62; }
.kh .kh-opt.is-best { opacity: 1; border-color: var(--kh-good); background: var(--kh-good-bg); }
.kh .kh-opt.is-best .kh-letter { background: var(--kh-good); border-color: var(--kh-good); color: #fff; }
.kh .kh-opt.is-picked { opacity: 1; }
.kh .kh-opt.is-picked.is-part { border-color: var(--kh-part); background: var(--kh-part-bg); }
.kh .kh-opt.is-picked.is-part .kh-letter { background: var(--kh-part); border-color: var(--kh-part); color: #fff; }
.kh .kh-opt.is-picked.is-miss { border-color: var(--kh-miss); background: var(--kh-miss-bg); }
.kh .kh-opt.is-picked.is-miss .kh-letter { background: var(--kh-miss); border-color: var(--kh-miss); color: #fff; }
.kh .kh-fb { margin: 1.1rem 0 0; padding: 1rem 1.1rem 1.05rem; border: 1px solid var(--kh-line); border-left: 6px solid var(--kh-good); border-radius: 14px; background: var(--kh-surface); }
.kh .kh-fb.is-1 { border-left-color: var(--kh-part); }
.kh .kh-fb.is-0 { border-left-color: var(--kh-miss); }
.kh .kh-fbt { display: flex; align-items: center; gap: .5rem; margin: 0 0 .3rem; font-size: 1.05rem; font-weight: 800; color: var(--kh-good-ink); }
.kh .kh-fb.is-1 .kh-fbt { color: var(--kh-part-ink); }
.kh .kh-fb.is-0 .kh-fbt { color: var(--kh-miss-ink); }
.kh .kh-fbt i { font-size: 1.25rem; line-height: 1; }
.kh .kh-why { margin: 0; font-size: .98rem; line-height: 1.55; color: var(--ink); }
.kh .kh-terms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .8rem 0 0; padding: 0; list-style: none; }
.kh .kh-terms li { padding: .4rem .65rem; border-radius: 10px; border: 1px solid var(--c); background: var(--bg); font-size: .8rem; line-height: 1.35; color: var(--cink); }
.kh .kh-terms b { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; opacity: .85; }
.kh [data-c="aws"] { --c: #e08a00; --bg: #fff7e6; --cink: #7a4a00; }
.kh [data-c="azure"] { --c: #1b9ad6; --bg: #eef8fd; --cink: #0b5a82; }
.kh [data-c="gcp"] { --c: #e5384f; --bg: #fef0f2; --cink: #a11d32; }
html[data-cb-theme="dark"] .kh [data-c="aws"] { --bg: #2a2010; --cink: #f3d297; }
html[data-cb-theme="dark"] .kh [data-c="azure"] { --bg: #0e2230; --cink: #8fd0f3; }
html[data-cb-theme="dark"] .kh [data-c="gcp"] { --bg: #2d1218; --cink: #f4a9b4; }
.kh .kh-fbfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin: .9rem 0 0; }
.kh .kh-link { font-size: .9rem; font-weight: 700; }
.kh .kh-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1.1rem; border: 1.5px solid #d3c6f0; border-radius: 12px; background: var(--kh-surface); color: var(--brand); font: inherit; font-size: .92rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.kh .kh-btn:hover { background: var(--kh-soft); color: var(--brand); }
.kh .kh-btn.is-main { background: var(--brand); border-color: var(--brand); color: #fff; }
.kh .kh-btn.is-main:hover { background: #6d3fc0; color: #fff; }
html[data-cb-theme="dark"] .kh .kh-btn.is-main { background: #7d4fd0; border-color: #7d4fd0; }
.kh .kh-btn.is-cert { background: #ffb822; border-color: #ffb822; color: #2a1500; }
.kh .kh-btn.is-cert:hover { background: #ffc94d; border-color: #ffc94d; color: #2a1500; }
.kh .kh-quit { margin: 1rem 0 0; text-align: right; }
.kh .kh-quit button { border: 0; background: none; padding: .3rem; font: inherit; font-size: .84rem; font-weight: 700; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* result */
.kh .kh-shared { margin: 0 0 1rem; padding: .6rem .9rem; border-radius: 12px; background: var(--kh-soft); border: 1px dashed var(--kh-line); font-size: .9rem; color: var(--ink); }
.kh .kh-res { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1.2rem 1.8rem; margin: 0 0 1.4rem; }
.kh .kh-ring { position: relative; width: 9.5rem; height: 9.5rem; }
.kh .kh-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.kh .kh-ring circle { fill: none; stroke-width: 11; }
.kh .kh-ring .t { stroke: var(--kh-ring); }
.kh .kh-ring .v { stroke: var(--lv, var(--brand)); stroke-linecap: round; stroke-dasharray: 0 999; transition: stroke-dasharray .9s cubic-bezier(.2, .8, .2, 1); }
.kh .kh-ring b { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: 2.3rem; font-weight: 900; line-height: 1; color: var(--ink); }
.kh .kh-ring b small { display: block; margin-top: .2rem; font-size: .72rem; font-weight: 800; color: var(--muted); }
.kh [data-lv="starter"] { --lv: #6f6aa8; } .kh [data-lv="aware"] { --lv: #1b9ad6; } .kh [data-lv="working"] { --lv: #1f8a4c; } .kh [data-lv="confident"] { --lv: #d89500; }
html[data-cb-theme="dark"] .kh [data-lv="starter"] { --lv: #a9a4e6; } html[data-cb-theme="dark"] .kh [data-lv="working"] { --lv: #4cc486; } html[data-cb-theme="dark"] .kh [data-lv="confident"] { --lv: #f0b53a; }
.kh .kh-lvname { display: inline-block; margin: 0 0 .35rem; padding: .15rem .8rem; border-radius: 999px; border: 2px solid var(--lv); font-size: .8rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--lv); }
.kh .kh-rh { margin: 0 0 .35rem; font-size: clamp(1.4rem, 3.2vw, 1.9rem); font-weight: 900; line-height: 1.2; color: var(--ink); outline: 0; }
.kh .kh-rt { margin: 0; color: var(--ink); }
.kh .kh-rows { display: grid; gap: .55rem; margin: 0 0 1.3rem; padding: 0; list-style: none; }
.kh .kh-row { display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: .3rem .8rem; padding: .65rem .8rem; border: 1px solid var(--kh-line); border-radius: 14px; background: var(--kh-surface); }
.kh .kh-row.is-weak { border-color: var(--brand); background: var(--kh-soft); }
.kh .kh-ico { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--kh-soft); color: var(--brand); font-size: 1.05rem; }
.kh .kh-row.is-weak .kh-ico { background: var(--brand); color: #fff; }
.kh .kh-rn { font-weight: 800; font-size: .95rem; color: var(--ink); }
.kh .kh-rn em { margin-left: .4rem; padding: .05rem .55rem; border-radius: 999px; background: var(--y); color: #3b1478; font-size: .7rem; font-style: normal; font-weight: 800; white-space: nowrap; }
.kh .kh-rp { font-weight: 900; color: var(--brand); }
.kh .kh-bar { grid-column: 2 / 4; height: 9px; border-radius: 999px; background: var(--kh-ring); overflow: hidden; }
.kh .kh-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #7d4fd0, #541ba3); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
html[data-cb-theme="dark"] .kh .kh-bar span { background: linear-gradient(90deg, #a473e8, #7d4fd0); }
.kh .kh-start { margin: 0 0 1.3rem; padding: 1rem 1.1rem; border: 1px solid var(--kh-line); border-radius: 16px; background: var(--kh-surface); }
.kh .kh-start h3, .kh .kh-review summary, .kh .kh-expert h3 { margin: 0 0 .25rem; font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.kh .kh-start p { margin: 0 0 .6rem; color: var(--muted); font-size: .94rem; }
.kh .kh-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.kh .kh-chips a { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .85rem; border: 1px solid #d3c6f0; border-radius: 999px; background: var(--kh-soft); font-size: .88rem; font-weight: 700; text-decoration: none; }
.kh .kh-acts { display: flex; flex-wrap: wrap; gap: .55rem; margin: 0 0 1.2rem; }
.kh .kh-review { margin: 0 0 1.2rem; border: 1px solid var(--kh-line); border-radius: 14px; background: var(--kh-surface); }
.kh .kh-review summary { cursor: pointer; padding: .75rem 1rem; margin: 0; }
.kh .kh-review ol { margin: 0; padding: .2rem 1rem 1rem 2.4rem; display: grid; gap: .9rem; }
.kh .kh-review li { font-size: .93rem; line-height: 1.5; }
.kh .kh-review li b { display: block; color: var(--ink); }
.kh .kh-review li span { display: block; color: var(--muted); }
.kh .kh-expert { display: grid; gap: .6rem; padding: 1.1rem 1.2rem; border: 1px solid #cdb8f0; border-radius: 16px; background: linear-gradient(135deg, var(--kh-soft), var(--kh-surface) 75%); }
.kh .kh-expert p { margin: 0; color: var(--muted); font-size: .94rem; }
.kh .kh-expert h3 { margin: 0; }
.kh .kh-toast { position: fixed; left: 50%; bottom: 1.4rem; z-index: 1080; transform: translate(-50%, 20px); padding: .55rem 1.1rem; border-radius: 999px; background: #1e1b3a; color: #fff; font-size: .9rem; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.kh .kh-toast.show { opacity: 1; transform: translate(-50%, 0); }
.kh .kh-how details, .kh .kh-faq details { margin: 0 0 .6rem; }
.kh .kh-how p { margin: 0 0 .6rem; }
.kh .kh-levels { display: grid; gap: .5rem; margin: .4rem 0 .8rem; padding: 0; list-style: none; }
.kh .kh-levels li { display: grid; grid-template-columns: 6.5rem 1fr; gap: .7rem; align-items: baseline; }
.kh .kh-levels b { color: var(--lv); font-weight: 900; }
@media (max-width: 575.98px) {
    .kh .kh-card { padding: 1.2rem 1rem 1rem; min-height: 24rem; border-radius: 20px; }
    .kh .kh-runs { grid-template-columns: 1fr; }
    .kh .kh-res { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .kh .kh-terms { grid-template-columns: 1fr; }
    .kh .kh-row { grid-template-columns: 2.2rem 1fr auto; }
    .kh .kh-go, .kh .kh-btn.is-main, .kh .kh-btn.is-cert { width: 100%; justify-content: center; }
    .kh .kh-levels li { grid-template-columns: 1fr; gap: 0; }
}
@media print {
    .kh .kh-runs, .kh .kh-go, .kh .kh-acts, .kh .kh-expert, .kh .kh-review, .kh .kh-quit, .kh .kh-how, .kh .kh-faq, .kh .kh-toast { display: none; }
    .kh .kh-card { box-shadow: none; }
}

/* certificate window (built by cb-knowhow-cert.js; the shared look comes from cb-share.css) */
.khc-modal .khc-field { display: flex; flex-direction: column; gap: .35rem; margin: .2rem 0 .9rem; }
.khc-modal .khc-field label { margin: 0 !important; font-size: .8rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #65648a; }
.khc-modal .khc-field input { width: 100%; padding: .7rem .9rem; border: 1.5px solid #d3c6f0; border-radius: 12px; background: #fff; color: #1e1b3a; font-size: 1.05rem; font-weight: 700; }
.khc-modal .khc-field input:focus { outline: 3px solid #ffb822; outline-offset: 1px; border-color: #541ba3; }
.khc-modal .khc-field p { margin: 0; font-size: .82rem; color: #5f5d7a; }
.khc-modal .cbs-btn:disabled { opacity: .5; cursor: not-allowed; }
.khc-modal .cbs-social a.is-off { opacity: .45; cursor: not-allowed; }
.khc-modal .cbs-preview { width: 100%; max-height: none; }
html[data-cb-theme="dark"] .khc-modal .khc-field input { background: #241d33; border-color: #392f4e; color: #f1ecff; }
html[data-cb-theme="dark"] .khc-modal .khc-field label, html[data-cb-theme="dark"] .khc-modal .khc-field p { color: #b9b3d8; }
