html, body { margin: 0; padding: 0; min-width: 320px; background: #f5f6f8; color: #20242c; }
.risovalka_page .sr-only { position: absolute!important; width: 1px!important; height: 1px!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; }
.risovalka_page .portal_nav_group > a.active { background: #fff0f4; color: #ff2856!important; }
.draw-breadcrumbs { display: flex; align-items: center; gap: 10px; max-width: 1480px; margin: 8px auto 0; padding: 10px 26px; color: #89929f; font-size: 13px; }
.draw-breadcrumbs a { color: #687180; text-decoration: none; }
.draw-breadcrumbs a:hover { color: #ff2856; }
.draw-breadcrumbs svg { display: block; width: 16px; height: 16px; fill: currentColor; }
.draw-main { padding: 8px 24px 48px; background: linear-gradient(180deg,#fff,#f8f9fb); }
.draw-intro { max-width: 840px; margin: 8px auto 24px; text-align: center; }
.draw-intro h1 { margin: 0; color: #20242c; font-size: clamp(32px,4vw,48px); font-weight: 800; line-height: 1.15; letter-spacing: -.045em; }
.draw-intro p { max-width: 730px; margin: 12px auto 0; color: #687180; font-size: 15px; line-height: 1.6; }
.draw-editor { max-width: 1380px; margin: 0 auto; overflow: hidden; border: 1px solid #dfe4ec; border-radius: 24px; background: #fff; box-shadow: 0 20px 65px rgba(31,40,55,.08); }
.draw-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 15px 20px; border-bottom: 1px solid #e4e8ee; }
.draw-toolbar-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-weight: 800; }
.draw-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff2856; }
.draw-dimensions { margin-left: 5px; color: #7b8491; font-size: 12px; font-weight: 500; }
.draw-export-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.draw-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 10px 14px; border: 1px solid #dfe4ec; border-radius: 12px; background: #fff; color: #353b45; font-size: 12px; font-weight: 800; line-height: 1.4; cursor: pointer; transition: background .15s, border-color .15s; }
.draw-button svg, .draw-tool svg { width: 18px; height: 18px; flex-shrink: 0; }
.draw-button:hover:not(:disabled) { border-color: #ff9fb3; background: #fff3f6; color: #df1743; }
.draw-button-primary { border-color: #ff2856; background: #ff2856; color: #fff; }
.draw-button-primary:hover:not(:disabled) { border-color: #e71946; background: #e71946; color: #fff; }
.draw-button:disabled, .draw-tool:disabled, .draw-swatch:disabled, .draw-sidebar input:disabled { opacity: .45; cursor: not-allowed; }
.draw-format { padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,.2); font-size: 10px; }
.draw-workspace { display: grid; grid-template-columns: 224px minmax(0,1fr); }
.draw-sidebar { display: flex; flex-direction: column; gap: 19px; padding: 22px 18px; border-right: 1px solid #e4e8ee; }
.draw-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.draw-group legend, .draw-label { display: flex; justify-content: space-between; align-items: center; width: 100%; margin: 0 0 10px; padding: 0; color: #4b5461; font-size: 12px; font-weight: 800; }
.draw-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.draw-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 10px 3px; border: 1px solid #e1e6ed; border-radius: 12px; background: #fff; color: #687180; font-size: 11px; font-weight: 700; cursor: pointer; }
.draw-tool.active { border-color: #ffb1c1; background: #fff0f4; color: #e71946; }
.draw-tool:hover:not(:disabled) { border-color: #ffb1c1; }
.draw-label output { min-width: 43px; padding: 2px 7px; border-radius: 6px; background: #f4f6f9; color: #687180; font-size: 11px; text-align: center; }
.draw-sidebar input[type="range"] { display: block; width: 100%; height: 18px; margin: 0; accent-color: #ff2856; cursor: pointer; }
.draw-palette { display: grid; grid-template-columns: repeat(8,1fr); gap: 7px; }
.draw-swatch { width: 100%; aspect-ratio: 1; min-width: 0; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px #e0e5ec; cursor: pointer; }
.draw-swatch.active { box-shadow: 0 0 0 2px #ff2856; }
.draw-custom-color { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; padding: 6px 9px; border: 1px solid #e4e8ee; border-radius: 10px; color: #687180; font-size: 12px; }
.draw-custom-color input { width: 29px; height: 29px; padding: 2px; border: 0; border-radius: 7px; background: #f4f6f9; cursor: pointer; }
.draw-playback-group { padding-top: 16px; border-top: 1px solid #e4e8ee; }
.draw-play { width: 100%; margin-top: 12px; }
.draw-clear { width: 100%; margin-top: auto; color: #687180; background: #f8f9fb; }
.draw-stage { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 28px; background-color: #f2f4f7; background-image: radial-gradient(#dce1e8 .7px,transparent .7px); background-size: 12px 12px; }
.draw-paper { position: relative; width: 100%; max-width: 1080px; aspect-ratio: 3 / 2; background: #fff; box-shadow: 0 5px 22px rgba(31,40,55,.1); }
#drawCanvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; user-select: none; }
#drawCanvas.is-busy { cursor: progress; }
.draw-canvas-hint { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; flex-direction: column; gap: 8px; color: #929aa5; font-size: 12px; text-align: center; pointer-events: none; padding: 15px; }
.draw-canvas-hint > span:first-child { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 15px; background: #f7f8fa; color: #bdc4ce; }
.draw-canvas-hint svg { width: 25px; height: 25px; }
.draw-canvas-hint b { color: #7b8491; font-size: 16px; font-weight: 700; }
.draw-statusbar { display: flex; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid #e4e8ee; color: #687180; font-size: 11px; }
.draw-status-note { color: #929aa5; text-align: right; }
.draw-progress { display: flex; align-items: center; gap: 15px; padding: 12px 20px; border-top: 1px solid #e4e8ee; background: #fff8fa; }
.draw-progress label { flex-shrink: 0; font-size: 12px; font-weight: 700; }
.draw-progress progress { width: 100%; height: 8px; accent-color: #ff2856; }
.draw-help { max-width: 950px; margin: 23px auto 0; color: #7b8491; font-size: 12px; line-height: 1.65; text-align: center; }
.draw-help p { margin: 7px 0; }
.draw-help strong { color: #687180; font-weight: 700; }
.draw-noscript { padding: 20px; text-align: center; color: #c23745; }
.draw-dialog { width: min(440px,calc(100% - 32px)); padding: 26px; border: 1px solid #dfe4ec; border-radius: 22px; background: #fff; color: #20242c; box-shadow: 0 24px 70px rgba(31,40,55,.18); }
.draw-dialog::backdrop { background: rgba(31,40,55,.35); }
.draw-dialog h2 { margin: 0 0 12px; font-size: 24px; letter-spacing: -.03em; }
.draw-dialog p { margin: 0; color: #687180; font-size: 14px; line-height: 1.6; }
.draw-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.risovalka_page [hidden] { display: none!important; }
.draw-editor :focus-visible { outline: 3px solid #ff8aa4; outline-offset: 3px; }
@media(min-width: 851px) { .draw-palette { grid-template-columns: repeat(4,1fr); gap: 9px; } .draw-swatch { width: 28px; height: 28px; justify-self: center; } }
@media(max-width: 1050px) { .draw-dimensions { display: none; } .draw-stage { padding: 22px; } }
@media(max-width: 850px) {
  .draw-workspace { grid-template-columns: 1fr; }
  .draw-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; padding: 18px; border-right: 0; border-bottom: 1px solid #e4e8ee; }
  .draw-sidebar .draw-group:nth-child(2) { grid-column: 2; grid-row: 1; }
  .draw-playback-group { padding-top: 0; border: 0; }
  .draw-clear { grid-column: 1 / -1; justify-self: end; width: auto; min-height: 36px; padding: 7px 12px; margin-top: -5px; }
  .draw-palette { grid-template-columns: repeat(8,1fr); }
  .draw-custom-color { margin-top: 12px; }
  .draw-stage { padding: 22px; }
  .draw-toolbar-title { width: 100%; }
  .draw-dimensions { display: inline; margin-left: auto; }
  .draw-toolbar { gap: 12px; }
  .draw-export-actions { width: 100%; }
  .draw-export-actions .draw-button { flex: 1; }
  .draw-status-note { display: none; }
}
@media(max-width: 520px) {
  .draw-breadcrumbs { padding: 9px 16px; font-size: 11px; gap: 8px; }
  .draw-main { padding: 7px 12px 30px; }
  .draw-intro { margin: 8px auto 20px; }
  .draw-intro p { font-size: 13px; }
  .draw-editor { border-radius: 18px; }
  .draw-toolbar { padding: 14px; }
  .draw-export-actions { gap: 7px; }
  .draw-export-actions .draw-button { padding: 10px 8px; font-size: 11px; }
  .draw-export-actions .draw-format { display: none; }
  .draw-sidebar { gap: 17px 14px; padding: 15px; }
  .draw-palette { grid-template-columns: repeat(4,1fr); gap: 9px; }
  .draw-swatch { width: 24px; height: 24px; justify-self: center; }
  .draw-stage { padding: 13px; }
  .draw-canvas-hint b { font-size: 14px; }
  .draw-canvas-hint { font-size: 10px; gap: 5px; }
  .draw-statusbar { padding: 12px 14px; }
  .draw-progress { flex-wrap: wrap; padding: 12px 14px; }
  .draw-progress progress { order: 3; }
  .draw-progress .draw-button { margin-left: auto; }
}
