:root{color-scheme:light;--bg:#fff;--surface:#fff;--ink:#000;--muted:#666;--line:#dedede;--soft:#f3f3f3;--green:#00a34a;--red:#e12626;--shadow:0 24px 70px rgba(0,0,0,.075)}
html[data-theme=dark]{color-scheme:dark;--bg:#000;--surface:#111;--ink:#fff;--muted:#aaa;--line:#333;--soft:#1b1b1b;--green:#30d977;--red:#ff5c5c;--shadow:0 24px 70px rgba(255,255,255,.035)}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;transition:background .3s,color .3s}a{color:inherit;text-decoration:none}button,input,textarea,select{font:inherit}button{cursor:pointer}a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--green);outline-offset:3px}h1,h2,p{margin-top:0}h1{font-size:clamp(2.2rem,5vw,4.4rem);line-height:1.08;letter-spacing:-.055em;font-weight:720}h2{font-size:1.5rem;letter-spacing:-.03em}.site-header{height:78px;max-width:1440px;margin:auto;padding:0 clamp(20px,5vw,72px);display:flex;align-items:center;justify-content:space-between}.brand{font-size:1.42rem;font-weight:790;letter-spacing:-.065em}.brand-dot{color:var(--green)}.top-nav{display:flex;align-items:center;gap:28px;font-size:.88rem;font-weight:600}.top-nav a:hover,.back-link:hover,.text-button:hover{color:var(--green)}.icon-button{border:0;background:none;color:var(--ink);font-size:1.55rem;line-height:1;width:38px;height:38px;display:grid;place-items:center;border-radius:10px}.icon-button:hover{background:var(--soft)}.flash{max-width:760px;margin:10px auto;background:var(--soft);padding:12px 16px;border-radius:12px}.eyebrow{text-transform:uppercase;letter-spacing:.13em;font-size:.72rem;font-weight:760;margin-bottom:18px}.muted{color:var(--muted)}.center-stage{min-height:calc(100svh - 110px);padding:55px 20px 90px;display:grid;place-items:center}.task-card{width:min(100%,680px);background:var(--surface);border:1px solid var(--line);border-radius:28px;padding:clamp(28px,5vw,56px);box-shadow:var(--shadow);animation:card-in .55s cubic-bezier(.2,.75,.25,1) both;transition:width .4s,height .4s,background .3s,box-shadow .3s}.intro-card{max-width:620px}.intro-card h1,.auth-card h1{font-size:clamp(2.5rem,5vw,4rem)}.intro-card .muted{max-width:490px}.intro-meta{display:flex;gap:20px;margin:28px 0;color:var(--muted);font-size:.88rem}.primary-button{display:inline-flex;align-items:center;justify-content:space-between;gap:36px;min-width:185px;min-height:52px;padding:13px 20px;border:1px solid var(--ink);border-radius:12px;background:var(--ink);color:var(--bg);font-weight:670;text-align:left;transition:transform .2s,background .2s,box-shadow .2s}.primary-button:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(0,0,0,.16)}.primary-button:active{transform:translateY(0) scale(.98)}.home-wrap,.page-wrap{max-width:1180px;margin:0 auto;padding:clamp(50px,8vw,110px) 28px 100px}.home-wrap{display:grid;grid-template-columns:1fr .85fr;gap:9vw;align-items:start}.home-intro h1 span{color:var(--green)}.lede{color:var(--muted);font-size:1.12rem;max-width:520px}.variant-list{border-top:1px solid var(--line)}.variant-link{padding:25px 2px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:20px;align-items:center;transition:padding .2s}.variant-link:hover{padding-left:10px}.variant-link span:first-child{display:grid;gap:4px}.variant-link small{font-size:.7rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:700}.variant-link strong{font-size:1.25rem;letter-spacing:-.035em}.variant-link em{font-style:normal;color:var(--muted);font-size:.9rem}.arrow{font-size:1.5rem}.solve-shell{width:min(100% - 36px,760px);margin:26px auto 70px}.progress-line{display:flex;justify-content:space-between;color:var(--muted);font-size:.78rem;font-weight:650;margin-bottom:11px}.progress-track{appearance:none;display:block;width:100%;height:3px;border:0;background:var(--soft);margin-bottom:30px;border-radius:3px}.progress-track::-webkit-progress-bar{background:var(--soft)}.progress-track::-webkit-progress-value{background:var(--green)}.progress-track::-moz-progress-bar{background:var(--green)}.solver-card{width:100%;min-height:390px;padding:clamp(26px,5vw,48px)}.task-top{display:flex;align-items:start;justify-content:space-between;gap:16px}.task-top h1{font-size:clamp(1.8rem,4vw,2.6rem);margin-bottom:25px}.task-body{white-space:pre-line;font-size:1.08rem;line-height:1.7;margin:4px 0 26px}.files{display:flex;gap:12px;flex-wrap:wrap;margin:0 0 26px}.files a{font-size:.88rem;padding:9px 14px;border:1px solid var(--line);border-radius:9px}.files a:hover{border-color:var(--ink)}.task-meta{display:flex;gap:14px;align-items:center;font-size:.78rem;color:var(--muted);margin-bottom:24px}.status{font-weight:700}.correct{color:var(--green)}.wrong{color:var(--red)}.revealed{font-size:.9rem;background:var(--soft);padding:12px;border-radius:10px}.answer-form{display:grid;gap:11px}.answer-form label,.stack-form label{font-weight:700;font-size:.82rem}.answer-form textarea,.stack-form input,.admin-form input,.admin-form textarea,.admin-form select{width:100%;background:var(--surface);border:1px solid var(--line);color:var(--ink);border-radius:11px;padding:13px 15px;resize:vertical}.answer-form textarea:focus,.stack-form input:focus{border-color:var(--ink)}.answer-form .primary-button{margin-top:7px;justify-self:start}.solve-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 3px;font-size:.85rem}.step-links{display:flex;gap:24px}.step-links a:hover{color:var(--green)}.text-button{border:0;background:none;color:var(--muted);padding:0;font-size:.85rem}.map-panel{position:fixed;z-index:12;top:0;right:0;height:100dvh;width:min(360px,100%);padding:28px;background:var(--surface);border-left:1px solid var(--line);transform:translateX(102%);transition:transform .32s cubic-bezier(.2,.8,.2,1)}.map-panel.open{transform:translateX(0)}.map-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:30px}.map-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.map-cell{height:52px;border:1px solid var(--line);border-radius:10px;display:grid;place-items:center;font-weight:700}.map-cell.active{border-color:var(--ink)}.map-cell.done{background:var(--soft)}.map-cell.locked{color:var(--muted)}.map-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:11;opacity:0;pointer-events:none;transition:opacity .3s}.map-backdrop.open{opacity:1;pointer-events:auto}.result-card h1{font-size:clamp(2.2rem,4vw,3.4rem)}.score-display{margin:28px 0 4px}.score-display strong{font-size:clamp(4.3rem,10vw,7rem);letter-spacing:-.09em;line-height:1}.score-display strong span{font-size:.43em;color:var(--muted)}.score-display p,.secondary{color:var(--muted);margin-top:8px}.account-callout{border:1px solid var(--line);border-radius:16px;padding:22px;margin:32px 0}.account-callout p{color:var(--muted);font-size:.9rem;margin:4px 0 18px}.inline-actions{display:flex;align-items:center;gap:18px;flex-wrap:wrap;font-size:.85rem}.result-details{margin:30px 0;border-top:1px solid var(--line)}.result-details summary{padding:16px 0;cursor:pointer;font-weight:650}.result-row{border-top:1px solid var(--line);padding:12px 0;display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:.9rem}.result-row small{width:100%;color:var(--muted)}.back-link{display:inline-block;margin-top:20px;font-weight:600;font-size:.9rem}.auth-card{max-width:490px}.stack-form{display:grid;gap:16px;margin-top:30px}.stack-form label{display:grid;gap:8px}.stack-form .primary-button{margin-top:6px}.switch-auth{font-size:.9rem;margin:24px 0;color:var(--muted)}.switch-auth a{color:var(--ink);text-decoration:underline}.telegram-button{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:11px;width:100%;padding:13px}.profile-actions{display:flex;gap:24px;align-items:center;margin:22px 0 60px;color:var(--muted);font-size:.88rem}.page-wrap h1{font-size:3rem}.admin-wrap{max-width:1100px;margin:40px auto 100px;padding:0 24px}.admin-nav{display:flex;gap:22px;margin:20px 0 40px;border-bottom:1px solid var(--line);padding-bottom:16px}.admin-nav a:hover{color:var(--green)}.admin-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.admin-stat{border:1px solid var(--line);border-radius:14px;padding:20px}.admin-stat strong{display:block;font-size:2rem}.admin-table{width:100%;border-collapse:collapse;margin-top:22px}.admin-table td,.admin-table th{border-bottom:1px solid var(--line);padding:12px;text-align:left}.admin-table a{text-decoration:underline}.admin-form{display:grid;gap:12px;max-width:630px;margin:24px 0 44px}.admin-form label{display:grid;gap:5px;font-size:.86rem;font-weight:650}.admin-form .checkbox{display:flex;align-items:center;gap:8px}.admin-form .checkbox input{width:auto}.admin-form button{justify-self:start}.pill{font-size:.75rem;padding:4px 8px;border:1px solid var(--line);border-radius:8px}.inline-form{display:inline}.danger-text{color:var(--red)}@keyframes card-in{from{opacity:0;transform:translateY(18px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:760px){.site-header{height:66px}.top-nav{gap:16px}.home-wrap{grid-template-columns:1fr;gap:50px;padding-top:60px}.home-intro h1{font-size:clamp(2.8rem,11vw,4.6rem)}.center-stage{padding:35px 16px 70px;align-items:start}.task-card{border-radius:22px;padding:26px}.solve-shell{width:min(100% - 28px,760px);margin-top:15px}.solver-card{min-height:0}.solve-bottom{align-items:start}.admin-cards{grid-template-columns:1fr}.admin-table{display:block;overflow-x:auto}.inline-actions .primary-button{width:100%}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
.solver-card{view-transition-name:task-card}::view-transition-old(task-card),::view-transition-new(task-card){animation-duration:.42s;animation-timing-function:cubic-bezier(.2,.75,.25,1)}@media(prefers-reduced-motion:reduce){::view-transition-old(task-card),::view-transition-new(task-card){animation-duration:.01ms}}

/* Quiet, border-led layout. Both surfaces are the same pure base color. */
:root{--surface:#fff;--line:#d1d1d1;--soft:#f1f1f1;--shadow:none}
html[data-theme=dark]{--surface:#000;--line:#444;--soft:#171717;--shadow:none}
.task-card,.primary-button{box-shadow:none}
.task-card{background:var(--bg);border-radius:22px;animation:none;transition:border-color .2s ease}
.primary-button{justify-content:center;min-width:0;gap:0;text-align:center;transition:transform .18s ease,opacity .18s ease}
.primary-button:hover{box-shadow:none;transform:translateY(-1px);opacity:.86}
.primary-button:disabled{opacity:.48;cursor:wait}
.site-header{max-width:none;height:78px;padding:0 24px}
.brand{letter-spacing:-.055em;font-size:1.2rem;white-space:nowrap}
.brand-ege{color:var(--green)}
.brand-dot{display:none}
.home-wrap{gap:clamp(30px,6vw,90px)}
.variant-list{border:0;display:grid;gap:14px}
.variant-link{border:1px solid var(--line);border-radius:18px;padding:22px;align-items:flex-start;min-height:146px;transition:border-color .2s ease,transform .2s ease}
.variant-link:hover{padding-left:22px;border-color:var(--ink);transform:translateY(-2px)}
.variant-link span:first-child{gap:8px}
.variant-link .arrow{line-height:1}
.solve-shell{width:min(100% - 36px,760px);min-height:100svh;margin:-78px auto 0;padding:84px 0;display:grid;place-items:center}
main:has(.solve-shell){display:flow-root}
.solver-card,.result-task{--solver-padding:clamp(26px,5vw,48px);position:relative;min-height:0;padding:var(--solver-padding)}
.task-heading{padding-right:72px;margin-bottom:34px}
.task-heading h1,.task-heading h2{font-size:clamp(1.45rem,3vw,2rem);letter-spacing:-.045em;margin:0;line-height:1.2}
.task-count{margin-left:.3em;color:var(--muted);font-size:.58em;font-weight:500;letter-spacing:-.02em;white-space:nowrap}
.task-points{position:absolute;top:var(--solver-padding);right:var(--solver-padding);font-size:.8rem;line-height:1;color:var(--muted);white-space:nowrap}
.task-body{margin:0 0 34px}
.task-status{font-size:.82rem;margin:0 0 20px}
.answer-form{gap:16px}
.answer-form input,.answer-form textarea{width:100%;background:var(--bg);border:1px solid var(--line);color:var(--ink);border-radius:12px;padding:14px 16px;outline:none}
.answer-form input{height:54px}
.answer-form textarea{resize:vertical;min-height:120px}
.answer-form input:focus,.answer-form textarea:focus{border-color:var(--ink)}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.solver-symbols{position:absolute;width:0;height:0;overflow:hidden}
.solver-actions{display:flex;gap:10px;align-items:center;margin-top:18px}
.answer-submit{min-height:48px;flex:0 1 185px}
.solver-navigation{display:flex;align-items:center;gap:7px;margin-left:auto}
.solver-icon-action{display:grid;place-items:center;width:48px;height:48px;padding:0;border:1px solid var(--line);border-radius:11px;background:var(--bg);color:var(--ink);transition:border-color .2s ease,transform .2s ease}
.solver-icon-action:hover:not(:disabled){border-color:var(--ink);transform:translateY(-1px)}
.solver-icon-action:active:not(:disabled){transform:scale(.96)}
.solver-icon-action:disabled{opacity:.28;cursor:default}
.solver-icon-action svg{display:block;width:22px;height:22px;fill:currentColor}
.finish-button{border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:11px;padding:11px 15px;min-height:48px;font-size:.83rem;font-weight:650;white-space:nowrap}
.finish-button:hover{border-color:var(--ink)}
.auth-card{max-width:560px}
.auth-card h1{font-size:clamp(2rem,5vw,3rem);line-height:1.12;letter-spacing:-.055em;overflow-wrap:normal;hyphens:none}
.auth-card .primary-button{width:100%}
.entrance-screen{position:fixed;inset:0;z-index:30;background:#000;display:grid;place-items:center}
.entrance-screen.is-leaving{opacity:0;transition:opacity .55s cubic-bezier(.2,.7,.2,1)}
@font-face{font-family:"Manrope Entrance";src:url("fonts/manrope-entrance.woff2") format("woff2");font-style:normal;font-weight:200 800;font-display:swap}
.entrance-frame{position:fixed;top:50%;left:50%;width:170px;height:68px;transform:translate(-50%,-50%);border:1px solid transparent;border-radius:18px;pointer-events:none}
.entrance-outline{display:block;width:100%;height:100%;overflow:visible}
.entrance-outline rect{fill:none;stroke:var(--line);stroke-width:1;stroke-dasharray:100;stroke-dashoffset:100;animation:entrance-draw 1.25s cubic-bezier(.4,0,.2,1) .7s forwards}
.entrance-frame.is-expanding{border-color:var(--line)}
.entrance-frame.is-expanding .entrance-outline{opacity:0}
.entrance-word{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);display:inline-flex;color:#fff;font:300 clamp(1.55rem,4vw,2rem)/1.2 "Manrope Entrance",sans-serif;letter-spacing:-.035em;white-space:nowrap;transition:opacity .55s ease}
.entrance-letter{opacity:0;animation:entrance-letter-in .48s ease forwards}
.entrance-letter:nth-child(1){animation-delay:.18s}
.entrance-letter:nth-child(2){animation-delay:.32s}
.entrance-letter:nth-child(3){animation-delay:.46s}
.entrance-letter:nth-child(4){animation-delay:.60s}
.entrance-letter:nth-child(5){animation-delay:.74s}
.entrance-letter:nth-child(6){animation-delay:.88s}
.entrance-screen.is-word-leaving .entrance-word{opacity:0}
.entrance-waiting .site-header,.entrance-waiting main{visibility:hidden}
.entrance-fallback{display:inline-flex;position:absolute;bottom:8vh;left:50%;transform:translateX(-50%);border-color:#fff;background:#fff;color:#000}
.js .entrance-fallback{display:none}
.js .entrance-failed .entrance-fallback{display:inline-flex}
@keyframes entrance-letter-in{to{opacity:1}}
@keyframes entrance-draw{to{stroke-dashoffset:0}}
@keyframes interface-arrive{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@keyframes interface-reveal{from{opacity:0}to{opacity:1}}
.entrance-arriving .brand{animation:interface-arrive .8s cubic-bezier(.18,.75,.2,1) .18s both}
.entrance-arriving .top-nav>*{animation:interface-arrive .8s cubic-bezier(.18,.75,.2,1) .3s both}
.entrance-arriving .top-nav>*:nth-child(2){animation-delay:.4s}
.entrance-arriving .top-nav>*:nth-child(3){animation-delay:.5s}
.entrance-arriving .solver-content>.task-heading,.entrance-arriving .solver-content>.task-points{animation:interface-reveal .72s ease .12s both}
.entrance-arriving .solver-content>.task-body,.entrance-arriving .solver-content>.files{animation:interface-reveal .72s ease .24s both}
.entrance-arriving .solver-content>.answer-form,.entrance-arriving .solver-content>.task-status,.entrance-arriving .solver-content>.revealed{animation:interface-reveal .72s ease .36s both}
.entrance-arriving .solver-content>.solver-actions{animation:interface-reveal .72s ease .48s both}
@media(max-width:760px){.top-nav{gap:14px}.solve-shell{width:min(100% - 24px,760px)}.task-heading{margin-bottom:26px}.task-body{font-size:1rem}.variant-link{min-height:0}}
@media(max-width:620px){.solver-actions{flex-wrap:wrap;gap:10px}.answer-submit{flex:1 0 100%}.solver-navigation{margin-left:0}.solver-actions:not(:has(.finish-form)):not(:has(.answer-submit)) .solver-navigation{margin-left:auto}.solver-icon-action{width:44px;height:44px}.finish-form{margin-left:auto}.finish-button{min-height:44px;padding:9px 12px}}
@media(max-width:380px){.solver-navigation{gap:6px}.solver-icon-action{width:40px;height:40px}.finish-button{min-height:40px;padding:8px 9px;font-size:.78rem}}
@media(prefers-reduced-motion:reduce){.entrance-letter{animation:none;opacity:1}.entrance-outline rect{animation:none;stroke-dashoffset:0}.entrance-word{transition:none}}

/* Task materials and result review share the same restrained card layout. */
.home-intro h1{font-size:clamp(2.1rem,4vw,3.65rem);line-height:1.12}
.task-image{margin:0 0 28px}.task-image img{display:block;max-width:100%;height:auto;border-radius:8px}
.task-table-scroll{overflow-x:auto;max-width:100%;margin:0 0 28px}.task-table{border-collapse:collapse;min-width:180px;max-width:100%;font-variant-numeric:tabular-nums}.task-table td{border:1px solid var(--line);padding:10px 16px;text-align:center;white-space:pre-wrap;overflow-wrap:anywhere;min-width:60px}
.results-wrap{display:flow-root}.result-stage{padding:100px 18px 20px;display:grid;place-items:center}.result-card{width:min(100%,760px);padding:clamp(26px,5vw,48px)}
.result-card h1{font-size:clamp(1.5rem,3vw,2.1rem);line-height:1.25;letter-spacing:-.04em;margin:0 0 42px;overflow-wrap:anywhere}
.result-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0}.result-metrics.has-secondary{grid-template-columns:repeat(3,minmax(0,1fr))}.result-metric{min-width:0;text-align:center;padding:0 16px}.result-metric+.result-metric{border-left:1px solid var(--line)}
.metric-value{display:flex;align-items:baseline;justify-content:center;gap:8px;font-size:clamp(2.5rem,7vw,5.5rem);font-weight:650;letter-spacing:-.065em;line-height:1.15;font-variant-numeric:tabular-nums;white-space:nowrap}.metric-total,.metric-unit{font-size:.4em;font-weight:450;color:var(--muted);letter-spacing:-.025em}.result-metric p{color:var(--muted);font-size:.82rem;margin:12px 0 0;line-height:1.4}
.result-tasks{width:min(100% - 36px,760px);margin:0 auto 84px;display:grid;gap:20px}.result-task{width:100%;border-color:var(--line)}.result-task .task-points.correct{color:var(--green)}.result-task .task-points.wrong{color:var(--red)}
.result-answer-fields{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:16px}.result-answer-fields input,.result-answer-fields textarea{font-size:1rem}.result-answer-fields label{display:grid;gap:8px;min-width:0;color:var(--muted);font-weight:500}.result-answer-fields input:disabled,.result-answer-fields textarea:disabled{background:var(--soft);color:var(--ink);-webkit-text-fill-color:var(--ink);opacity:1;cursor:default;resize:none}.result-answer-fields:not(:has(label:nth-child(2))){grid-template-columns:1fr}.result-tasks .account-callout{margin:0;border-radius:22px}.result-tasks .account-callout .primary-button{min-height:44px}

.field-title{font-size:.86rem;font-weight:650;margin:0 0 6px}.field-help{font-size:.8rem;color:var(--muted);margin:0 0 10px}.table-input{display:grid;gap:8px;margin:14px 0}.table-input .text-button{justify-self:start}.table-input textarea{white-space:pre;tab-size:8}.asset-editor{display:grid;gap:10px;border:1px solid var(--line);padding:16px;border-radius:12px;overflow-wrap:anywhere}.asset-editor img{max-width:100%;max-height:220px;object-fit:contain;justify-self:start}.admin-task-preview{max-width:760px}.task-edit-details{margin:30px 0}.task-edit-details summary{cursor:pointer;font-weight:650}
@media(max-width:620px){.result-stage{padding:40px 12px 20px}.result-tasks{width:calc(100% - 24px)}.result-metric{padding:0 8px}.result-metrics.has-secondary .metric-value{font-size:clamp(2rem,8.5vw,3.3rem);gap:4px}.result-metric p{font-size:.72rem}.result-card h1{margin-bottom:32px}.result-answer-fields{gap:12px}}
.files a{max-width:100%;overflow-wrap:anywhere}

/* Administration uses the viewport, with consistent section spacing. */
body:has(.admin-wrap) .site-header{max-width:none;padding-inline:clamp(16px,3vw,48px)}
.admin-wrap{max-width:none;margin:16px 0 80px;padding:0 clamp(16px,3vw,48px)}
.admin-nav{gap:8px;margin:0 0 32px;padding:12px 0;overflow-x:auto;white-space:nowrap}
.admin-nav a{padding:10px 16px;border-radius:8px}
.admin-nav a[aria-current=page]{background:var(--ink);color:var(--bg)}
.admin-wrap h1{font-size:clamp(2rem,4vw,3rem);margin-bottom:28px}
.admin-wrap h2{margin:36px 0 16px}.admin-cards{margin-bottom:36px}
.admin-table{margin:0 0 32px}.admin-form{max-width:none;gap:20px;margin:24px 0 40px}
.admin-form fieldset{min-width:0;border:1px solid var(--line);border-radius:12px;padding:16px}
.pool-tasks{display:grid;gap:12px;max-height:400px;overflow:auto}
.cell-editor{display:grid;gap:12px;min-width:0;max-width:100%;font-weight:400}
.grid-toolbar{display:flex;gap:10px;flex-wrap:wrap}.grid-toolbar button{background:var(--bg);color:var(--ink);border:1px solid var(--line);border-radius:8px;padding:6px 12px}
.grid-scroll{overflow:auto;max-width:100%}.cell-editor table{border-collapse:collapse}.cell-editor td{padding:3px;border:1px solid var(--line)}
.cell-editor input{min-width:95px;width:100%;border:0!important;border-radius:0!important;padding:10px!important;background:var(--bg);color:var(--ink)}
[hidden]{display:none!important}

/* Section navigation lives in the shared header. */
.site-header:has(.admin-nav){max-width:none;gap:32px;height:auto;min-height:78px;flex-wrap:wrap}
.site-header .admin-nav{flex:1;min-width:0;margin:0;padding:10px 0;border:0;gap:4px}
.site-header .admin-nav a{font-size:.88rem;font-weight:600;padding:9px 14px}
.site-header:has(.admin-nav) .brand,.site-header:has(.admin-nav) .top-nav{flex-shrink:0}
@media(max-width:900px){
  .site-header:has(.admin-nav){gap:0 20px;padding-top:14px}
  .site-header .admin-nav{order:3;flex-basis:100%;padding:14px 0 12px}
  .site-header:has(.admin-nav) .top-nav{margin-left:auto}
  .site-header .admin-nav a{padding:9px 12px}
}

/* Round the table itself so narrow tables keep a fitted outer border. */
.task-table,.cell-editor table{border-collapse:separate;border-spacing:0;border:1px solid var(--line);border-radius:6px;overflow:hidden}
.task-table td,.cell-editor td{border:0;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.task-table tr:last-child>td,.cell-editor tr:last-child>td{border-bottom:0}
.task-table td:last-child,.cell-editor td:last-child{border-right:0}
.cell-editor input:focus-visible{outline-offset:-3px}

/* Calm, consistent administration pages. */
.admin-page-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px;margin-bottom:24px}
.admin-page-head h1{margin:0}.admin-back{display:inline-block;margin:8px 0 20px;font-size:.88rem;text-decoration:underline}
.admin-section{padding:28px 0;border-top:1px solid var(--line)}.admin-section>h2{margin:0 0 18px}
.admin-section .admin-form{margin-bottom:0}.admin-notice{border:1px solid var(--ink);padding:16px 20px;border-radius:12px;margin-bottom:24px}
.admin-wrap .admin-form{max-width:960px}.admin-form fieldset{display:grid;gap:18px}.admin-form legend{font-weight:650;padding:0 8px}
.admin-form .inline-actions{gap:20px}.admin-form .field-help{margin:0}.admin-wrap a:not(.primary-button):hover{text-decoration:underline}
.admin-search{display:grid;gap:8px;margin:20px 0;max-width:640px;font-size:.86rem;font-weight:600}
.admin-search input,.share-link input{width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--ink)}
.admin-table>thead>tr>th{font-size:.82rem;color:var(--muted);font-weight:600;white-space:nowrap}.admin-table>tbody>tr>td{vertical-align:top}
.table-description{font-size:.82rem;color:var(--muted);margin:6px 0 0;max-width:720px;font-weight:400}
.empty-state{padding:28px 12px!important;color:var(--muted)}
.pool-task{padding:12px 0;border-bottom:1px solid var(--line);align-items:flex-start!important}.pool-task input{margin-top:5px}.pool-task small{display:block;font-weight:400;color:var(--muted);margin-top:4px}
.share-link{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:20px 0}.share-link label{display:grid;gap:8px;flex:1 1 360px;min-width:0;font-size:.86rem}.share-link [role=status]{flex-basis:100%;font-size:.85rem}
.admin-action-form{margin:20px 0}.admin-details{border:1px solid var(--line);border-radius:12px;padding:16px}.admin-details summary{cursor:pointer;font-weight:600}.admin-details[open]>summary{margin-bottom:16px}
.scale-heading,.scale-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:12px;align-items:center;margin-bottom:12px}.scale-heading{font-size:.8rem;color:var(--muted)}
.admin-wrap button:disabled{cursor:not-allowed;opacity:.45;transform:none;box-shadow:none}.admin-wrap .task-table-scroll{margin:8px 0}
@media(max-width:620px){.admin-page-head .primary-button{width:100%}.admin-page-head{align-items:start}.admin-section{padding:24px 0}.share-link{align-items:stretch}.share-link .finish-button{align-self:start}.scale-row,.scale-heading{gap:8px}.admin-nav{scrollbar-width:thin}}

.admin-wrap h1{overflow-wrap:anywhere;min-width:0}.pool-slot-preview{font-size:.85rem;margin-top:8px}.pool-slot-preview summary{cursor:pointer}.pool-slot-preview p{margin:8px 0}
.scale-row,.scale-heading{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 60px}
body:has(.admin-wrap) .flash{max-width:none;margin:16px clamp(16px,3vw,48px);border:1px solid var(--line);background:var(--bg)}
@media(max-width:620px){.site-header .admin-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));overflow:visible;gap:2px}.site-header .admin-nav a{text-align:center;padding:9px 3px;font-size:clamp(.68rem,3vw,.82rem)}}

.preview-toolbar{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;font-size:.85rem;margin-bottom:20px}.preview-toolbar a{text-decoration:underline}.preview-toolbar span{color:var(--muted)}
[data-preview-form]~.solver-actions .answer-submit:disabled{cursor:default}

/* Equal answer cells reserve space for ten-digit values, independently of content. */
.cell-editor table.answer-grid{table-layout:fixed;min-width:0;max-width:none;font-variant-numeric:tabular-nums}
.cell-editor .answer-grid td{padding:0;min-width:0;height:45px}
.cell-editor .answer-grid input{display:block;min-width:0;width:100%;height:44px;padding:10px 12px!important;text-align:center;line-height:1.5;font-variant-numeric:tabular-nums}

.answer-format{display:inline-flex;gap:4px;padding:4px;border:1px solid var(--line);border-radius:10px;background:var(--bg)}
.admin-form .answer-format label{position:relative;display:block;cursor:pointer;margin:0}
.answer-format span{display:block;min-width:110px;padding:9px 18px;border-radius:6px;text-align:center;color:var(--ink)}
.answer-format input:checked+span{background:var(--ink);color:var(--bg)}
.answer-format input:focus-visible+span{outline:2px solid var(--green);outline-offset:2px}
.admin-form .image-dropzone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:170px;padding:24px;border:1px dashed var(--line);border-radius:12px;text-align:center;cursor:pointer;background:var(--bg)}
.image-dropzone:hover,.image-dropzone.is-dragging{border-color:var(--ink);border-style:solid}
.image-dropzone:focus-within{outline:2px solid var(--green);outline-offset:3px}
.image-dropzone small,.upload-secondary{color:var(--muted);font-weight:400}.image-dropzone small{font-size:.8rem}
.upload-previews{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:14px;margin-top:14px}.upload-previews:empty{display:none}
.upload-preview{display:grid;gap:10px;align-content:start;min-width:0;border:1px solid var(--line);border-radius:10px;padding:12px}
.upload-preview img{width:100%;height:150px;object-fit:contain;border-radius:6px}.upload-preview>span{font-size:.8rem;overflow-wrap:anywhere}
[data-image-status]:empty{display:none}[data-image-status]{margin-top:12px!important}
[data-asset-editor]:has(input[name=remove_asset])>img,[data-asset-editor]:has(input[name=remove_asset])>a{opacity:.35}

