/* Блок-схема — offline interface. No external fonts or assets required. */
:root {
  color-scheme: light;
  --paper-bg:#f5f5f2; --panel:#fff; --panel-2:#efefed; --sheet:#fafaf8;
  --ink:#17191d; --ink-soft:#626873; --ink-mute:#858b95; --ink-faint:#9299a3;
  --line:#e2e3e5; --line-strong:#c8cbd0; --accent:#0672ff; --accent-2:#005ce0;
  --accent-soft:#e4eeff; --danger:#db4a62; --ok:#27bd86;
  --font-ui:Arial,Helvetica,system-ui,sans-serif;
  --font-display:Arial,Helvetica,system-ui,sans-serif;
  --font-mono:'SFMono-Regular',Consolas,'Liberation Mono',monospace;
  --radius:10px; --paper:#fff; --dot:#cfd1d4; --code-blue:#006edb; --code-pink:#b83292; --code-green:#2c8966;
}
:root[data-theme="dark"] {
  color-scheme:dark;
  --paper-bg:#000; --panel:#101214; --panel-2:#191c20; --sheet:#111416;
  --ink:#f6f6f8; --ink-soft:#a2a8b4; --ink-mute:#737b88; --ink-faint:#616a76;
  --line:#252a30; --line-strong:#414951; --accent-soft:#112643; --paper:#111416; --dot:#30373e;
  --code-blue:#40b8ff; --code-pink:#fa88d9; --code-green:#9bd7a0;
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; background:var(--paper-bg); color:var(--ink); font-family:var(--font-ui); -webkit-font-smoothing:antialiased; }
button,input,textarea,select { font:inherit; }
button,a,input,select,textarea,summary { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; color:inherit; }
a { color:inherit; }
button,select { touch-action:manipulation; }
::selection { background:#0672ff66; }
:where(button,a,select,input,textarea,summary):focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip-path:inset(50%)!important; white-space:nowrap!important; border:0!important; }
.skip-link { position:fixed; top:10px; left:20px; transform:translateY(-200%); z-index:100; padding:14px; background:var(--accent); color:#fff; border-radius:8px; }
.skip-link:focus-visible { transform:translateY(0); }
.top { max-width:1800px; margin:auto; padding:22px 40px; display:flex; align-items:center; justify-content:space-between; gap:24px; }
.brand { display:flex; align-items:center; gap:12px; text-decoration:none; font-size:25px; font-weight:800; letter-spacing:-1px; white-space:nowrap; }
.brand-mark { width:100px; height:30px; }
.tabs { display:flex; align-items:center; gap:30px; }
.tab { position:relative; border:0; background:none; padding:12px 0; font-size:15px; color:var(--ink-soft); white-space:nowrap; }
.tab:hover,.tab.active { color:var(--ink); }
.tab::after { content:''; position:absolute; left:0; right:0; bottom:0; height:3px; border-radius:2px; background:var(--accent); transform:scaleX(0); transition:transform .2s; }
.tab.active::after { transform:scaleX(1); }
.header-actions { display:flex; align-items:center; gap:22px; }
.github-link { display:flex; align-items:center; gap:9px; font-size:15px; text-decoration:none; }
.github-link:hover { color:var(--accent); }
.theme-toggle { background:none; border:0; color:var(--ink-soft); font-size:24px; padding:6px; border-radius:8px; }
.theme-toggle:hover { color:var(--ink); background:var(--panel-2); }
.hero { position:relative; max-width:1800px; margin:0 auto; padding:36px 40px 34px; display:flex; align-items:center; justify-content:space-between; gap:20px; }
.hero-copy { position:relative; z-index:1; }
h1 { font-family:var(--font-display); font-size:clamp(54px,6.45vw,110px); font-weight:900; line-height:.99; letter-spacing:-.065em; margin:0; }
h1 span { display:inline-block; color:var(--accent); white-space:nowrap; }
.hero p { font-size:clamp(15px,1.7vw,25px); letter-spacing:-.035em; margin:20px 0 0; color:var(--ink-soft); }
.hero-friends { width:31%; max-width:460px; flex-shrink:0; overflow:visible; }
.friend-yellow { transform-origin:100px 80px; }
.tabpage { display:none; }
.tabpage.active { display:block; }
main { display:grid; grid-template-columns:minmax(0,.88fr) 7px minmax(0,1.12fr); height:600px; min-height:560px; max-width:1720px; margin:0 30px; border:1px solid var(--line-strong); border-radius:14px; overflow:hidden; background:var(--panel); }
.panel { min-width:0; min-height:0; display:flex; flex-direction:column; }
.panel-head { min-height:66px; display:flex; align-items:center; padding:12px 22px; gap:10px; border-bottom:1px solid var(--line); flex-shrink:0; }
.panel-label { margin:0; font-size:19px; letter-spacing:-.035em; white-space:nowrap; }
.code-head { justify-content:space-between; gap:14px; }
.language-tabs { display:flex; gap:6px; }
.language-tab { min-width:43px; border:1px solid transparent; border-radius:8px; background:var(--panel-2); padding:10px 12px; font-size:12px; transition:background .15s; }
.language-tab:hover { border-color:var(--line-strong); }
.language-tab.active { background:var(--accent); color:white; }
.code-options { display:flex; align-items:center; gap:10px; padding:8px 22px; min-height:39px; color:var(--ink-mute); font-size:11px; }
.code-file { font-family:var(--font-mono); }
.code-options .tool-group { margin-left:auto; opacity:.65; }
.code-options:hover .tool-group,.code-options:focus-within .tool-group { opacity:1; }
.method-select { max-width:60%; background:var(--panel-2); color:var(--ink); border:1px solid var(--line-strong); border-radius:5px; font-size:11px; padding:4px; }
.editor-wrap { position:relative; display:flex; flex:1; overflow:hidden; min-height:180px; }
.gutter { flex:0 0 56px; padding:14px 14px 14px 0; text-align:right; color:var(--ink-faint); user-select:none; overflow:hidden; white-space:pre; border-right:1px solid var(--line); }
.gutter,#code,#codeHighlight { font-family:var(--font-mono); font-size:15px; line-height:1.8; tab-size:4; }
.code-surface { position:relative; flex:1; min-width:0; }
#code,#codeHighlight { padding:14px 20px; margin:0; border:0; white-space:pre; overflow:auto; }
#code { position:absolute; inset:0; width:100%; height:100%; resize:none; background:transparent; color:var(--ink); caret-color:var(--accent); outline:none; }
#codeHighlight { display:none; pointer-events:none; height:100%; scrollbar-width:none; color:var(--ink); }
#codeHighlight::-webkit-scrollbar { display:none; }
.code-surface.highlighted #codeHighlight { display:block; }
.code-surface.highlighted #code { color:transparent; -webkit-text-fill-color:transparent; }
#code::placeholder { -webkit-text-fill-color:var(--ink-mute); color:var(--ink-mute); }
#code:focus-visible { box-shadow:inset 0 0 0 1px #0672ff44; }
.token-keyword,.token-number { color:var(--code-pink); }
.token-call { color:var(--code-blue); }
.token-string { color:var(--code-green); }
.token-comment { color:var(--ink-mute); }
#lineHl { position:absolute; left:0; right:0; height:0; pointer-events:none; opacity:0; background:#0672ff18; box-shadow:inset 3px 0 var(--accent); }
#lineHl.on { opacity:1; }
.editor-toolbar { display:flex; align-items:center; justify-content:space-between; flex-direction:row-reverse; gap:16px; padding:24px 22px; }
.local-note { display:flex; align-items:center; gap:7px; color:var(--ink-soft); font-size:12px; line-height:1.4; }
.local-note i { width:5px; height:5px; border-radius:50%; background:var(--ok); flex-shrink:0; }
.editor-meta { display:flex; align-items:center; gap:13px; flex-wrap:wrap; }
.import-button { display:inline-flex; align-items:center; gap:6px; padding:8px 11px; border:1px solid var(--line-strong); border-radius:9px; background:var(--panel-2); color:var(--ink); font-size:12px; font-weight:650; }
.import-button:hover { border-color:var(--accent); }.import-button span { color:var(--accent); font-size:17px; line-height:1; }
.panel.editor.file-hover::after { content:'Перетащите файл или фотографию сюда'; position:absolute; inset:12px; z-index:30; display:grid; place-items:center; border:2px dashed var(--accent); border-radius:12px; background:color-mix(in srgb,var(--panel) 88%,transparent); color:var(--accent); font-size:16px; font-weight:750; pointer-events:none; }
#build { display:inline-grid; place-items:center; position:relative; overflow:hidden; min-height:58px; padding:16px 26px; border:0; border-radius:24px; background:var(--accent); color:white; font-size:17px; font-weight:700; letter-spacing:-.02em; flex-shrink:0; transition:background .2s,transform .2s; }
#build:hover { background:var(--accent-2); transform:translateY(-2px); }
#build:active { transform:translateY(0); }
#build .arr { font-size:24px; font-weight:400; }
.bt-face { grid-area:1/1; display:flex; align-items:center; gap:10px; transition:opacity .2s,transform .2s; white-space:nowrap; }
.bt-busy,.bt-done { opacity:0; transform:translateY(120%); }
#build.building .bt-idle,#build.done .bt-idle { opacity:0; transform:translateY(-120%); }
#build.building .bt-busy,#build.done .bt-done { opacity:1; transform:none; }
#build.done { background:#12895c; }
#build.fail { background:var(--danger); }
#build:disabled { cursor:progress; }
.bt-dots i { font-style:normal; animation:dot .8s infinite alternate; }
.bt-dots i:nth-child(2) { animation-delay:.2s; }.bt-dots i:nth-child(3) { animation-delay:.4s; }
@keyframes dot { to {opacity:.2} }
.vsplit { position:relative; cursor:col-resize; border-left:1px solid var(--line); background:var(--panel); }
.vsplit::after { content:''; position:absolute; inset:45% 2px; border-radius:2px; background:var(--line-strong); }
.vsplit:hover,.vsplit.dragging { background:var(--accent); }
.vsplit:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; background:var(--accent); }
.diagram { background:var(--sheet); }
.spacer { flex:1; }
.btn-ghost,.tool-group button,.ed-btn { display:inline-flex; align-items:center; justify-content:center; gap:5px; background:transparent; border:1px solid var(--line-strong); border-radius:7px; padding:8px 10px; color:var(--ink); font-size:12px; white-space:nowrap; }
.btn-ghost:hover,.tool-group button:hover,.ed-btn:hover { background:var(--panel-2); border-color:var(--ink-mute); }
.btn-ghost.active,.ed-btn.pri { color:#fff; background:var(--accent); border-color:var(--accent); }
.diagram .panel-head>.btn-ghost svg { display:none; }
.sheet-scroll { position:relative; flex:1; min-height:0; overflow:auto; display:flex; align-items:flex-start; justify-content:center; padding:18px 24px; background-image:radial-gradient(var(--dot) .7px,transparent .8px); background-size:18px 18px; }
.sheet { position:relative; flex-shrink:0; margin:auto; --diagram-font:Arial,Helvetica,sans-serif; }
.sheet svg { display:block; max-width:none; }
/* Screen-only palette; downloaded diagrams use their own white paper. */
.sheet svg>rect:not(.sh) { fill:transparent; }
.sheet .sh { fill:var(--sheet); stroke:var(--ink); }
.sheet .edge,.sheet .ln { stroke:var(--ink); }
.sheet .tx,.sheet .elbl { fill:var(--ink); }
.sheet [data-shape-type="prep"] { stroke:#ebca3c; }
.sh.hl { stroke:var(--accent)!important; stroke-width:2.8!important; }
.sh[data-srcline] { cursor:pointer; }
.diagram-dock { display:flex; align-items:center; justify-content:flex-end; gap:8px; padding:12px 18px; border-top:1px solid var(--line); background:var(--sheet); flex-wrap:wrap; }
.diagram-dock>.tool-group { order:2; margin-left:auto; }
.tool-group { display:flex; align-items:center; gap:4px; }
.tool-group button { min-width:28px; padding:6px 8px; }
.zoom-read { width:49px; border:0; background:transparent; color:var(--ink-soft); text-align:center; font-family:var(--font-mono); font-size:11px; }
.code-options .tool-group button { border-color:transparent; padding:2px 5px; min-width:20px; }
.code-options .zoom-read { width:39px; font-size:10px; }
.error-box { display:none; position:absolute; inset:0; padding:28px; align-items:center; justify-content:center; }
.error-card { max-width:420px; padding:24px; border:1px solid var(--danger); border-radius:12px; background:var(--panel); color:var(--danger); line-height:1.6; }
.error-card .tag { font-weight:700; margin-bottom:8px; }
#edbar { display:none; padding:12px 18px; border-top:1px solid var(--line); background:var(--panel); gap:8px; align-items:center; flex-wrap:wrap; }
.ed-hint { width:100%; color:var(--ink-soft); font-size:12px; }
.ed-div { width:1px; height:22px; background:var(--line); }
.ed-btn.dng { color:var(--danger); }
.page-wrap { max-width:1200px; margin:auto; padding:36px 30px 60px; }
.page-wrap h2 { font-size:30px; letter-spacing:-1px; margin:0 0 22px; }
.page-wrap .about-heading { font-size:46px; }
.section-kicker { font:11px var(--font-mono); color:var(--accent); letter-spacing:.18em; }
.about-intro { max-width:720px; color:var(--ink-soft); line-height:1.7; font-size:18px; margin:0 0 48px; }
.page-note { color:var(--ink-soft); line-height:1.6; margin-bottom:28px; }
.qa { background:var(--panel); border:1px solid var(--line); border-radius:12px; margin-bottom:12px; }
.qa summary { font-weight:600; cursor:pointer; padding:20px 24px; line-height:1.5; }
.qa-body { padding:0 24px 24px; color:var(--ink-soft); line-height:1.7; }
.qa code { font:13px var(--font-mono); background:var(--panel-2); border-radius:4px; padding:2px 4px; }
.ex-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.ex-card { border:1px solid var(--line-strong); border-radius:14px; padding:22px; background:var(--panel); color:var(--ink); display:flex; flex-direction:column; text-align:left; transition:translate .2s,border-color .2s; }
.ex-card:hover { translate:0 -4px; border-color:var(--accent); }
.ex-card-head { display:flex; gap:12px; justify-content:space-between; align-items:flex-start; }
.ex-card h3 { margin:0 0 12px; font-size:18px; line-height:1.3; }
.ex-lang-badge { color:var(--code-blue); border:1px solid var(--line-strong); padding:4px 7px; font:11px var(--font-mono); border-radius:5px; white-space:nowrap; }
.ex-card .sub { color:var(--ink-soft); font-size:13px; line-height:1.6; flex:1; }
.ex-card pre { color:var(--ink-soft); font:11px/1.6 var(--font-mono); background:var(--panel-2); padding:12px; border-radius:7px; overflow:hidden; margin:16px 0; }
.ex-card-foot { display:flex; justify-content:space-between; gap:8px; color:var(--accent); font-size:12px; line-height:1.4; }
.ex-card-lines { color:var(--ink-mute); white-space:nowrap; }
.legend-body { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.leg-card { display:flex; gap:18px; align-items:center; border:1px solid var(--line); border-radius:12px; background:var(--panel); padding:24px; }
.leg-ico { width:68px; flex-shrink:0; color:var(--ink); }
.leg-ico .sh { fill:none; stroke:currentColor; stroke-width:1.6; }.leg-ico .ln {stroke:currentColor;}
.leg-txt .nm { font-size:15px; font-weight:700; line-height:1.4; margin-bottom:6px; }
.leg-txt .ds { color:var(--ink-soft); font-size:12px; line-height:1.6; }
footer { max-width:1800px; margin:auto; padding:22px 40px 26px; display:flex; justify-content:space-between; gap:20px; color:var(--ink-mute); font:11px var(--font-mono); }
footer i { font-style:normal; padding:0 6px; }
.footer-links { display:flex; justify-content:center; gap:18px; flex-wrap:wrap; }
.footer-links a { color:var(--ink-soft); text-underline-offset:3px; }
.footer-links a:hover { color:var(--accent); }
.payment-legal { max-width:680px; margin:18px auto 0; color:var(--ink-mute); font-size:12px; line-height:1.6; text-align:center; }
.payment-legal a { color:var(--ink-soft); text-underline-offset:3px; }
.payment-legal a:hover { color:var(--accent); }
#toasts { position:fixed; right:24px; bottom:24px; display:flex; flex-direction:column; gap:8px; z-index:100; pointer-events:none; }
.toast { display:flex; align-items:center; gap:12px; padding:16px 20px; background:var(--panel-2); color:var(--ink); border:1px solid var(--line-strong); border-radius:12px; box-shadow:0 8px 30px #0003; max-width:calc(100vw - 32px); animation:toast-in .2s ease-out; }
.toast .tk { display:grid; place-items:center; width:25px; height:25px; background:var(--ok); border-radius:50%; flex-shrink:0; }
.toast b { display:block; font-size:13px; }.toast .tsub { display:block; margin-top:4px; color:var(--ink-soft); font-size:11px; }
.toast.out { opacity:0; transition:opacity .3s; }
@keyframes toast-in { from {opacity:0;transform:translateY(12px)} to {opacity:1;transform:none} }
/* Motion vocabulary: soft arrivals, springy controls, living flowchart characters. */
:root { --motion-ease:cubic-bezier(.16,1,.3,1); }
.motion-toggle { display:grid; place-items:center; width:30px; height:34px; border:0; border-radius:8px; background:none; color:var(--ink-soft); }
.motion-toggle:hover { background:var(--panel-2); color:var(--ink); }
.motion-toggle:disabled { opacity:.45; cursor:default; }
.motion-play { display:none; }
.motion-toggle[aria-pressed="false"] .motion-pause { display:none; }
.motion-toggle[aria-pressed="false"] .motion-play { display:block; }
@media (prefers-reduced-motion:no-preference) {
  :root:not([data-motion="off"]) .top { animation:arrive-down .65s var(--motion-ease) both; }
  :root:not([data-motion="off"]) .hero-copy h1 { animation:arrive-up .8s .08s var(--motion-ease) both; }
  :root:not([data-motion="off"]) .hero-copy h1 span { animation:title-arrive .95s .18s var(--motion-ease) both; }
  :root:not([data-motion="off"]) .hero-copy p { animation:arrive-up .8s .28s var(--motion-ease) both; }
  :root:not([data-motion="off"]) .hero-friends { animation:friends-arrive 1s .2s var(--motion-ease) both; }
  :root:not([data-motion="off"]) .tabpage.active { animation:arrive-up .65s var(--motion-ease) both; }
  :root:not([data-motion="off"]) .friend-yellow { animation:yellow-float 7s ease-in-out infinite; }
  :root:not([data-motion="off"]) .friend-blue { transform-origin:297px 158px; animation:blue-float 8s -2s ease-in-out infinite; }
  :root:not([data-motion="off"]) .friend-pink { animation:pink-float 6s -1s ease-in-out infinite; }
  :root:not([data-motion="off"]) .friend-connectors { stroke-dasharray:420; animation:connect-arrive 1.4s .3s var(--motion-ease) both; }
  :root:not([data-motion="off"]) .pupil { transition:translate .22s ease-out; }
  :root:not([data-motion="off"]) .ex-card,
  :root:not([data-motion="off"]) .leg-card { animation:arrive-up .6s var(--motion-ease) both; }
  :root:not([data-motion="off"]) :is(.ex-card,.leg-card):nth-child(3n + 2) { animation-delay:.07s; }
  :root:not([data-motion="off"]) :is(.ex-card,.leg-card):nth-child(3n) { animation-delay:.14s; }
  :root:not([data-motion="off"]) .qa[open] .qa-body { animation:arrive-up .35s var(--motion-ease) both; }
  :root:not([data-motion="off"]) .error-card { animation:error-arrive .4s ease-out; }
  :root:not([data-motion="off"]) .btn-ghost,
  :root:not([data-motion="off"]) .language-tab,
  :root:not([data-motion="off"]) .tool-group button,
  :root:not([data-motion="off"]) .ed-btn { transition:background .2s,border-color .2s,translate .3s var(--motion-ease),box-shadow .3s; }
  :root:not([data-motion="off"]) #build { transition:background .2s,transform .3s var(--motion-ease),box-shadow .3s; }
  :root:not([data-motion="off"]) #build .arr { transition:translate .35s var(--motion-ease); }
  :root:not([data-motion="off"]) #build.done .bt-check path { stroke-dasharray:18; animation:check-draw .5s ease-out; }
  :root:not([data-motion="off"]) .theme-toggle { transition:rotate .45s var(--motion-ease),background .2s; }
  :root:not([data-motion="off"]) .theme-toggle:hover { rotate:30deg; }
  :root:not([data-motion="off"]) .brand-mark :is(rect,path) { transform-box:fill-box; transform-origin:center; transition:rotate .45s var(--motion-ease),translate .45s var(--motion-ease); }
  :root:not([data-motion="off"]) .brand:hover .brand-mark rect:first-of-type { rotate:-12deg; translate:0 -2px; }
  :root:not([data-motion="off"]) .brand:hover .brand-mark path:last-of-type { rotate:20deg; }
  :root:not([data-motion="off"]) .brand:hover .brand-mark rect:last-of-type { rotate:12deg; translate:0 2px; }
  :root:not([data-motion="off"]) .tab:hover::after { transform:scaleX(.45); }
  :root:not([data-motion="off"]) .tab.active:hover::after { transform:scaleX(1); }
  :root:not([data-motion="off"]) .toast { animation:toast-spring .45s var(--motion-ease); }
  :root:not([data-motion="off"]) .toast.out { opacity:0; translate:16px 0; transition:opacity .3s,translate .3s; }
}
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  :root:not([data-motion="off"]) :is(.btn-ghost,.language-tab,.ed-btn):hover { translate:0 -2px; }
  :root:not([data-motion="off"]) #build:hover { box-shadow:0 8px 30px #0672ff40; }
  :root:not([data-motion="off"]) #build:hover .arr { translate:5px 0; }
  :root:not([data-motion="off"]) .ex-card:hover { box-shadow:0 10px 28px #0672ff12; }
}
@keyframes arrive-up { from {opacity:0;transform:translateY(18px)} to {opacity:1;transform:translateY(0)} }
@keyframes arrive-down { from {opacity:0;transform:translateY(-12px)} to {opacity:1;transform:translateY(0)} }
@keyframes title-arrive { from {opacity:0;transform:translateY(24px);clip-path:inset(0 0 100% 0)} to {opacity:1;transform:translateY(0);clip-path:inset(0 0 -15% 0)} }
@keyframes friends-arrive { from {opacity:0;transform:translateY(22px) rotate(5deg) scale(.92)} to {opacity:1;transform:translateY(0) rotate(0) scale(1)} }
@keyframes yellow-float { 0%,100% {transform:translateY(0) rotate(0)} 35% {transform:translateY(-7px) rotate(-4deg)} 70% {transform:translateY(3px) rotate(3deg)} }
@keyframes blue-float { 0%,100% {transform:translateY(0) rotate(0)} 50% {transform:translateY(-5px) rotate(2deg)} }
@keyframes pink-float { 0%,100% {translate:0 0;rotate:0deg} 50% {translate:2px -9px;rotate:4deg} }
@keyframes connect-arrive { from {stroke-dashoffset:420;opacity:0} to {stroke-dashoffset:0;opacity:1} }
@keyframes check-draw { from {stroke-dashoffset:18} to {stroke-dashoffset:0} }
@keyframes error-arrive { 0% {transform:translateX(-8px);opacity:0} 45% {transform:translateX(5px)} 75% {transform:translateX(-2px)} 100% {transform:translateX(0);opacity:1} }
@keyframes toast-spring { from {opacity:0;transform:translateY(18px) scale(.96)} to {opacity:1;transform:translateY(0) scale(1)} }
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
:root[data-motion="off"] { scroll-behavior:auto; }
.motion-suspended *, .motion-suspended *::before, .motion-suspended *::after { animation-play-state:paused!important; }
@media (min-width:1780px) { main { margin-left:auto; margin-right:auto; } }
@media (max-width:1250px) {
  .top { padding:18px 26px; gap:20px; }.brand {font-size:21px;}.brand-mark {width:77px;}.tabs {gap:22px;}.tab {font-size:13px;}.header-actions {gap:12px;}
  .hero {padding:26px 30px 32px;}.hero-friends {width:29%;} h1 {font-size:6.45vw;}
  .panel-head {padding:12px 16px;}.panel-label {font-size:17px;}.language-tab {padding:9px;min-width:34px;}.language-tabs {gap:4px;overflow-x:auto;scrollbar-width:none;}.language-tabs::-webkit-scrollbar {display:none;}
  .editor-toolbar {padding:22px 16px;gap:12px;}.local-note {font-size:11px;} #build {font-size:15px;padding:15px 20px;min-height:54px;}
  .gutter,#code,#codeHighlight {font-size:14px;}.code-options {padding:8px 16px;}.diagram-dock {padding:10px 14px;gap:6px;}
  .legend-body {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:1000px) {
  .brand {font-size:20px;gap:8px;}.brand-mark {width:64px;}.tabs {gap:18px;}.tab[data-tab="figures"] {display:none;}.header-actions {gap:8px;}.github-link {font-size:13px;}
  main {margin:0 20px;grid-template-columns:minmax(0,1fr) 7px minmax(0,1fr);}.code-head {flex-wrap:wrap;gap:12px;}.language-tabs {flex:1;justify-content:flex-end;}.language-tab {min-width:32px;font-size:11px;padding:8px;}
  .editor-toolbar {align-items:flex-start;flex-direction:column-reverse;}.local-note {margin-left:3px;}.ex-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .diagram-dock>.tool-group {justify-content:flex-end;}.diagram-dock {gap:6px;} .diagram-dock .btn-ghost {padding:7px;}
}
@media (max-width:720px) {
  .top {padding:16px 18px;flex-wrap:wrap;gap:12px;}.brand {font-size:20px;}.brand-mark {width:66px;}.header-actions {margin-left:auto;gap:12px;}.tabs {order:3;width:100%;justify-content:space-between;gap:12px;}.tab {font-size:13px;padding:10px 0;}.tab[data-tab="figures"] {display:block;}
  .hero {padding:22px 20px 28px;gap:0;}.hero-copy {width:100%;}h1 {font-size:clamp(35px,8.9vw,64px);letter-spacing:-.065em;}.hero p {font-size:13px;letter-spacing:-.02em;max-width:240px;line-height:1.5;margin-top:18px;}.hero-friends {width:115px;position:absolute;right:18px;bottom:18px;opacity:1;}
  main {margin:0 12px;display:flex;flex-direction:column;height:auto;min-height:0;border-radius:12px;}.vsplit {display:none;}.panel.editor {min-height:370px;}.code-head {flex-wrap:nowrap;}.panel-head {padding:12px 14px;min-height:58px;}.panel-label {font-size:16px;}.language-tabs {gap:4px;}.language-tab {padding:8px 7px;min-width:29px;}
  .gutter {flex-basis:42px;padding-right:10px;}.gutter,#code,#codeHighlight {font-size:13px;}.editor-wrap {min-height:200px;}#code,#codeHighlight {padding-left:14px;}.editor-toolbar {padding:16px;flex-direction:row-reverse;align-items:center;}#build {font-size:14px;min-height:48px;padding:12px 18px;border-radius:18px;}.local-note {max-width:104px;font-size:10px;}
  .diagram {border-top:1px solid var(--line-strong);}.sheet-scroll {height:480px;flex:none;padding:20px;}.diagram-dock {justify-content:flex-start;}.diagram-dock>.tool-group {margin-left:auto;}.btn-ghost {padding:7px 9px;}.code-options {min-height:32px;}
  footer {padding:20px;font-size:9px;gap:10px;}footer i {padding:0 2px;}.page-wrap {padding:24px 18px 40px;}.page-wrap h2 {font-size:25px;}.page-wrap .about-heading {font-size:33px;}.about-intro {font-size:16px;}.ex-grid,.legend-body {grid-template-columns:1fr;}.qa summary {padding:16px;font-size:14px;}.qa-body {padding:0 16px 18px;font-size:13px;}
}
@media (max-width:360px) { .language-tab {padding:7px 5px;min-width:26px;}.panel-label {font-size:14px;}.local-note {display:none;}.hero-friends {width:90px;}.hero p {max-width:210px;}.diagram-dock {gap:5px;}.diagram-dock .btn-ghost {font-size:11px;} }
@media (prefers-reduced-motion:reduce) { html {scroll-behavior:auto;} *,*::before,*::after {animation:none!important;transition:none!important;} }
.sheet-scroll.grid-on { background-image:linear-gradient(var(--line) 1px,transparent 1px),linear-gradient(90deg,var(--line) 1px,transparent 1px); background-size:24px 24px; }

/* Accounts, subscriptions and billing */
.billing-ribbon { height:27px; overflow:hidden; background:var(--accent); color:#fff; font:700 10px/27px var(--font-mono); letter-spacing:.12em; white-space:nowrap; }
.billing-ribbon-track { display:flex; width:max-content; will-change:transform; animation:ribbon-scroll 72s linear infinite; }
.billing-ribbon-group { display:flex; flex:none; }
.billing-ribbon-group span { flex:none; padding-right:54px; }
@keyframes ribbon-scroll { from { transform:translate3d(0,0,0); } to { transform:translate3d(-50%,0,0); } }
.account-button { display:flex; align-items:center; gap:8px; min-height:34px; padding:7px 12px; border:1px solid var(--line-strong); border-radius:10px; background:var(--panel); color:var(--ink); font-weight:650; }
.account-button:hover { border-color:var(--accent); background:var(--panel-2); }
.account-dot { width:8px; height:8px; border-radius:50%; background:var(--ink-mute); box-shadow:0 0 0 4px color-mix(in srgb,var(--ink-mute) 15%,transparent); }
.account-button.signed-in .account-dot { background:var(--ok); box-shadow:0 0 0 4px color-mix(in srgb,var(--ok) 15%,transparent); }
.usage-pill { width:max-content; margin-top:16px; padding:7px 11px; border:1px solid var(--line-strong); border-radius:999px; color:var(--ink-soft); background:var(--panel); font:11px var(--font-mono); }
.pricing-wrap { max-width:1040px; }
.pricing-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:stretch; }
.price-card { position:relative; display:flex; flex-direction:column; min-height:440px; padding:34px; border:1px solid var(--line-strong); border-radius:24px; background:var(--panel); overflow:hidden; }
.price-card.featured { border-color:var(--accent); box-shadow:0 24px 80px #0672ff18; }
.price-card.featured::before { content:''; position:absolute; width:210px; height:210px; right:-80px; top:-95px; border-radius:50%; background:var(--accent); filter:blur(2px); opacity:.16; }
.price-eyebrow { color:var(--accent); font:700 10px var(--font-mono); letter-spacing:.14em; }
.price-card h3 { margin:16px 0 22px; font-size:29px; }
.price { display:flex; align-items:baseline; gap:8px; margin-bottom:26px; }
.price strong { font-size:48px; letter-spacing:-.06em; }
.price span { color:var(--ink-soft); }
.price-card ul { flex:1; margin:0 0 30px; padding:0; list-style:none; }
.price-card li { position:relative; padding:9px 0 9px 25px; color:var(--ink-soft); }
.price-card li::before { content:'✓'; position:absolute; left:0; color:var(--ok); font-weight:800; }
.price-button,.invite-strip button,.telegram-login,.invite-form button,.admin-create button { display:flex; justify-content:center; align-items:center; min-height:48px; padding:12px 18px; border:0; border-radius:14px; background:var(--accent); color:#fff; font-weight:750; text-decoration:none; }
.price-button.secondary { background:var(--panel-2); color:var(--ink); border:1px solid var(--line-strong); }
.price-badge { position:absolute; right:22px; top:22px; padding:6px 9px; border-radius:999px; background:#ffda47; color:#111; font:800 9px var(--font-mono); letter-spacing:.08em; }
.invite-strip { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-top:20px; padding:24px 28px; border:1px solid var(--line); border-radius:18px; background:var(--panel); }
.invite-strip b,.invite-strip span { display:block; }.invite-strip span { margin-top:5px; color:var(--ink-soft); font-size:13px; }
dialog { color:var(--ink); background:var(--panel); border:1px solid var(--line-strong); box-shadow:0 35px 120px #0009; }
dialog::backdrop { background:#05070acc; backdrop-filter:blur(8px); }
.account-dialog { width:min(520px,calc(100vw - 28px)); padding:34px; border-radius:24px; }
.account-dialog h2,.admin-dialog h2 { margin:8px 0 14px; font-size:28px; }.account-dialog p { color:var(--ink-soft); line-height:1.6; }
.dialog-close { position:absolute; top:16px; right:16px; width:36px; height:36px; border:0; border-radius:50%; background:var(--panel-2); color:var(--ink); font-size:24px; }
.telegram-login { margin-top:24px; background:#229ed9; }.telegram-login span { font-size:18px; }
.auth-note { min-height:20px; margin:12px 0 0; font-size:12px; text-align:center; }
.profile-row { display:flex; align-items:center; gap:16px; }.profile-row h2 { margin:3px 0; }.profile-row p { margin:0; }
.profile-avatar { display:grid; place-items:center; width:58px; height:58px; border-radius:18px; background:linear-gradient(135deg,var(--accent),#59a5ff); color:white; font-size:23px; font-weight:800; overflow:hidden; }
.profile-avatar img { width:100%; height:100%; object-fit:cover; }
.account-stats { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:25px 0; }
.account-stats>div { padding:17px; border-radius:14px; background:var(--panel-2); }.account-stats span,.account-stats strong { display:block; }.account-stats span { margin-bottom:7px; color:var(--ink-soft); font-size:11px; }.account-stats strong { font-size:15px; }
.invite-form label { display:block; margin-bottom:8px; color:var(--ink-soft); font-size:12px; }.invite-form>div { display:flex; gap:8px; }
.invite-form input,.admin-create input,.admin-create select { min-width:0; flex:1; padding:12px; border:1px solid var(--line-strong); border-radius:10px; background:var(--panel-2); color:var(--ink); }
.invite-form button { min-height:42px; padding:9px 14px; }
.account-actions { display:flex; justify-content:space-between; gap:10px; margin-top:22px; }.account-actions button { padding:9px 12px; border:1px solid var(--line-strong); border-radius:9px; background:transparent; color:var(--ink); }
.admin-dialog { width:min(1100px,calc(100vw - 30px)); max-height:86vh; padding:32px; border-radius:22px; overflow:auto; }
.admin-create { display:grid; grid-template-columns:2fr 1fr 1fr 1fr auto; gap:8px; margin:22px 0; }.admin-create button { min-height:42px; padding:9px 14px; }
.admin-dialog h3 { margin:28px 0 12px; }.admin-table-wrap { overflow:auto; border:1px solid var(--line); border-radius:12px; }.admin-table-wrap table { width:100%; border-collapse:collapse; font-size:12px; }.admin-table-wrap th,.admin-table-wrap td { padding:12px; text-align:left; border-bottom:1px solid var(--line); white-space:nowrap; }.admin-table-wrap th { color:var(--ink-soft); font-weight:600; }.admin-table-wrap button { margin-right:5px; padding:6px 8px; border:1px solid var(--line-strong); border-radius:7px; background:var(--panel-2); color:var(--ink); }
.created-code { padding:16px; border:1px solid var(--ok); border-radius:12px; background:color-mix(in srgb,var(--ok) 9%,var(--panel)); font:700 15px var(--font-mono); word-break:break-all; }
.import-dialog { width:min(500px,calc(100vw - 28px)); padding:32px; border-radius:22px; }.import-dialog h2 { margin:8px 0 12px; font-size:27px; }.import-dialog p { color:var(--ink-soft); }.import-dialog small { display:block; margin-top:14px; color:var(--ink-mute); line-height:1.5; }
.ocr-progress { height:8px; margin-top:22px; overflow:hidden; border-radius:999px; background:var(--panel-2); }.ocr-progress i { display:block; width:2%; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--accent),#63aaff); transition:width .25s ease; }.ocr-progress i.failed { background:var(--danger); }
@media (max-width:720px) {
  .billing-ribbon { height:23px; line-height:23px; }.github-link span { display:none; }.account-button { padding:6px 9px; }.account-button span:last-child { max-width:74px; overflow:hidden; text-overflow:ellipsis; }
  footer { align-items:center; flex-direction:column; text-align:center; }
  .pricing-grid { grid-template-columns:1fr; }.price-card { min-height:0; padding:25px; }.invite-strip { align-items:flex-start; flex-direction:column; }
  .account-dialog { padding:27px 20px; }.account-stats { grid-template-columns:1fr; }.invite-form>div { flex-direction:column; }
  .editor-meta { gap:8px; }.import-button { padding:7px 9px; font-size:11px; }
  .admin-create { grid-template-columns:1fr 1fr; }.admin-create input:first-child { grid-column:1/-1; }.admin-create button { grid-column:1/-1; }
}
