*{box-sizing:border-box}html{color-scheme:light}body{margin:0;background:#f8f9fc;color:#20243a;font:16px/1.5 "Segoe UI",Arial,sans-serif}button,input,textarea,select{font:inherit}a{color:inherit;text-decoration:none}button,select{cursor:pointer}header{height:76px;background:white;border-bottom:1px solid #e1e4ed;display:flex;align-items:center;padding:0 3.2vw;gap:19px}.brand{font-size:25px;font-weight:750;letter-spacing:-1.6px;display:flex;align-items:center}.branddot{color:#6253d6}.mark{width:40px;height:28px;position:relative;margin-right:10px}.mark:before,.mark:after{content:'';position:absolute;top:2px;border:2px solid #6556d7;border-radius:50%;width:21px;height:21px}.mark:before{background:#6556d7}.mark:after{left:13px;background:#b9b1fe88}.divider{height:22px;border-left:1px solid #ddd}.toplabel,small,.muted{color:#61697b}.studio{margin-left:auto;border:1px solid #d9dce6;border-radius:9px;padding:8px 15px;font-weight:600;background:white}.shell{display:grid;grid-template-columns:212px minmax(0,1fr);min-height:calc(100vh - 76px)}aside{background:#fff;border-right:1px solid #e1e4ed;padding:39px 15px;display:flex;flex-direction:column}aside small,.eyebrow{font:700 12px/1.5 Consolas,monospace;letter-spacing:1.6px}aside small{padding-left:15px}nav{display:grid;gap:6px;margin-top:16px}nav a{padding:11px 13px;border-radius:8px;color:#535b70;font-weight:600;font-size:15px}nav b{display:inline-block;width:28px;font-size:19px}nav a.active{background:#eceafd;color:#5344bd}.sidefoot{margin-top:auto;padding:32px 12px 0;color:#6a7182;font-size:14px}.sidefoot i{display:inline-block;width:8px;height:8px;background:#4d9c79;border-radius:50%;margin-right:7px}main{width:100%;max-width:1530px;margin:auto;padding:34px clamp(18px,3.4vw,60px);align-self:start;margin-top:0}.crumb{font:13px Consolas,monospace;color:#677083;margin-bottom:18px}.hero{position:relative;overflow:hidden;isolation:isolate;background:#23223d;color:white;border-radius:19px;padding:31px 34px;min-height:212px;display:flex;align-items:center}.hero .eyebrow{color:#c6bdfd}.hero h1{font-size:clamp(34px,4vw,58px);line-height:1.05;letter-spacing:-2.7px;margin:12px 0}.hero p{margin:0;color:#dfddeb}.art{position:absolute;inset:0 0 0 56%;z-index:-1;background-image:linear-gradient(#65618433 1px,transparent 1px),linear-gradient(90deg,#65618433 1px,transparent 1px);background-size:24px 24px;mask-image:linear-gradient(90deg,transparent,#000 14%)}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:17px 0 26px}.stat,.panel,.library{background:white;border:1px solid #dfe2eb;border-radius:13px}.stat{display:flex;align-items:center;gap:14px;padding:15px}.icon{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;background:#ebe7fe;color:#6350cf;font-size:21px}.stat:nth-child(2) .icon{background:#def2e9;color:#277956}.stat:nth-child(3) .icon{background:#ffebdd;color:#ad6037}.stat strong{font-size:24px;line-height:1}.stat small{display:block;font-size:13px}.library,.panel{padding:22px}.sectionhead,.row,.actions{display:flex;align-items:center;gap:12px}.sectionhead{justify-content:space-between}h1,h2,h3{letter-spacing:-.7px}h2{margin:0;font-size:23px}.count,.tag{font-size:13px;border-radius:6px;background:#f0eff7;color:#625975;padding:4px 9px}.filters{display:flex;gap:10px;margin:18px 0}input,textarea,select{border:1px solid #d9dde6;border-radius:8px;background:white;color:inherit;padding:9px 12px;min-width:0}.filters input{flex:1}.problem{display:grid;grid-template-columns:40px minmax(0,1fr) 90px 36px;gap:12px;align-items:center;border-top:1px solid #ececf2;padding:13px 0}.num{font:14px Consolas,monospace;color:#767b90}.problem a{font-weight:650}.problem a:hover{color:#5a48c3}.topic{display:block;font-size:13px;color:#73798a;font-weight:400}.badge{font-size:13px;font-weight:600;color:#237453;background:#e5f4ec;border-radius:20px;padding:3px 10px;justify-self:start}.Medium{color:#986018;background:#fcf0d9}.Hard{color:#a23f49;background:#ffebed}button,.button{background:white;border:1px solid #d7dbe4;border-radius:8px;padding:8px 13px;color:inherit;font-weight:600;transition:transform .16s,background .16s}button:hover,.studio:hover{background:#f3f0ff;transform:translateY(-1px)}button:disabled{opacity:.5;cursor:wait}.primary{background:#5d4cc5;color:white;border-color:#5d4cc5}.primary:hover{background:#493bab}.save{border:0;padding:5px;color:#6656ba;font-size:22px}.panel{margin:14px 0}.panel p{white-space:pre-line}.split{display:grid;grid-template-columns:1fr 1fr;gap:16px}.split>*{min-width:0}.scroll{overflow:auto}table{border-collapse:collapse;font:14px Consolas,monospace;width:100%;margin:10px 0 18px}td,th{text-align:left;border:1px solid #dfe2e9;padding:6px 9px}th{background:#f5f5fb}textarea{width:100%;resize:vertical;min-height:120px;margin:12px 0}textarea.code,pre{font:15px/1.6 Consolas,monospace;background:#212139;color:#e6e1ff;padding:15px;border-radius:9px;white-space:pre-wrap;overflow-wrap:anywhere}.actions{flex-wrap:wrap}.error{color:#9f3943}.notice{padding:13px;background:#f1effc;border-radius:8px}details{margin:12px 0}summary{cursor:pointer;font-weight:600}main>section{animation:enter .24s ease-out}@keyframes enter{from{opacity:.5;transform:translateY(5px)}}:focus-visible{outline:3px solid #a499fa;outline-offset:2px}@media(max-width:900px){.shell{grid-template-columns:1fr}aside{display:none}.shell:before{display:none}aside{display:block;padding:0 16px;border-bottom:1px solid #ddd}aside small,.sidefoot{display:none}nav{display:flex;margin:0;overflow:auto}.split{grid-template-columns:1fr}}@media(max-width:640px){header{padding:0 16px;height:62px}.divider,.toplabel{display:none}main{padding:18px 12px}.hero{padding:23px;min-height:165px}.hero p{max-width:65%}.stats{gap:6px}.stat{padding:10px;gap:6px}.stat .icon{display:none}.filters{flex-wrap:wrap}.filters input{flex-basis:100%}.library,.panel{padding:14px}.problem{grid-template-columns:24px 1fr 62px 28px;gap:5px}nav a{font-size:13px;padding:8px}nav b{display:none}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
.hero > div:first-child{width:58%}.hero p{max-width:55ch}@media(max-width:640px){.hero > div:first-child{width:72%}.hero .art{left:72%}}
.art { --diameter: clamp(44px, 56%, 144px); }
.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--diameter);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-76%, -50%);
  border: 1px solid #b3e3ff;
  background: repeating-linear-gradient(128deg, #94d6ff 0 2px, transparent 2px 7px);
}
.ring.two {
  transform: translate(-24%, -50%);
  border: 0;
  box-shadow: inset 0 0 0 2px #bab1ff;
  background: #aaa1fa45;
  overflow: hidden;
}
.ring.two::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform: translateX(-52%);
  background: #c3dcff;
  opacity: .32;
}