.condition-blocks{display:grid;gap:18px;min-width:0}.condition-block{min-width:0;border:1px solid var(--line);border-radius:12px;padding:20px;display:grid;gap:16px;background:var(--bg)}
.block-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}.block-header h3{font-size:.95rem;margin:0;font-weight:650}.block-actions{display:flex;align-items:center;gap:6px}
.block-action{border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:8px;min-height:36px;padding:6px 10px;font-size:.8rem}.block-action.danger-text{color:var(--red)}.block-action:hover:not(:disabled){border-color:var(--ink)}
.block-add{border:1px dashed var(--line);border-radius:12px;padding:18px;max-width:none}.block-add select{margin-top:6px}
.block-image{margin-bottom:14px}.block-image img{display:block;max-width:100%;max-height:320px;object-fit:contain;border-radius:6px}
.block-undo{display:flex;gap:12px;align-items:center;flex-wrap:wrap;font-size:.85rem}.condition-editor .upload-previews{grid-template-columns:minmax(0,320px)}
@media(max-width:620px){.condition-block{padding:14px}.block-header{align-items:start}.block-header h3{padding-top:8px}.block-actions{gap:4px}.block-action{min-height:40px}.condition-editor{padding:12px!important}}

.block-action{min-width:36px}

/* Keep the task editor in the same centered column as the solving card. */
.admin-wrap .task-editor{width:100%;max-width:760px;margin-inline:auto}
.admin-wrap:has(.task-editor)>.admin-page-head,.admin-wrap:has(.task-editor)>h1{max-width:760px;margin-inline:auto}
.admin-wrap:has(.task-editor)>.admin-back{display:block;max-width:760px;margin-inline:auto}

