@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');:root{--bg:#f7f7f5;--panel:#f7f7f5;--panel2:#f7f7f5;--line:#d9dad8;--text:#17191c;--muted:#666b73;--soft:#5f646b;--accent:#a8b1ff;--accent2:#6ee7ff;--max:1240px;--r:18px}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-family:'DM Sans',system-ui,sans-serif;line-height:1.5}a{text-decoration:none;color:inherit}button,input,textarea,select{font:inherit}button{cursor:pointer}.wrap{width:min(calc(100% - 42px),var(--max));margin:auto}.nav{height:76px;display:flex;align-items:center;justify-content:space-between;gap:20px}.top{position:sticky;top:0;z-index:40;background:rgba(8,9,11,.82);backdrop-filter:blur(18px);border-bottom:1px solid rgba(255,255,255,.06)}.brand{font-family:'Space Grotesk';font-size:26px;font-weight:700;letter-spacing:-1.5px}.navlinks{display:flex;gap:28px;align-items:center;font-size:14px;color:#b8bcc4}.navlinks a:hover,.navlinks a.active{color:#fff}.actions{display:flex;align-items:center;gap:8px}.btn{border:1px solid #383c44;background:#181a1f;color:#f6f7f8;padding:10px 15px;border-radius:10px;font-weight:700}.btn:hover{background:#23262c}.btn.primary{background:#eef0ff;color:#101218;border-color:#eef0ff}.btn.primary:hover{background:#fff}.btn.danger{border-color:#63383d;color:#ffb4b4;background:#241518}.ghost{background:transparent;border-color:transparent}.hero{min-height:calc(100vh - 77px);display:flex;align-items:center;justify-content:center;text-align:center;position:relative;overflow:hidden;border-bottom:1px solid #202329;background:#07080a}.hero:before,.hero:after{content:"";position:absolute;border-radius:50%;pointer-events:none;filter:blur(3px)}.hero:before{width:850px;height:850px;left:-230px;top:-430px;background:radial-gradient(circle,rgba(113,139,255,.22),rgba(79,62,183,.12) 34%,transparent 67%);animation:float 12s ease-in-out infinite}.hero:after{width:950px;height:950px;right:-330px;bottom:-590px;background:radial-gradient(circle,rgba(47,230,255,.17),rgba(99,67,211,.09) 38%,transparent 67%);animation:float 15s ease-in-out infinite reverse}.noise{position:absolute;inset:0;opacity:.14;background-image:radial-gradient(rgba(255,255,255,.45) .7px,transparent .8px);background-size:26px 26px}.orb{position:absolute;width:480px;height:480px;border-radius:50%;right:13%;top:10%;background:conic-gradient(from 210deg,rgba(120,255,252,.25),rgba(120,132,255,.08),rgba(255,105,200,.2),rgba(120,255,252,.25));filter:blur(42px);opacity:.8;animation:spin 18s linear infinite}.hero-inner{position:relative;z-index:2;max-width:980px;padding:90px 0}.hero h1{font-family:'Space Grotesk';font-size:clamp(100px,17vw,230px);line-height:.78;letter-spacing:-13px;margin:0;font-weight:700;background:linear-gradient(120deg,#f6f7ff 8%,#b8c0ff 35%,#8ff5ff 56%,#fff 76%);background-size:250% auto;-webkit-background-clip:text;background-clip:text;color:transparent;animation:shine 7s ease-in-out infinite}.hero .kicker{margin:40px 0 12px;font-family:'Space Grotesk';font-size:clamp(23px,3vw,40px);letter-spacing:-1.8px;font-weight:600}.hero p{color:#a9adb7;max-width:700px;margin:0 auto 28px;font-size:17px}.cta{display:flex;justify-content:center;gap:10px}.micro{margin-top:50px;color:#6f747e;font-size:11px;text-transform:uppercase;letter-spacing:2.5px}.pagehero{padding:90px 0 65px;border-bottom:1px solid #202329;background:radial-gradient(circle at 80% 0,rgba(129,143,255,.12),transparent 30%),radial-gradient(circle at 15% 20%,rgba(66,234,255,.08),transparent 28%),#08090b}.eyebrow{font-size:11px;letter-spacing:2.4px;text-transform:uppercase;color:#858a94;font-weight:800;margin-bottom:15px}.pagehero h1{font-family:'Space Grotesk';font-size:clamp(50px,7vw,92px);line-height:.95;letter-spacing:-5px;margin:0 0 18px}.lead{font-size:17px;color:#a1a6b0;max-width:760px}.section{padding:70px 0}.toolbar{display:flex;gap:10px;flex-wrap:wrap;margin:30px 0}.input,.select,.textarea{width:100%;background:#0e1013;color:#f5f6f7;border:1px solid #2e3239;border-radius:10px;padding:12px 13px;outline:none}.input:focus,.select:focus,.textarea:focus{border-color:#8793ff}.toolbar .input{max-width:420px}.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.card,.exam-card{background:linear-gradient(145deg,#13161a,#0e1013);border:1px solid #262a31;border-radius:var(--r);padding:25px;min-height:210px;transition:.2s}.card:hover,.exam-card:hover{transform:translateY(-4px);border-color:#444a55}.exam-card{min-height:250px;border-radius:14px}.tag{font-size:11px;text-transform:uppercase;letter-spacing:1.8px;color:#858b96;font-weight:800}.card h3,.exam-card h2{font-family:'Space Grotesk';font-size:23px;letter-spacing:-.8px;margin:35px 0 10px}.card p,.exam-card p{color:#989da7;font-size:14px}.meta,.exam-meta{display:flex;justify-content:space-between;gap:12px;margin-top:20px;color:#717680;font-size:12px}.rows{border-top:1px solid #272a30}.row{display:grid;grid-template-columns:1fr 170px 150px;gap:20px;align-items:center;padding:20px 0;border-bottom:1px solid #202329}.row h3{font-family:'Space Grotesk';margin:0;font-size:18px}.row p{margin:5px 0 0;color:#888e98;font-size:13px}.right{text-align:right}.about-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}.bigcard{border:1px solid #272a31;background:#101216;border-radius:20px;padding:32px;min-height:330px}.bigcard h2{font-family:'Space Grotesk';font-size:34px;letter-spacing:-2px;margin:15px 0}.bigcard p{color:#989da6}.footer{border-top:1px solid #202329;padding:55px 0 35px}.footgrid{display:flex;justify-content:space-between;gap:30px}.footlinks{display:flex;gap:20px;color:#8d929c;font-size:13px}.small{color:#70757e;font-size:12px}.auth{min-height:calc(100vh - 77px);display:grid;place-items:center;padding:60px 20px;background:radial-gradient(circle at 50% 10%,rgba(125,140,255,.12),transparent 32%),#08090b}.authbox{width:min(460px,100%);border:1px solid #2b2f37;background:#111318;border-radius:22px;padding:32px;box-shadow:0 30px 100px #0008}.authbox h1{font-family:'Space Grotesk';font-size:40px;letter-spacing:-2px;margin:0 0 8px}.authbox p{color:#9297a0}.field{margin:16px 0}.field label{display:block;font-size:12px;color:#9aa0aa;margin-bottom:7px}.submit{width:100%;padding:13px;border:0;border-radius:10px;background:#aeb7ff;color:#0e1118;font-weight:800}.notice{margin-top:15px;font-size:13px;color:#aeb4bf}.error{color:#ff9f9f}.success{color:#a9f7cf}.admin{padding:55px 0}.admin-grid{display:grid;grid-template-columns:260px 1fr;gap:18px}.admin-side,.admin-main{border:1px solid #292d34;background:#101216;border-radius:18px}.admin-side{padding:14px;height:max-content}.admin-side button{width:100%;text-align:left;background:transparent;border:0;color:#aeb3bc;padding:12px;border-radius:9px}.admin-side button.active,.admin-side button:hover{background:#1b1e24;color:#fff}.admin-main{padding:25px}.admin-head{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:20px}.admin-head h2{font-family:'Space Grotesk';margin:0}.admin-count{display:block;color:#737985;font-size:12px;margin-top:4px}.formgrid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.full{grid-column:1/-1}.actionsline{display:flex;gap:8px;flex-wrap:wrap;margin-top:15px}.table{width:100%;border-collapse:collapse}.table th,.table td{text-align:left;padding:13px 10px;border-bottom:1px solid #282c33;font-size:13px}.table th{color:#7e848e;text-transform:uppercase;font-size:10px;letter-spacing:1.4px}.empty{padding:35px 0;color:#747a84}.toast{position:fixed;right:22px;bottom:22px;z-index:100;padding:13px 17px;border:1px solid #3a3f48;background:#16191e;border-radius:10px;display:none}.toast.show{display:block}.exam-screen{min-height:100vh;background:#08090b;padding:24px 4vw}.exam-top{position:sticky;top:0;z-index:20;background:rgba(13,15,19,.96);border:1px solid #292d34;border-radius:16px;padding:18px 22px;display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:24px;backdrop-filter:blur(15px)}.exam-label{font-size:10px;letter-spacing:2px;text-transform:uppercase;color:#808792;font-weight:800}.exam-top h1{font-family:'Space Grotesk';font-size:24px;letter-spacing:-1px;margin:3px 0 0}.exam-clock{font-family:'Space Grotesk';font-variant-numeric:tabular-nums;font-size:26px;font-weight:700;letter-spacing:1px}.exam-actions{display:flex;gap:8px}.exam-paper{width:min(900px,100%);margin:55px auto 80px}.exam-paper-title{margin-bottom:55px}.exam-paper-title h2{font-family:'Space Grotesk';font-size:42px;letter-spacing:-2px;margin:0 0 8px}.exam-paper-title p{color:#9298a3}.exam-question{padding:42px 0;border-bottom:1px solid #242830}.problem-number{font-family:'Space Grotesk';font-weight:700;font-size:16px;letter-spacing:.4px;color:#d9def0;margin-bottom:18px}.question-text{font-size:19px;line-height:1.85;margin:0 0 25px;white-space:pre-wrap}.exam-answer{min-height:210px;resize:vertical}.exam-finished{min-height:100vh;display:grid;place-items:center;text-align:center;background:#08090b;padding:40px}.exam-finished h1{font-family:'Space Grotesk';font-size:60px}.exam-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.exam-card-actions{margin-top:24px;display:flex;align-items:center;justify-content:space-between}.exam-completed{font-size:12px;text-transform:uppercase;letter-spacing:1.5px;color:#7e8795}.history-block{margin-top:75px}.history-block h2{font-family:'Space Grotesk';font-size:34px;letter-spacing:-1.5px;margin:0 0 20px}.history-list{border-top:1px solid #252930}.history-row{display:flex;justify-content:space-between;gap:20px;padding:16px 0;border-bottom:1px solid #252930;color:#b0b5bf;font-size:14px}.contest-page,.article-page{background:#08090b;min-height:100vh}.contest-hero{padding:78px 0 55px;background:radial-gradient(circle at 75% 0,rgba(129,143,255,.10),transparent 30%),#08090b;border-bottom:1px solid #1e2127}.contest-wrap,.article-wrap{max-width:920px}.contest-paper,.article-paper{width:100%;background:transparent}.contest-problem{padding:46px 0 54px;border:0;background:transparent}.contest-problem+.contest-problem{border-top:1px solid rgba(255,255,255,.07)}.contest-problem-heading{font-family:'Space Grotesk';font-size:20px;font-weight:700;letter-spacing:.3px;margin-bottom:22px;color:#e5e9f4}.contest-problem-heading span{display:inline-flex;min-width:42px;height:42px;padding:0 12px;align-items:center;justify-content:center;border:1px solid #303642;border-radius:10px;background:#111419}.contest-problem .question-text{font-size:19px;line-height:1.9}.contest-actions,.article-actions{margin-top:25px}.article-paper{font-size:18px;line-height:1.95;white-space:pre-wrap;color:#edf0f5}.editor-card{margin-top:28px;padding:30px;border:1px solid #2a2f37;background:#0f1115;border-radius:18px}.editor-section{margin:30px 0;padding-top:25px;border-top:1px solid #282d35}.editor-section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:20px}.editor-section-head h3{font-family:'Space Grotesk';margin:0;font-size:24px}.editor-section-head p{margin:5px 0 0;color:#858c98;font-size:13px}.question-editor-row{padding:22px 0;border-top:1px solid #272c34}.question-editor-top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px}.question-editor-top strong{font-family:'Space Grotesk';font-size:18px}.editor-empty{padding:20px 0}.error-page{min-height:100vh;display:grid;place-items:center;text-align:center;padding:40px;background:#08090b}.error-page h1{font-family:'Space Grotesk';font-size:48px;margin:0}.error-page p{color:#9298a2}.error-page a{color:#9eacff}.article-paper p{margin:0 0 24px}@media print{body{background:white!important;color:#111!important}.top,.footer,.exam-actions,.exam-top button,.exam-card-actions,.article-actions,.contest-actions{display:none!important}.exam-screen{padding:0;background:white!important}.exam-top{display:block;position:static;border:0;background:white;padding:0}.exam-top h1{font-size:30px;color:#111}.exam-clock{color:#111;margin-top:10px}.exam-paper{margin:30px 0}.exam-paper-title h2,.exam-paper-title p,.problem-number,.question-text{color:#111!important}.exam-question{break-inside:avoid;border-bottom:1px solid #ddd}.exam-answer{border:1px solid #bbb!important;color:#111!important;background:white!important}.contest-page,.article-page{background:white!important;color:#111!important}.contest-hero,.contest-problem,.article-paper{background:white!important;color:#111!important}.contest-hero{border:0}.contest-problem+.contest-problem{border-color:#ddd}.contest-problem-heading{color:#111}.contest-problem-heading span{border-color:#bbb;background:white}.article-paper{color:#111!important}}
@keyframes shine{0%,100%{background-position:0% 50%}50%{background-position:100% 50%}}@keyframes float{50%{transform:translate(25px,20px) scale(1.05)}}@keyframes spin{to{transform:rotate(360deg)}}@media(max-width:900px){.navlinks{display:none}.cards,.exam-grid{grid-template-columns:1fr 1fr}.about-grid,.admin-grid{grid-template-columns:1fr}.row{grid-template-columns:1fr}.right{text-align:left}.admin-side{display:flex;overflow:auto}.admin-side button{min-width:max-content}.footgrid{flex-direction:column}.exam-top{grid-template-columns:1fr auto}.exam-actions{grid-column:1/-1}.exam-clock{grid-column:2;grid-row:1}.contest-wrap,.article-wrap{max-width:100%}}@media(max-width:620px){.wrap{width:min(calc(100% - 28px),var(--max))}.cards,.exam-grid{grid-template-columns:1fr}.hero h1{letter-spacing:-7px}.hero-inner{padding:70px 0}.cta{flex-direction:column;padding:0 35px}.pagehero{padding:65px 0 50px}.section{padding:55px 0}.formgrid{grid-template-columns:1fr}.full{grid-column:auto}.exam-screen{padding:14px}.exam-top{grid-template-columns:1fr}.exam-clock{grid-column:auto;grid-row:auto}.exam-actions{grid-column:auto}.exam-top h1{font-size:20px}.exam-paper-title h2{font-size:34px}.contest-problem{padding:34px 0}.question-text{font-size:17px}}
/* Exam layout refinement */
.exam-screen{min-height:100vh;padding:18px 3vw;background:#08090b}
.exam-top{position:relative;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:24px;width:min(1180px,94vw);margin:0 auto;padding:12px 0 22px;background:transparent;border:0;border-radius:0;box-shadow:none;backdrop-filter:none}
.exam-heading{justify-self:start;min-width:0}
.exam-heading h1{margin:3px 0 0;font-family:'Space Grotesk';font-size:26px;letter-spacing:-1px}
.exam-clock{justify-self:center;font-family:'Space Grotesk';font-variant-numeric:tabular-nums;font-size:52px;font-weight:800;letter-spacing:1px;line-height:1}
.exam-top .exam-actions{justify-self:end;display:flex;gap:8px}
.exam-paper{width:min(1180px,94vw);margin:28px auto 80px}
.exam-paper-title{margin-bottom:48px}
.exam-paper-title h2{font-size:50px}
.exam-question{padding:48px 0}
.question-text{font-size:21px;line-height:1.9}
@media(max-width:800px){
 .exam-top{grid-template-columns:1fr auto;width:94vw}
 .exam-clock{grid-column:2;grid-row:1;font-size:28px}
 .exam-top .exam-actions{grid-column:1 / -1;justify-self:end}
 .exam-paper{width:94vw}
 .exam-paper-title h2{font-size:38px}
 .question-text{font-size:18px}
}
/* Final exam timer-only header */
.exam-top{display:none!important}
.exam-clock-only{width:100%;display:flex;justify-content:center;align-items:center;background:transparent;border:0;box-shadow:none;padding:8px 0 18px;margin:0}
.exam-clock-only .exam-clock{font-family:'Space Grotesk';font-variant-numeric:tabular-nums;font-size:58px;font-weight:800;letter-spacing:1px;line-height:1;background:transparent;border:0;box-shadow:none;padding:0}

/* Tools dropdown — isolated addition */
.nav-tool{position:relative;height:76px;display:flex;align-items:center}
.nav-tool-label{color:#b8bcc4;font-size:14px;cursor:default;display:flex;align-items:center;height:100%;transition:.18s}
.nav-tool:hover .nav-tool-label{color:#fff}
.tools-menu{position:absolute;top:calc(100% - 7px);left:50%;transform:translate(-50%,8px);width:220px;padding:8px;background:rgba(16,18,22,.98);border:1px solid #292d34;border-radius:14px;box-shadow:0 20px 55px rgba(0,0,0,.35);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .16s ease,transform .16s ease,visibility .16s ease;backdrop-filter:blur(18px)}
.nav-tool:hover .tools-menu,.nav-tool:focus-within .tools-menu{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,0)}
.tools-menu a{display:flex!important;flex-direction:column;gap:2px;padding:11px 12px;border-radius:9px;color:#f2f4f7!important;font-size:14px!important;line-height:1.25}
.tools-menu a:hover{background:#1d2026;color:#fff!important}
.tools-menu small{color:#858b96;font-size:11px}
html[data-theme="light"] .nav-tool-label{color:#656a72}
html[data-theme="light"] .nav-tool:hover .nav-tool-label{color:#111}
html[data-theme="light"] .tools-menu{background:rgba(255,255,255,.98);border-color:#dedfe2;box-shadow:0 20px 55px rgba(0,0,0,.12)}
html[data-theme="light"] .tools-menu a{color:#17191c!important}
html[data-theme="light"] .tools-menu a:hover{background:#f0f1f2;color:#111!important}
html[data-theme="light"] .tools-menu small{color:#70757e}
@media(max-width:900px){.nav-tool{display:none}}

/* Content archive cards */
.cards .card{position:relative;text-align:center!important;padding-bottom:58px}
.cards .card > .tag{position:absolute;left:25px;bottom:21px;text-align:left;white-space:nowrap;font-size:10px;letter-spacing:1.5px;color:#17191c!important;padding:5px 9px;border:1px solid #fff;border-radius:7px;background:#fff!important}
.cards .card h3{text-align:center!important;margin-left:auto;margin-right:auto}
.cards .card p{text-align:center}
.detail-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:55px}
.detail-actions .save-btn{margin-left:auto}
@media(max-width:620px){.detail-actions{flex-wrap:wrap}.detail-actions .save-btn{margin-left:0}}

.detail-actions-right{display:flex;align-items:center;gap:8px;margin-left:auto}
.solved-btn.solved-active{background:#eef0ff;color:#101218;border-color:#eef0ff}
@media(max-width:620px){.detail-actions-right{width:100%;margin-left:0;justify-content:flex-end}}
html[data-theme="light"] .cards .card > .tag{background:#fff!important;color:#17191c!important;border-color:#fff!important}

/* Unified content/detail system */
.problem-page .section,.contest-page .section,.article-page .section{background:var(--bg)!important}
.problem-detail,.problem-solution,.contest-paper,.article-paper{width:100%;background:transparent!important;border:0!important}
.problem-page .section>.wrap,.contest-page .section>.wrap,.article-page .section>.wrap{max-width:1180px!important}
.problem-detail,.contest-paper .question-text,.article-paper{font-size:22px!important;line-height:2!important}
.problem-detail{max-width:none!important}
.contest-problem{padding:58px 0 66px!important}
.contest-problem+.contest-problem{border-top:1px solid var(--line)!important}
.contest-problem-heading{font-size:23px!important;margin-bottom:28px!important}
.contest-problem-heading span{font-size:16px!important}
.article-paper{max-width:none!important}
.detail-image{max-height:650px!important;margin:38px auto!important}
.detail-actions{margin-top:70px!important;padding-top:30px!important;border-top:1px solid var(--line)}
.solution-content{font-size:21px!important;line-height:1.95!important}
.problem-page .pagehero,.article-page .pagehero,.contest-hero{background:var(--bg)!important;border-bottom-color:var(--line)!important}
html[data-theme="light"] .problem-page .section,
html[data-theme="light"] .contest-page .section,
html[data-theme="light"] .article-page .section,
html[data-theme="light"] .problem-page .pagehero,
html[data-theme="light"] .contest-hero,
html[data-theme="light"] .article-page .pagehero{background:#f7f7f5!important}
html[data-theme="light"] .problem-detail,
html[data-theme="light"] .problem-solution,
html[data-theme="light"] .contest-paper,
html[data-theme="light"] .article-paper{background:transparent!important;color:#17191c!important}
html[data-theme="light"] .detail-actions{border-top-color:#dedfe2!important}
html[data-theme="light"] .contest-problem+.contest-problem{border-top-color:#dedfe2!important}
html[data-theme="light"] .solution-content{border-top-color:#dedfe2!important}
html[data-theme="light"] .brand{color:#050505!important}
html[data-theme="dark"] .brand{color:#f3f4f6!important}
.auth,.authbox,.authbox form{color:var(--text)}
.authbox{background:var(--panel)!important;border-color:var(--line)!important}
.authbox .input{background:var(--bg)!important;border-color:var(--line)!important}
.google-btn{width:100%;display:flex;align-items:center;justify-content:center;gap:11px;height:48px;background:var(--panel2)!important;border:1px solid var(--line)!important;color:var(--text)!important;border-radius:11px;font-weight:700;transition:.18s}
.google-btn:hover{transform:translateY(-1px);border-color:#5a6270!important}
.google-btn:disabled{opacity:.65;cursor:wait;transform:none}
.google-icon{width:18px;height:18px;flex:0 0 18px}
.auth-divider{display:flex;align-items:center;gap:12px;margin:20px 0;color:#747a84}
.auth-divider span{height:1px;flex:1;background:currentColor;opacity:.22}
html[data-theme="light"] .auth,.authbox{background:var(--panel)!important}
html[data-theme="light"] .authbox .input{background:#fff!important}
html[data-theme="light"] .google-btn{background:#fff!important;color:#17191c!important;border-color:#d9dbde!important}

.google-spinner{width:17px;height:17px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:googleSpin .7s linear infinite}
@keyframes googleSpin{to{transform:rotate(360deg)}}

/* KARP detail pages — intentionally spacious */
.problem-page .section,.contest-page .section,.article-page .section{padding-top:72px!important;padding-bottom:110px!important;background:var(--bg)!important}
.problem-page .section>.wrap,.contest-page .section>.wrap,.article-page .section>.wrap{width:min(calc(100% - 56px),1400px)!important;max-width:1400px!important}
.problem-detail,.article-paper,.contest-paper .question-text{font-size:25px!important;line-height:2.02!important}
.problem-detail{min-height:360px}
.article-paper{min-height:500px}
.contest-problem{padding:76px 0 88px!important;min-height:340px}
.contest-problem-heading{font-size:25px!important;margin-bottom:32px!important}
.contest-problem-heading span{min-width:50px!important;height:50px!important;font-size:18px!important}
.detail-image{max-height:720px!important}
.problem-page .pagehero,.contest-hero,.article-page .pagehero{padding-top:105px!important;padding-bottom:82px!important;background:var(--bg)!important}
.detail-actions{margin-top:86px!important;padding-top:34px!important;background:transparent!important;border-top:1px solid var(--line)!important}
html[data-theme="light"] .problem-page .section,html[data-theme="light"] .contest-page .section,html[data-theme="light"] .article-page .section,html[data-theme="light"] .problem-page .pagehero,html[data-theme="light"] .contest-hero,html[data-theme="light"] .article-page .pagehero{background:#f7f7f5!important}
html[data-theme="light"] .problem-detail,html[data-theme="light"] .problem-solution,html[data-theme="light"] .contest-paper,html[data-theme="light"] .article-paper{background:transparent!important;color:#17191c!important}
html[data-theme="light"] .detail-actions{border-color:#dedfe2!important}
html[data-theme="light"] .contest-problem+.contest-problem{border-color:#dedfe2!important}
@media(max-width:700px){
 .problem-page .section>.wrap,.contest-page .section>.wrap,.article-page .section>.wrap{width:calc(100% - 30px)!important}
 .problem-detail,.article-paper,.contest-paper .question-text{font-size:19px!important;line-height:1.9!important}
 .problem-detail{min-height:220px}.article-paper{min-height:300px}
 .contest-problem{padding:50px 0 62px!important;min-height:0}
 .contest-problem-heading{font-size:21px!important}
}

/* KARP global theme consistency */
html[data-theme="dark"]{
  --site-bg:#08090b;--site-panel:#101216;--site-panel2:#15171c;--site-line:#292d34;--site-text:#f3f4f6;--site-muted:#969ba5;
}
html[data-theme="light"]{
  --site-bg:#f7f7f5;--site-panel:#ffffff;--site-panel2:#f1f2f3;--site-line:#dedfe2;--site-text:#17191c;--site-muted:#626770;
}
body,main,.section,.pagehero,.contest-page,.article-page,.account-page,.auth{background:var(--site-bg)!important;color:var(--site-text)!important}
.top,.footer,.card,.exam-card,.bigcard,.account-card,.account-stat,.authbox,.admin-side,.admin-main,.editor-card{
  background:var(--site-panel)!important;color:var(--site-text)!important;border-color:var(--site-line)!important;
}
.card:hover,.exam-card:hover{border-color:var(--site-line)!important}
.card p,.exam-card p,.lead,.small,.card-subtitle,.profile-meta span,.account-stat-label,.trend-label,.topic-line,.pace-grid span,.exam-history-row .small{color:var(--site-muted)!important}
.btn,.google-btn,.theme-toggle,.language-switch{background:var(--site-panel2)!important;color:var(--site-text)!important;border-color:var(--site-line)!important}
.btn.primary,.submit{background:#17191c!important;color:#fff!important;border-color:#17191c!important}
html[data-theme="dark"] .btn.primary,html[data-theme="dark"] .submit{background:#eef0ff!important;color:#101218!important;border-color:#eef0ff!important}
.btn:hover,.google-btn:hover{background:var(--site-panel2)!important;border-color:var(--site-line)!important}
.cards .card > .tag{
  background:var(--site-panel2)!important;color:var(--site-text)!important;border-color:var(--site-line)!important;
}
html[data-theme="light"] .cards .card > .tag{background:#fff!important;color:#17191c!important;border-color:#d9dbde!important}
.problem-page .section,.contest-page .section,.article-page .section,
.problem-page .pagehero,.contest-hero,.article-page .pagehero,
.problem-detail,.problem-solution,.contest-paper,.article-paper,.detail-actions,
.contest-problem{background:var(--site-bg)!important;color:var(--site-text)!important}
.problem-detail,.problem-solution,.contest-paper,.article-paper,.contest-problem *{color:var(--site-text)!important}
.detail-actions,.contest-problem+.contest-problem,.solution-content{border-color:var(--site-line)!important}
.authbox .input,.input,.select,.textarea{background:var(--site-bg)!important;color:var(--site-text)!important;border-color:var(--site-line)!important}
html[data-theme="light"] .authbox .input,html[data-theme="light"] .input,html[data-theme="light"] .select,html[data-theme="light"] .textarea{background:#fff!important;color:#17191c!important;border-color:#d4d7da!important}
html[data-theme="dark"] .trend-bar,html[data-theme="dark"] .topic-progress i{background:#eef0ff!important}
html[data-theme="light"] .trend-bar,html[data-theme="light"] .topic-progress i{background:#17191c!important}
html[data-theme="dark"] .topic-ring{background:conic-gradient(#eef0ff var(--pct),#282d35 0)!important}
html[data-theme="light"] .topic-ring{background:conic-gradient(#17191c var(--pct),#e4e6e8 0)!important}
html[data-theme="dark"] .topic-ring:after{background:#101216!important}
html[data-theme="light"] .topic-ring:after{background:#fff!important}

/* KARP final theme lock */
html[data-theme="dark"]{--bg:#08090b;--panel:#08090b;--panel2:#111317;--line:transparent;--text:#f3f4f6;--muted:#969ba5}
html[data-theme="light"]{--bg:#f7f7f5;--panel:#f7f7f5;--panel2:#fff;--line:transparent;--text:#17191c;--muted:#626770}
body,.section,.pagehero,.contest-page,.article-page,.account-page,.auth{background:var(--bg)!important;color:var(--text)!important}
.top,.footer,.card,.exam-card,.bigcard,.account-card,.account-stat,.authbox,.admin-side,.admin-main,.editor-card,.mock-builder,.mock-paper{background:var(--panel)!important;color:var(--text)!important;border-color:transparent!important;box-shadow:none!important}
.problem-page .section,.contest-page .section,.article-page .section,.problem-page .pagehero,.contest-hero,.article-page .pagehero,.problem-detail,.problem-solution,.contest-paper,.article-paper,.contest-problem,.detail-actions{background:var(--bg)!important;color:var(--text)!important}
.detail-actions,.contest-problem+.contest-problem,.solution-content,.mock-paper-head,.mock-question{border-color:transparent!important}
.problem-page .section,.contest-page .section,.article-page .section{padding-top:70px!important;padding-bottom:70px!important}
.problem-page .section>.wrap,.contest-page .section>.wrap,.article-page .section>.wrap{width:min(calc(100% - 42px),1240px)!important;max-width:1240px!important}
.problem-detail,.article-paper,.contest-paper .question-text{font-size:19px!important;line-height:1.9!important}
.problem-detail,.article-paper{min-height:0!important}
.contest-problem{padding:38px 0!important;min-height:0!important}
.detail-actions{margin-top:55px!important;padding-top:0!important}
.cards .card>.tag{background:var(--panel2)!important;color:var(--text)!important;border-color:transparent!important}
html[data-theme="light"] .cards .card>.tag{background:#fff!important;color:#17191c!important}
.btn,.google-btn,.theme-toggle,.language-switch{background:var(--panel2)!important;color:var(--text)!important;border-color:transparent!important}
html[data-theme="dark"] .btn.primary,html[data-theme="dark"] .submit{background:#eef0ff!important;color:#101218!important;border-color:transparent!important}
html[data-theme="light"] .btn.primary,html[data-theme="light"] .submit{background:#17191c!important;color:#fff!important;border-color:transparent!important}
.input,.select,.textarea,.authbox .input{background:var(--bg)!important;color:var(--text)!important;border-color:transparent!important}
html[data-theme="light"] .input,html[data-theme="light"] .select,html[data-theme="light"] .textarea,html[data-theme="light"] .authbox .input{background:#fff!important;color:#17191c!important}


/* KARP permanent white interface */
html,body{background:#fff!important;color:#17191c!important}
body,.section,.pagehero,.contest-page,.article-page,.account-page,.auth,.exam-screen,.exam-finished,.error-page{background:#fff!important;color:#17191c!important}
.top,.footer,.card,.exam-card,.bigcard,.account-card,.account-stat,.authbox,.admin-side,.admin-main,.editor-card,.mock-builder,.mock-paper,.contest-problem,.contest-paper,.article-paper{background:#fff!important;color:#17191c!important;border-color:#e1e3e7!important}
.top{background:rgba(255,255,255,.97)!important;border-bottom:1px solid #e1e3e7!important}
.navlinks{color:#626770!important}.navlinks a:hover,.navlinks a.active{color:#17191c!important}.brand{color:#17191c!important}
.btn,.google-btn,.language-switch{background:#f3f4f6!important;color:#17191c!important;border-color:#d9dce1!important}
.btn.primary,.submit{background:#17191c!important;color:#fff!important;border-color:#17191c!important}
.input,.select,.textarea,.authbox .input{background:#fff!important;color:#17191c!important;border-color:#d9dce1!important}
.card p,.exam-card p,.lead,.small,.muted,.profile-email,.profile-meta span,.account-stat-label,.exam-history-row .small{color:#626770!important}
.pagehero,.contest-hero,.hero{background:#fff!important;border-bottom-color:#e1e3e7!important}
.hero:before,.hero:after,.noise,.orb{display:none!important}.hero h1{background:none!important;color:#17191c!important;-webkit-text-fill-color:#17191c!important}
.contest-problem+.contest-problem,.detail-divider,.solution-content,.exam-question,.rows,.row,.history-list,.history-row{border-color:#e1e3e7!important}
.cards .card,.exam-card{background:#fff!important;box-shadow:0 8px 28px rgba(20,24,30,.06)!important}
.theme-toggle{display:none!important}
.toast{background:#fff!important;color:#17191c!important;border:1px solid #d9dce1!important;box-shadow:0 12px 35px rgba(20,24,30,.12)!important}


/* KARP final surface cleanup — one continuous page background */
html[data-theme="dark"]{--bg:#08090b;--panel:#08090b;--panel2:#111317;--line:#292d34;--text:#f3f4f6;--muted:#969ba5}
html[data-theme="light"]{--bg:#f7f7f5;--panel:#f7f7f5;--panel2:#f7f7f5;--line:#dedfe2;--text:#17191c;--muted:#626770}
body,main,section,.section,.pagehero,.problem-page,.contest-page,.article-page,.mock-page,.exam-page,.exam-active-shell,.exam-enter{background:var(--bg)!important;color:var(--text)!important}
.problem-page .section,.problem-page .pagehero,.contest-page .section,.contest-page .pagehero,.article-page .section,.article-page .pagehero,.problem-detail,.problem-solution,.contest-paper,.contest-problem,.article-paper,.detail-actions,.exam-review,.exam-paper,.exam-active-body,.exam-active-paper,.exam-enter-card,.mock-builder,.past-box,.mock-review,.mock-preview,.mock-paper{background:var(--bg)!important;color:var(--text)!important;box-shadow:none!important}
.problem-detail,.problem-solution,.contest-paper,.article-paper,.exam-review,.exam-paper,.exam-active-paper,.mock-builder,.past-box,.mock-review,.mock-preview{border-color:transparent!important}
.exam-question,.contest-problem+.contest-problem,.review-question,.preview-question,.session-question{background:transparent!important}
.exam-review-wrap,.exam-active-wrap,.mock-wrap,.exams-wrap{background:transparent!important}
.cards .card,.exam-card,.card,.bigcard,.editor-card,.admin-side,.admin-main{box-shadow:none!important}


/* KARP — FINAL CONTINUOUS SURFACE
   Every content section uses the exact page surface. No white/gray paper boxes. */
html[data-theme="light"]{
  --skin:#f7f7f5;
  --bg:var(--skin);
  --panel:var(--skin);
  --panel2:var(--skin);
}
html[data-theme="dark"]{
  --skin:#08090b;
  --bg:var(--skin);
  --panel:var(--skin);
  --panel2:#111317;
}

/* Page + all major content shells */
html[data-theme="light"] body,
html[data-theme="light"] main,
html[data-theme="light"] section,
html[data-theme="light"] article,
html[data-theme="light"] .section,
html[data-theme="light"] .pagehero,
html[data-theme="light"] .problem-page,
html[data-theme="light"] .contest-page,
html[data-theme="light"] .article-page,
html[data-theme="light"] .exam-page,
html[data-theme="light"] .exam-review-wrap,
html[data-theme="light"] .exam-review,
html[data-theme="light"] .exam-paper,
html[data-theme="light"] .exam-active-body,
html[data-theme="light"] .exam-active-paper,
html[data-theme="light"] .exam-enter,
html[data-theme="light"] .exam-enter-card,
html[data-theme="light"] .contest-hero,
html[data-theme="light"] .contest-paper,
html[data-theme="light"] .contest-problem,
html[data-theme="light"] .article-paper,
html[data-theme="light"] .problem-detail,
html[data-theme="light"] .problem-solution,
html[data-theme="light"] .detail-actions,
html[data-theme="light"] .mock-page,
html[data-theme="light"] .mock-wrap,
html[data-theme="light"] .mock-builder,
html[data-theme="light"] .past-box,
html[data-theme="light"] .mock-preview,
html[data-theme="light"] .mock-review,
html[data-theme="light"] .mock-paper,
html[data-theme="light"] .mock-session,
html[data-theme="light"] .mock-top,
html[data-theme="light"] .exam-screen,
html[data-theme="light"] .admin,
html[data-theme="light"] .admin-side,
html[data-theme="light"] .admin-main,
html[data-theme="light"] .editor-card,
html[data-theme="light"] .editor-section,
html[data-theme="light"] .question-editor-row,
html[data-theme="light"] .card,
html[data-theme="light"] .exam-card,
html[data-theme="light"] .bigcard,
html[data-theme="light"] .account-card,
html[data-theme="light"] .account-stat{
  background:var(--skin)!important;
  background-image:none!important;
  box-shadow:none!important;
}

/* No separate paper/box behind individual questions */
html[data-theme="light"] .exam-question,
html[data-theme="light"] .review-question,
html[data-theme="light"] .preview-question,
html[data-theme="light"] .session-question,
html[data-theme="light"] .contest-problem,
html[data-theme="light"] .solution-group,
html[data-theme="light"] .problem-content-markdown,
html[data-theme="light"] .solution-content{
  background:transparent!important;
}

/* Admin create/edit forms: the whole editor remains on the same skin surface. */
html[data-theme="light"] .admin-grid,
html[data-theme="light"] .admin-grid > *,
html[data-theme="light"] .formgrid,
html[data-theme="light"] .field,
html[data-theme="light"] .editor-section-head{
  background:transparent!important;
}

/* Mock/exam inner paper was the main source of the visible white/gray panel. */
html[data-theme="light"] .mock-paper,
html[data-theme="light"] .mock-preview,
html[data-theme="light"] .mock-builder,
html[data-theme="light"] .past-box,
html[data-theme="light"] .mock-review,
html[data-theme="light"] .exam-paper,
html[data-theme="light"] .exam-review{
  border:0!important;
  border-color:transparent!important;
}

/* Light theme controls can still have borders, but never a separate page surface. */
html[data-theme="light"] .input,
html[data-theme="light"] .select,
html[data-theme="light"] .textarea{
  background:var(--skin)!important;
}

/* Remove the old decorative light gradients from content headers. */
html[data-theme="light"] .pagehero,
html[data-theme="light"] .contest-hero{
  background:var(--skin)!important;
  background-image:none!important;
}

/* KARP unified light surface */
html,body{background:#f7f7f5!important;color:#17191c!important}
body,.top,.footer,.hero,.pagehero,.section,.contest-page,.article-page,.account-page,.auth,
.admin,.admin-side,.admin-main,.exam-screen,.exam-finished,.error-page,.problem-page,.mock-page,.exam-page,
.exam-active-shell,.exam-enter,.mock-session,.mock-top,.exam-active-top,.exam-active-body{
  background:#f7f7f5!important;background-image:none!important;color:#17191c!important
}
.card,.exam-card,.bigcard,.account-card,.account-stat,.authbox,.admin-mock-card,.live-presence,
.admin-exam-card,.admin-user-summary,.admin-kpi-bar,.admin-participants,.editor-card,.video-card,
.mock-builder,.mock-field,.past-box,.past-card,.mock-review,.mock-preview,.mock-paper,.exam-review,
.exam-paper,.exam-active-paper,.exam-enter-card,.problem-detail,.problem-solution,.contest-paper,
.contest-problem,.article-paper,.detail-actions{
  background:#f7f7f5!important;color:#17191c!important;box-shadow:none!important
}
.input,.select,.textarea,.video-search,.btn,.google-btn,.language-switch{
  background:#f7f7f5!important;color:#17191c!important;border-color:#d9dad8!important
}
.btn.primary,.submit{background:#2f78b7!important;color:#fff!important;border-color:#2f78b7!important}
.card,.exam-card,.bigcard,.account-card,.account-stat,.admin-mock-card,.live-presence,
.admin-exam-card,.admin-user-summary,.admin-kpi-bar,.admin-participants,.editor-card,.video-card,
.mock-field,.past-card,.mock-fullscreen-lock-card,.exam-fullscreen-lock-card{
  border-color:#d9dad8!important
}
.problem-card-link,.problem-card-link:hover,.choice span,.difficulty,.active-card,.preview-question,
.session-question,.review-question,.exam-question,.rows,.row,.history-list,.history-row{
  background:#f7f7f5!important
}
.cards .card > .tag{background:#f7f7f5!important;border-color:#d9dad8!important;color:#666b73!important}
.status-badge{background:#f7f7f5!important;border-color:#d9dad8!important}
.admin-mock-questions section,.admin-kpi-bar div,.live-person{
  background:#f7f7f5!important;border-color:#d9dad8!important
}
.detail-content,.problem-detail,.problem-solution,.contest-paper,.article-paper,.question-text,
.solution-content,.review-statement,.preview-statement,.session-statement{color:#17191c!important}
.detail-actions,.contest-problem+.contest-problem,.solution-content,.exam-question,.rows,.row,
.history-list,.history-row{border-color:#d9dad8!important}
.pagehero,.contest-hero,.hero{border-bottom-color:#d9dad8!important}
.theme-toggle{display:none!important}

/* Small controls/cards need a subtle surface contrast on the unified background. */
.choice span,.difficulty,.difficulty span,.cards .card>.tag,.tag,.status-badge,
.manual-row,.past-card,.mock-field,.history-card,.topic-card,.kpi,
.input,.select,.textarea,.question-editor-row,.editor-card .field{
  background:#eeeeeb!important;
  border-color:#d5d5d1!important;
}
.choice input:checked+span,.difficulty input:checked+span{
  background:#2f78b7!important;color:#fff!important;border-color:#2f78b7!important;
}

/* Problems archive topic badge should visibly read as a small gray box. */
.problem-card-link > .tag{
  display:inline-flex!important;
  align-self:flex-start!important;
  width:max-content!important;
  box-sizing:border-box;
  padding:5px 9px!important;
  margin:0 0 2px!important;
  border:1px solid #d5d5d1!important;
  border-radius:7px!important;
  background:#eeeeeb!important;
  color:#666b73!important;
}

/* Problems archive cards: visible gray box against the light-gray page. */
.virtual-cards .problem-card-link,
.virtual-cards .problem-card-link:hover{
  background:#eeeeeb!important;
  border:1px solid #d5d5d1!important;
}
.virtual-cards .problem-card-link .tag{
  background:#e5e5e1!important;
  border-color:#d0d0cc!important;
}


/* Final small visual cleanup requested. */
.about-grid .tag,
.exam-card > .tag{
  background:transparent!important;
  border:0!important;
  padding:0!important;
  box-shadow:none!important;
  width:auto!important;
  display:block!important;
  color:#666b73!important;
}

.contest-page .toolbar .input{
  flex:1 1 720px!important;
  width:100%!important;
  max-width:760px!important;
}

.virtual-cards .problem-card-link{
  background:#eeeeeb!important;
  border:1px solid #d5d5d1!important;
  box-shadow:0 4px 16px rgba(20,24,30,.04)!important;
}

/* Unified archive/card surfaces */
.contest-page .contest-card,
.articles-page .article-card{
  background:#eeeeeb!important;
  border:1px solid #d5d5d1!important;
  color:#17191c!important;
  box-shadow:none!important;
  min-height:178px!important;
}
.contest-page .contest-card p,
.articles-page .article-card p{color:#666b73!important}
.articles-page .article-card{min-height:205px!important}
.exams-wrap .exam-card{
  background:#eeeeeb!important;
  border:1px solid #d5d5d1!important;
  color:#17191c!important;
  box-shadow:none!important;
  min-height:220px!important;
}
.exams-wrap .exam-card p,
.exams-wrap .exam-meta{color:#666b73!important}
.mock-page .past-box{background:#f7f7f5!important;color:#17191c!important}
.mock-page .past-card,
.mock-page .active-card{
  background:#eeeeeb!important;
  border:1px solid #d5d5d1!important;
  color:#17191c!important;
  box-shadow:none!important;
  min-height:178px!important;
}
.mock-page .past-card .past-meta,
.mock-page .past-card .past-open{color:#666b73!important}
.admin-upload-status{display:inline-block;min-height:18px;margin-right:10px;color:#666b73;font-size:11px}
.admin-upload-current{margin-top:8px;font-size:11px;color:#666b73}
@media(max-width:900px){
  .contest-page .contest-card,.articles-page .article-card,.exams-wrap .exam-card,.mock-page .past-card,.mock-page .active-card{min-height:0!important}
}