header {
  background: linear-gradient(105deg, #efedff, #f8f7ff 78%);
  border-bottom-color: #dbd7ee;
}
.toplabel { color: #504969; font-weight: 600; }
.crumb {
  font: 650 15px/1.5 "Segoe UI Variable Text", "Segoe UI", sans-serif;
  color: #403953;
}
.crumb a { color: #5c4ba1; }
.crumb a:hover { text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) {
  .ring { animation: join-drift 4s ease-in-out infinite alternate; }
  .ring.two { animation-direction: alternate-reverse; }
  .ring.two::before { animation: overlap-drift 4s ease-in-out infinite alternate; }
  @keyframes join-drift {
    from { translate: -3% 0; }
    to { translate: 3% 0; }
  }
  @keyframes overlap-drift {
    from { transform: translateX(-58%); opacity: .18; }
    to { transform: translateX(-46%); opacity: .44; }
  }
}
html[data-theme="dark"] {
  color-scheme: dark;
  --surface: #202233;
  --edge: #3b3d53;
  --muted: #b3b5cb;
}
[data-theme="dark"] body { background: #141521; color: #f1effa; }
[data-theme="dark"] header { background: linear-gradient(105deg,#29253e,#201f30); border-color: var(--edge); }
[data-theme="dark"] :is(aside,.library,.panel,.stat,.studio,input,select,textarea,button) { background: var(--surface); border-color: var(--edge); color: #eeedf8; }
[data-theme="dark"] :is(.toplabel,.topic,small,.muted,.sidefoot,.num,.crumb,nav a) { color: var(--muted); }
[data-theme="dark"] .divider { border-color: var(--edge); }
[data-theme="dark"] :is(.crumb a,.save,.branddot,.problem a:hover) { color: #c5baff; }
[data-theme="dark"] :is(nav a.active,.count,.tag,.notice,button:hover,.studio:hover) { background: #35304d; color: #e2daff; }
[data-theme="dark"] .hero { background: linear-gradient(105deg,#29243f,#302c4a); box-shadow: inset 0 0 0 1px #47415f; }
[data-theme="dark"] :is(.problem,td,th) { border-color: var(--edge); }
[data-theme="dark"] th { background: #2c2c40; }
[data-theme="dark"] :is(textarea.code,pre) { background: #171825; color: #e9e3ff; }
[data-theme="dark"] .primary { background: #b4a5ff; color: #201933; }
[data-theme="dark"] .icon { background: #403657; color: #d2baff; }
[data-theme="dark"] .stat:nth-child(2) .icon,[data-theme="dark"] .badge { background: #203e37; color: #9de4bf; }
[data-theme="dark"] .stat:nth-child(3) .icon,[data-theme="dark"] .Medium { background: #453627; color: #f1c78e; }
[data-theme="dark"] .Hard { background: #482e39; color: #ffb7c4; }
[data-theme="dark"] .error { color: #ffb7c4; }

.verdict { padding: 12px 16px; margin: 12px 0; border: 1px solid; border-radius: 9px; }
.verdict strong { font-size: 1.05rem; }
.verdict p { margin: 5px 0 0; overflow-wrap: anywhere; }
.verdict.pass { background: #e2f6e9; color: #145c36; border-color: #95cfaa; }
.verdict.fail { background: #fff0f1; color: #962638; border-color: #e8aab2; }
[data-theme="dark"] .verdict.pass { background: #18392e; color: #a5edc1; border-color: #42745a; }
[data-theme="dark"] .verdict.fail { background: #43242e; color: #ffb9c1; border-color: #86515d; }

aside {
  position: sticky;
  top: 0;
  align-self: start;
  z-index: 3;
}
.pane-divider { display: none; }
@media (min-width: 901px) {
  aside { height: 100vh; height: 100dvh; overflow-y: auto; }
  .split {
    gap: 0;
    grid-template-columns: minmax(0,var(--problem-width, 1fr)) 16px minmax(0,var(--editor-width, 1fr));
  }
  .pane-divider {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    cursor: col-resize;
    touch-action: none;
    user-select: none;
    margin-block: 14px;
    border-radius: 6px;
  }
  .pane-divider::after {
    content: "";
    position: sticky;
    top: 18px;
    margin-top: 74px;
    width: 4px;
    height: 40px;
    border-radius: 4px;
    background: #aaa2cc;
  }
  .pane-divider:is(:hover,:focus-visible,:active)::after { background: #7963d9; }
}
@media (max-width: 900px) {
  .shell { grid-template-rows: auto 1fr; }
}

.account-page { max-width: 520px; margin-inline: auto; }
.account-page h1 { margin: 0 0 8px; }
.account-options,.account-nav { display: flex; align-items: center; gap: 8px; }
.account-options { border-bottom: 1px solid var(--edge,#dedbea); margin-block: 16px; }
.account-options a { padding: 8px 12px; border-bottom: 2px solid transparent; }
.account-options a[aria-current="page"] { border-color: #8c79ed; font-weight: 650; }
#credentials { display: grid; gap: 8px; }
#credentials label { font-weight: 600; }
#credentials input { margin-bottom: 6px; }
#credentials button { justify-self: start; }
#account-error:empty { display: none; }
.account-links { margin-top: 15px; }
.account-links a { text-decoration: underline; }
.account-email { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
@media(max-width: 720px) {
 .account-email { display: none; }
 header { gap: 6px; }
 header .studio, .account-nav button { font-size: 12px; padding: 6px 8px; }
}

nav a[hidden], .account-layout aside { display: none; }
.account-nav { margin-left: auto; }
.account-layout .shell { display: block; }
.account-layout main { min-height: calc(100dvh - 76px); display: grid; align-items: center; padding-block: 32px 48px; position: relative; }
.account-page { width: 100%; }
.account-page.with-promo { max-width: 960px; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 22px; }
.account-page.with-promo > .panel { margin: 0; }
.account-promo { background: linear-gradient(140deg,#262140,#41336b); color: #f7f4ff; border-radius: 14px; padding: clamp(24px,4vw,48px); display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.account-promo .eyebrow { color: #cbbdff; }
.account-promo h2 { margin: 14px 0 4px; font-size: clamp(28px,4vw,49px); line-height: 1.08; }
.account-promo p { color: #e3dbfa; }
.promo-query { border: 1px solid #7764ae; padding: 16px; border-radius: 10px; background: #201b35; color: #e0d8ff; font-size: clamp(12px,2vw,16px); }
.promo-query b { color: #b3dfff; }
.promo-caret { display: inline-block; width: .45em; height: .85em; margin-left: 4px; background: #c6b1ff; animation: promo-blink 1.4s steps(2,start) infinite; }
.creator-credit { position: absolute; right: clamp(14px,3vw,42px); bottom: 12px; font-size: 12px; opacity: .8; }
@keyframes promo-blink { to { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .promo-query { animation: promo-float 4s ease-in-out infinite alternate; }
  @keyframes promo-float { from { transform: translateY(2px); } to { transform: translateY(-5px); } }
}
@media (max-width: 720px) {
  .account-page.with-promo { grid-template-columns: 1fr; }
  .account-promo { grid-row: 2; }
}