/* Inline material editing keeps controls outside the content. */
.condition-block{display:grid;grid-template-columns:minmax(0,1fr) 36px;gap:10px;padding:0;border:0;background:none;align-items:start}
.condition-content{min-width:0;border:1px solid var(--line);border-radius:6px;padding:12px}
.condition-block[data-block-kind=image] .condition-content{border:0;padding:0}
.block-actions{display:flex;flex-direction:column;gap:4px}
.editor-icon,.attachment-grip{display:inline-grid;place-items:center;flex-shrink:0;width:34px;height:34px;padding:7px;border:1px solid transparent;border-radius:6px;background:var(--bg);color:var(--ink);cursor:pointer}
.editor-icon svg,.attachment-grip svg,.attachment-add svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6}
.editor-icon:hover,.attachment-grip:hover{border-color:var(--line)}.editor-icon.danger-text{color:var(--red)}
.admin-form .condition-text{display:block;width:100%;min-height:80px;resize:vertical;border:0;border-radius:0;padding:6px;font:inherit;line-height:1.65;background:var(--bg)}
.block-add-buttons{display:flex;flex-wrap:wrap;gap:10px}
.admin-form .inline-image-upload .image-dropzone{width:fit-content;max-width:100%;margin:auto;min-width:200px;min-height:160px;border-radius:6px;overflow:hidden}
.admin-form .inline-image-upload .image-dropzone.has-image{min-width:0;min-height:0;padding:0;border:0}
.inline-image-upload .block-image,.inline-image-upload .upload-previews{display:block;margin:0}
.inline-image-upload .upload-previews:empty{display:none}
.inline-image-upload img{display:block;max-width:100%;max-height:500px;width:auto;height:auto;margin:auto;border-radius:4px;object-fit:contain}
.image-overlay{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px}
.has-image .image-overlay{position:absolute;inset:0;background:rgb(0 0 0 / .65);color:#fff;opacity:0;transition:opacity .15s}
.has-image .image-overlay small{color:#fff}
.has-image:hover .image-overlay,.has-image.is-dragging .image-overlay,.inline-image-upload:focus-within .image-overlay{opacity:1}
.inline-image-upload:focus-within .image-dropzone{outline:2px solid var(--ink);outline-offset:3px}
.attachment-strip,.attachment-list{display:flex;flex-wrap:wrap;gap:10px;align-items:center;min-width:0}
.attachment-strip{border-radius:6px;padding:4px}.attachment-strip.is-dragging{outline:2px dashed var(--ink)}
.attachment-card{display:flex;align-items:center;gap:4px;max-width:100%;border:1px solid var(--line);border-radius:6px;padding:4px;background:var(--bg)}
.attachment-name{font-size:.85rem;max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:4px;text-decoration:none}
.attachment-grip{cursor:grab;width:24px;padding:4px}.attachment-card.is-moving{opacity:.45}
.admin-form .attachment-add{display:flex;align-items:center;justify-content:center;gap:8px;border:1px dashed var(--line);border-radius:6px;min-height:44px;padding:8px 12px;cursor:pointer;font-size:.85rem}
.attachment-add:hover,.attachment-add:focus-within{border-color:var(--ink)}
[data-attachment-status]:empty{display:none}
.admin-wrap:has(.task-editor)>.admin-back{display:inline-flex;width:auto;max-width:760px;margin-left:max(0px,calc((100% - 760px)/2));margin-right:0}
a.finish-button{text-decoration:none!important;display:inline-flex;align-items:center;justify-content:center}
.toast-stack{position:fixed;right:24px;bottom:24px;z-index:100;display:grid;gap:10px;max-width:min(440px,calc(100vw - 32px))}
.toast-stack .toast,body:has(.admin-wrap) .toast-stack .toast{display:flex;align-items:center;gap:16px;margin:0;padding:16px 18px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--ink);font-size:.88rem;box-shadow:0 4px 20px rgb(0 0 0 / .12)}
@media(max-width:620px){.condition-block{grid-template-columns:minmax(0,1fr) 30px;gap:6px}.editor-icon{width:30px;height:32px;padding:6px}.attachment-name{max-width:160px}.toast-stack{right:16px;bottom:16px}.condition-content{padding:8px}}
.block-add-buttons svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;vertical-align:middle;margin-right:7px}
.attachment-add{position:relative}
.admin-form input.sr-only{width:1px!important;height:1px!important;padding:0!important;border:0!important}

/* Compact return navigation, with a Material-style back arrow. */
.admin-back,.admin-wrap:has(.task-editor)>.admin-back{display:inline-flex;align-items:center;gap:7px;min-height:32px;padding:4px 7px;border:0;border-radius:5px;background:transparent;color:var(--muted);font-size:.82rem;font-weight:500;line-height:1.4;text-decoration:none;margin-top:4px;margin-bottom:16px}
.admin-back:hover,.admin-wrap a.admin-back:hover{color:var(--ink);background:var(--soft);text-decoration:none}
.admin-back:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.back-arrow{display:block;flex-shrink:0;width:18px;height:18px}
.preview-toolbar .admin-back{margin:0}

/* Keep preview navigation attached to the card instead of distributing grid rows. */
.solve-shell:has(>.preview-toolbar){grid-template-rows:auto auto;align-content:center;justify-items:stretch;align-items:start;gap:16px}
.solve-shell>.preview-toolbar{width:100%;align-items:center;margin:0}
.preview-toolbar a.admin-back{text-decoration:none}

.finish-form .finish-button,.answer-submit{transition:background-color .35s ease,color .35s ease,border-color .35s ease,transform .18s ease}
.finish-form .finish-button.is-ready{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.answer-submit.is-saved{background:var(--bg);color:var(--ink);border-color:var(--line)}

.solver-card button,.solver-card .solver-icon-action{font-size:.875rem;font-weight:650;line-height:1.4}

.answer-submit:disabled{background:var(--bg);color:var(--muted);border-color:var(--line);cursor:default;transform:none;box-shadow:none}

/* Account: a quiet, single-column personal space. */
.avatar{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;overflow:hidden;border:1px solid var(--line);border-radius:50%;background:var(--bg);color:var(--ink);font-weight:650;line-height:1}
.avatar img{width:100%;height:100%;object-fit:cover;display:block}.avatar-nav{width:40px;height:40px;font-size:1rem}.avatar-nav:hover{border-color:var(--ink)}.avatar-large{width:96px;height:96px;font-size:2.3rem}
.profile-shell{width:min(100% - 40px,680px);margin:60px auto 90px}.profile-heading{text-align:center}.profile-heading h1{font-size:clamp(2rem,6vw,3rem);margin:20px 0 10px;overflow-wrap:anywhere}.profile-heading p{font-size:.9rem}
.profile-stats{display:grid;grid-template-columns:repeat(3,1fr);padding:28px 0;margin:32px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.profile-stats div{text-align:center;padding:0 8px}.profile-stats div+div{border-left:1px solid var(--line)}.profile-stats strong{display:block;font-size:clamp(1.7rem,5vw,2.6rem);line-height:1.2;letter-spacing:-.06em}.profile-stats span{display:block;font-size:.75rem;color:var(--muted);margin-top:8px}
.settings-title{font-size:1rem;margin:36px 0 16px}.settings-panel,.history-link{border:1px solid var(--line);border-radius:18px;overflow:hidden}.settings-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:22px}.settings-row strong{display:block;font-size:.95rem;font-weight:650}.settings-row small{display:block;font-size:.8rem;color:var(--muted);margin-top:4px}.history-link:hover{border-color:var(--ink)}.settings-detail{padding:0 22px;border-bottom:1px solid var(--line)}.settings-detail summary{cursor:pointer;list-style:none;display:flex;justify-content:space-between;gap:16px;padding:22px 0;font-size:.95rem;font-weight:650}.settings-detail summary::-webkit-details-marker{display:none}.settings-detail[open] summary span{transform:rotate(45deg)}.settings-detail .stack-form{margin:0 0 24px}.settings-detail .primary-button{justify-self:start}.avatar-picker{display:grid;justify-items:start;gap:10px}.avatar-picker label{width:100%}.avatar-picker input{max-width:100%;font-size:.85rem}.avatar-picker small{font-weight:400}.avatar-delete{margin:0 0 24px}.profile-logout{margin:28px 0;text-align:center}.history-shell>.back-link{margin:0 0 36px}.history-shell h1{font-size:clamp(2rem,6vw,3rem)}.history-shell .variant-list{margin-top:30px}.history-empty{border:1px solid var(--line);border-radius:18px;padding:32px}.history-empty h2{font-size:1.3rem}.finish-button:disabled{opacity:.5;cursor:default}
@media(max-width:480px){.profile-shell{margin-top:32px}.profile-stats span{font-size:.68rem}.settings-row{padding:18px;gap:10px}.settings-detail{padding:0 18px}.top-nav{gap:14px}.avatar-nav{width:36px;height:36px}.settings-row .finish-button{font-size:.75rem;padding:10px}}

.profile-avatar-form{display:grid;justify-items:center;gap:10px}.avatar-edit{position:relative;display:flex;padding:0;border:0;background:transparent;color:var(--ink);border-radius:50%}.avatar-edit:hover .avatar,.avatar-edit.is-dragging .avatar{border-color:var(--ink);outline:2px solid var(--ink);outline-offset:4px}.avatar-pencil{position:absolute;right:-4px;bottom:0;display:grid;place-items:center;width:30px;height:30px;border:1px solid var(--line);border-radius:50%;background:var(--bg);color:var(--ink)}.avatar-error:empty{display:none}.avatar-error{font-size:.82rem;margin:0}.avatar-remove-inline{margin-top:8px}.avatar-file-input{max-width:100%;font-size:.8rem}.profile-avatar-form.is-enhanced .avatar-file-input,.profile-avatar-form.is-enhanced .avatar-save{display:none}.profile-heading .profile-login{font-size:.85rem;margin-bottom:0}.profile-stats{gap:12px;padding:0;border:0}.profile-stats div{border:1px solid var(--line);border-radius:16px;padding:24px 10px}.profile-stats div+div{border:1px solid var(--line)}.profile-logout{display:flex;justify-content:center;margin-bottom:14px}.profile-logout .finish-button{min-width:210px}.delete-account-link{display:block;width:max-content;margin:0 auto;color:var(--red);border-color:var(--red);text-align:center;min-width:210px}.danger-button{background:var(--red);border-color:var(--red);color:#fff}.delete-account-page h1{font-size:clamp(1.8rem,5vw,2.6rem)}.stack-form .deletion-checkbox{display:flex;align-items:flex-start;gap:10px;font-weight:400}.stack-form .deletion-checkbox input{width:18px;height:18px;flex-shrink:0;margin-top:3px}.history-shell>.admin-back{margin-bottom:28px}.variant-link.is-in-progress,.variant-link.is-in-progress:hover{border-color:#d8aa00}.solve-shell:has(>.solver-back){grid-template-rows:auto auto;align-content:center;justify-items:stretch;align-items:start;gap:12px}.solve-shell>.solver-back{justify-self:start;margin:0}.solver-back .back-arrow{flex-shrink:0}
@media(max-width:480px){.profile-stats{gap:8px}.profile-stats div{padding:20px 7px;border-radius:13px}}
.result-stage:has(.result-return){grid-template-rows:auto auto;align-content:center;gap:12px}.result-return{width:min(100%,680px);margin-inline:auto}.result-return .admin-back{margin:0}.telegram-check{display:inline-block;margin-top:20px}


/* Align shared header controls on one center line, including the admin sections. */
.site-header,.site-header:has(.admin-nav){display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:24px;height:78px;min-height:78px;padding:0 24px}
.site-header>.brand{grid-column:1;display:inline-flex;align-items:baseline;gap:.24em;line-height:1}
.site-header>.top-nav{grid-column:3;display:flex;align-items:center;justify-self:end;gap:16px;margin:0;white-space:nowrap}
.top-nav>a:not(.avatar){display:inline-flex;align-items:center;min-height:40px;line-height:1.25}
.top-nav .icon-button,.top-nav .avatar-nav{width:40px;height:40px;flex:0 0 40px;line-height:1;padding:0}
.theme-toggle svg{display:block}
.site-header>.admin-nav{grid-column:2;display:flex;align-items:center;justify-content:center;min-width:0;margin:0;padding:0;gap:4px;border:0}
.site-header .admin-nav a{display:inline-flex;align-items:center;min-height:40px;line-height:1.25}
.profile-avatar-controls{position:relative;width:144px;margin:0 auto}
.profile-avatar-controls .avatar-large{width:144px;height:144px;font-size:3.4rem}
.profile-avatar-controls .avatar-pencil{right:36px;bottom:0;top:auto}
.profile-avatar-controls .avatar-remove-inline{position:absolute;left:auto;right:0;bottom:0;top:auto;margin:0}
.avatar-trash{display:grid;place-items:center;width:30px;height:30px;padding:0;border:1px solid var(--red);border-radius:50%;background:var(--bg);color:var(--red)}
.avatar-trash svg,.avatar-pencil svg{display:block;flex-shrink:0}
.avatar-trash:hover{background:var(--red);color:#fff}
.profile-account-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:stretch;margin-top:28px;padding-top:24px;border-top:1px solid var(--line)}
.profile-account-actions .profile-logout{display:flex;margin:0}
.profile-account-actions .finish-button{display:flex;align-items:center;justify-content:center;width:100%;min-width:0;min-height:48px;margin:0;padding:12px 18px;line-height:1.4}
.profile-account-actions .delete-account-link{width:100%}
@media(max-width:900px){
  .site-header:has(.admin-nav){height:auto;min-height:78px;grid-template-rows:78px auto;gap:0 20px;padding:0 24px}
  .site-header>.admin-nav{grid-column:1/-1;grid-row:2;justify-content:flex-start;overflow-x:auto;padding:0 0 12px}
}
@media(max-width:480px){
  .site-header,.site-header:has(.admin-nav){padding-left:16px;padding-right:16px;column-gap:12px}
  .site-header:not(:has(.admin-nav)){height:66px;min-height:66px}
  .site-header>.top-nav{gap:8px}
  .profile-account-actions{grid-template-columns:1fr;gap:10px}
}

/* Production feedback and bounded lists. */
.pagination{display:flex;justify-content:center;align-items:center;gap:20px;margin:24px auto 40px;padding:0 16px}.pagination a{text-decoration:underline}.list-search{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:20px 0}.list-search label{flex:1;min-width:160px}.list-search input{width:100%;padding:10px;border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:8px}.list-search .admin-search{margin:0}.attempt-timer{font-size:.85rem;font-variant-numeric:tabular-nums}[data-solver-error]{color:var(--red);font-size:.9rem}.map-panel[inert]{pointer-events:none}

.admin-table-scroll{max-width:100%;overflow-x:auto}.admin-wrap{min-width:0}.task-body,.files a{overflow-wrap:anywhere}.files a{max-width:100%}

/* Markdown task prose keeps the same card typography and palette. */
.task-markdown{white-space:normal;min-width:0}
.task-markdown>:first-child{margin-top:0}.task-markdown>:last-child{margin-bottom:0}
.task-markdown p{margin:0 0 1em}.task-markdown ul,.task-markdown ol{padding-left:1.5em;margin:0 0 1em}
.task-markdown h1,.task-markdown h2,.task-markdown h3,.task-markdown h4,.task-markdown h5,.task-markdown h6{font-size:1.15em;line-height:1.4;margin:1.2em 0 .6em;letter-spacing:normal}
.task-markdown a{text-decoration:underline}.task-markdown blockquote{margin:1em 0;padding-left:1em;border-left:2px solid var(--ink)}
.task-markdown pre{max-width:100%;overflow-x:auto;padding:1em;border:1px solid var(--line);white-space:pre}
.task-markdown code{font-size:.9em}.task-math[data-display]{max-width:100%;overflow-x:auto;overflow-y:hidden}
.task-math-error{white-space:pre-wrap}.task-markdown .katex{color:inherit}

/* Account navigation and optional avatar upload. */
.auth-links{margin-top:24px;text-align:center;font-size:.9rem}
.auth-links .switch-auth{margin:0}
.auth-card .primary-button{justify-content:center}
.auth-register-button{width:100%;min-height:48px;padding:12px 16px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font-weight:600}
.auth-register-button:hover{border-color:var(--ink)}
.auth-footer{display:grid;justify-items:center;gap:12px;margin-top:24px;text-align:center;font-size:.8rem;color:var(--muted)}
.auth-footer a{text-decoration:underline;text-underline-offset:3px}
.auth-footer a:hover{color:var(--ink)}
.auth-telegram{margin-top:24px}
.auth-card .avatar-picker{display:grid;gap:8px;justify-items:stretch}
.avatar-dropzone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:160px;padding:24px 16px;border:1px dashed var(--line);border-radius:12px;text-align:center;font-size:.85rem}
.avatar-dropzone:hover,.avatar-dropzone.is-dragging{border-color:var(--ink)}
.avatar-dropzone:focus-within{outline:2px solid var(--ink);outline-offset:3px}
.auth-card .avatar-dropzone input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;padding:0;border:0}
.avatar-dropzone small{font-size:.75rem}
.avatar-picker [data-avatar-preview][hidden]{display:none}
.avatar-picker [data-avatar-reset]{justify-self:start}

.channel-card{display:flex;align-items:center;justify-content:space-between;gap:20px;max-width:520px;margin-top:28px;padding:20px 22px;border:1px dashed #8bc4ec;border-radius:14px;background:#f2f9ff;color:#102f46;transition:border-color .2s,background .2s}
.channel-card:hover{border-color:#3894d3;background:#e2f2ff}
.channel-card:focus-visible{outline-color:#3894d3}
html[data-theme=dark] .channel-card{background:#071b29;border-color:#28658e;color:#e2f2ff}
html[data-theme=dark] .channel-card:hover{background:#0b2639;border-color:#60afe3}
.channel-card h2{margin:0 0 6px;font-size:1.05rem;line-height:1.35;letter-spacing:-.02em}
.channel-card p{margin:0;font-size:.85rem;line-height:1.55;overflow-wrap:anywhere}
@media(max-width:480px){.site-header{padding-left:16px;padding-right:16px}.site-header>.top-nav{gap:10px;font-size:.75rem}.channel-card{padding:18px}}

.channel-copy{min-width:0}
.channel-logo{display:block;flex:0 0 44px;width:44px;height:44px;object-fit:contain}
@media(max-width:480px){.channel-card{gap:16px}.channel-logo{flex-basis:36px;width:36px;height:36px}}
