﻿/* ==========================================================================
   SilverTests — Python.aspx (отладчик Python), v3, 21.10.2026
   ========================================================================== */
.pyd-page {
    --pyd-bg: #f3f5f8;
    --pyd-card: #ffffff;
    --pyd-line: #e2e6ec;
    --pyd-ink: #1f2a37;
    --pyd-muted: #6b7686;
    --pyd-head: #2c3e50;
    --pyd-accent: #2f80ed;
    --pyd-green: #23a55a;
    --pyd-red: #d64545;
    --pyd-amber: #e3a008;
    --pyd-radius: 10px;
    --pyd-mono: Consolas, 'JetBrains Mono', Menlo, Monaco, 'Courier New', monospace;
    background: var(--pyd-bg);
    color: var(--pyd-ink);
    padding: 12px 14px 0;
}

/* hidden должен побеждать display:flex/grid из этого файла */
.pyd-page [hidden], .pyd-modal[hidden], .pyd-modal [hidden], .pyd-file-editor[hidden], .pyd-file-editor [hidden] { display: none !important; }

/* Сайт рассчитан на ширину от 1080 px (main.css: body{min-width:1080px}, .container{min-width:1200px}).
   Этот файл подключается только на Python.aspx, поэтому снимаем ограничение здесь. */
body { min-width: 0 !important; }
@media (max-width: 1199px) { .container { min-width: 0 !important; } }

/* main.css задаёт section { margin: 2em 0 } — здесь секции — карточки */
.pyd-page section { margin: 0; }

/* ---------- шапка страницы ---------- */
.pyd-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.pyd-head h1 {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--pyd-ink);
    line-height: 1.25;
}
.pyd-sub { margin: 0; color: var(--pyd-muted); font-size: .95rem; }
.pyd-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pyd-hbtn {
    border: 1px solid var(--pyd-line);
    background: var(--pyd-card);
    color: var(--pyd-ink);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.2;
}
.pyd-hbtn:hover { border-color: #c4ccd8; background: #f8fafc; }
.pyd-menu { position: relative; }
.pyd-menu-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 1050;
    background: var(--pyd-card);
    border: 1px solid var(--pyd-line);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
    padding: 6px;
    width: 290px;
    max-height: 70vh;
    overflow-y: auto;
}
.pyd-menu-group {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--pyd-muted);
    padding: 8px 10px 4px;
    font-weight: 700;
}
.pyd-menu-item {
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--pyd-ink);
    text-decoration: none;
    font-size: .93rem;
}
.pyd-menu-item:hover { background: #eef3fb; color: var(--pyd-ink); text-decoration: none; }
.pyd-menu-sep { height: 1px; background: var(--pyd-line); margin: 6px 4px; }

.pyd-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #eaf3ff;
    border: 1px solid #c9defa;
    color: #1d3d6b;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: .93rem;
}
.pyd-notice-text { flex: 1 1 260px; }
.pyd-notice-x {
    border: 0;
    background: transparent;
    font-size: 1.3rem;
    line-height: 1;
    color: #5a6b85;
    cursor: pointer;
    padding: 0 4px;
}

/* ---------- раскладка ---------- */
.pyd-layout { display: flex; gap: 12px; align-items: flex-start; }
.pyd-app { flex: 1 1 auto; min-width: 0; --pyd-font: 15px; }
.pyd-ad {
    flex: 0 0 260px;
    background: var(--pyd-card);
    border-radius: var(--pyd-radius);
    padding: 16px 10px;
    border: 1px solid var(--pyd-line);
}
@media (max-width: 1100px) { .pyd-ad { display: none; } }

.pyd-card {
    background: var(--pyd-card);
    border: 1px solid var(--pyd-line);
    border-radius: var(--pyd-radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    min-width: 0;
}
.pyd-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--pyd-head);
    color: #fff;
    font-weight: 600;
    font-size: .92rem;
    border-radius: var(--pyd-radius) var(--pyd-radius) 0 0;
    min-height: 40px;
}
.pyd-card-head button, .pyd-card-head select {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: .8rem;
    cursor: pointer;
    font-family: inherit;
}
.pyd-card-head select option { color: var(--pyd-ink); background: #fff; }
.pyd-card-head button:hover { background: rgba(255, 255, 255, .22); }
.pyd-head-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pyd-file { font-family: var(--pyd-mono); font-weight: 600; letter-spacing: .02em; }

.pyd-work { display: flex; flex-direction: column; gap: 12px; }
.pyd-editor-card, .pyd-state-card { display: flex; flex-direction: column; min-height: 0; }
.pyd-editor { flex: 1 1 auto; min-height: 0; position: relative; }
.pyd-editor .CodeMirror {
    height: 100% !important;
    font-family: var(--pyd-mono);
    font-size: var(--pyd-font);
    line-height: 1.5;
    border: 0;            /* main.css: .CodeMirror { border: solid 1px; border-radius: 5px } */
    border-radius: 0;
}
.pyd-editor textarea.pyd-plain {
    display: block !important;
    width: 100%;
    height: 100%;
    border: 0;
    resize: none;
    padding: 10px;
    font-family: var(--pyd-mono);
    font-size: var(--pyd-font);
    background: #272822;
    color: #f8f8f2;
}

.pyd-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 12px;
    background: var(--pyd-head);
    color: #dbe3ee;
    font-size: .8rem;
    border-radius: 0 0 var(--pyd-radius) var(--pyd-radius);
}
.pyd-status #pydStatus { flex: 1 1 auto; min-width: 0; }
.pyd-dot { width: 9px; height: 9px; border-radius: 50%; background: #8492a6; flex: 0 0 9px; }
.pyd-dot.is-loading { background: var(--pyd-amber); animation: pyd-pulse 1s infinite; }
.pyd-dot.is-running { background: var(--pyd-green); animation: pyd-pulse .8s infinite; }
.pyd-dot.is-paused { background: #4aa8ff; }
.pyd-dot.is-ok { background: var(--pyd-green); }
.pyd-dot.is-error { background: var(--pyd-red); }
@keyframes pyd-pulse { 50% { opacity: .35; } }
.pyd-legend { display: none; gap: 6px; align-items: center; color: #b9c4d3; }
.pyd-app.is-step .pyd-legend { display: inline-flex; }
.pyd-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.pyd-legend .lg-prev { background: rgba(80, 200, 120, .55); }
.pyd-legend .lg-next { background: rgba(80, 160, 255, .75); }

/* ---------- подсветка строк в редакторе ---------- */
.pyd-editor-card {
    --hl-next: rgba(80, 160, 255, .20);
    --hl-next-bar: #4aa8ff;
    --hl-prev: rgba(80, 200, 120, .13);
    --hl-prev-bar: #4ac47a;
    --hl-err: rgba(231, 76, 60, .22);
    --hl-err-bar: #ff6b5b;
    --hl-active: rgba(255, 255, 255, .05);
}
.pyd-editor-card.pyd-light {
    --hl-next: rgba(47, 128, 237, .16);
    --hl-next-bar: #2f80ed;
    --hl-prev: rgba(35, 165, 90, .12);
    --hl-prev-bar: #23a55a;
    --hl-err: rgba(214, 69, 69, .14);
    --hl-err-bar: #c0392b;
    --hl-active: rgba(0, 0, 0, .04);
}
.pyd-editor .CodeMirror .pyd-ln-next { background: var(--hl-next) !important; box-shadow: inset 3px 0 0 var(--hl-next-bar); }
.pyd-editor .CodeMirror .pyd-ln-prev { background: var(--hl-prev) !important; box-shadow: inset 3px 0 0 var(--hl-prev-bar); }
.pyd-editor .CodeMirror .pyd-ln-err { background: var(--hl-err) !important; box-shadow: inset 3px 0 0 var(--hl-err-bar); }
.pyd-editor .CodeMirror .CodeMirror-activeline-background { background: var(--hl-active); }
.pyd-editor .CodeMirror-gutter.pyd-bp { width: 16px; cursor: pointer; }
.pyd-editor .CodeMirror-gutter.pyd-arrow { width: 16px; }
.pyd-bp-marker { color: #e74c3c; font-size: 14px; line-height: inherit; text-align: center; cursor: pointer; }
.pyd-arrow-marker { font-size: 13px; font-weight: 700; text-align: center; line-height: inherit; }
.pyd-arrow-marker.is-next { color: #4aa8ff; }
.pyd-arrow-marker.is-ret { color: #4ac47a; }
.pyd-arrow-marker.is-err { color: #ff6b5b; }
.pyd-light .pyd-arrow-marker.is-next { color: #2f80ed; }
.pyd-light .pyd-arrow-marker.is-ret { color: #23a55a; }

/* ---------- панель переменных ---------- */
.pyd-step-ind {
    background: rgba(255, 255, 255, .14);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: .78rem;
    font-weight: 600;
}
.pyd-step-ind:empty { display: none; }
.pyd-banner {
    margin: 8px 10px 0;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: .88rem;
    background: #eef3fb;
    color: #23406b;
}
.pyd-banner.is-end { background: #e8f7ee; color: #17663a; }
.pyd-banner.is-err { background: #fdecec; color: #8f2424; }
.pyd-frames {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    font-size: calc(var(--pyd-font) - 1px);
}
.pyd-frame {
    border: 1px solid var(--pyd-line);
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fbfcfe;
}
.pyd-frame.is-top { border-color: #9cc3f5; box-shadow: 0 0 0 2px rgba(47, 128, 237, .12); background: #fff; }
.pyd-frame.is-gap { background: transparent; border-style: dashed; }
.pyd-frame-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    font-weight: 700;
    font-size: .82rem;
    color: #3b4757;
    border-bottom: 1px solid var(--pyd-line);
    font-family: var(--pyd-mono);
}
.pyd-frame.is-global .pyd-frame-head { font-family: inherit; text-transform: none; }
.pyd-frame.is-gap .pyd-frame-head { border-bottom: 0; color: var(--pyd-muted); font-weight: 600; }
.pyd-frame-line { font-weight: 500; color: var(--pyd-muted); font-family: inherit; font-size: .75rem; }
.pyd-novars { padding: 6px 10px; color: var(--pyd-muted); font-style: italic; font-size: .85rem; }
.pyd-var { padding: 6px 10px; border-top: 1px solid #eef1f5; }
.pyd-var:first-of-type { border-top: 0; }
.pyd-var.is-changed { animation: pyd-flash 1.1s ease-out; background: #fff8e1; }
.pyd-var.is-new { animation: pyd-flash-new 1.1s ease-out; }
.pyd-var.is-def .pyd-var-name { color: var(--pyd-muted); }
@keyframes pyd-flash { 0% { background: #ffe58a; } 100% { background: #fff8e1; } }
@keyframes pyd-flash-new { 0% { background: #d6f5e1; } 100% { background: transparent; } }
.pyd-var-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pyd-var.is-inline { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.pyd-var.is-inline .pyd-var-val { margin-top: 0; }
.pyd-var-name { font-family: var(--pyd-mono); font-weight: 700; color: #1f3b63; }
.pyd-var-type { font-size: .72rem; color: var(--pyd-muted); }
.pyd-alias {
    font-size: .72rem;
    color: #7a4bd6;
    background: #f3edff;
    border-radius: 999px;
    padding: 0 8px;
    cursor: help;
}
.pyd-var-val { margin-top: 2px; min-width: 0; }
.pyd-val {
    font-family: var(--pyd-mono);
    color: #b35c00;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.pyd-val.pyd-t-str { color: #18794e; }
.pyd-val.pyd-t-bool, .pyd-val.pyd-t-NoneType { color: #7a4bd6; }
.pyd-muted { color: var(--pyd-muted); }
.pyd-cells { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.pyd-cell {
    min-width: 34px;
    max-width: 140px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pyd-cells.is-set .pyd-cell { border-radius: 999px; padding: 0 4px; }
.pyd-cells.is-tuple .pyd-cell { border-style: dashed; }
.pyd-cell-v {
    font-family: var(--pyd-mono);
    padding: 3px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1f2a37;
}
.pyd-cell-i { font-size: .68rem; color: var(--pyd-muted); background: #f2f5f9; border-top: 1px solid #e3e9f0; }
.pyd-cell.is-changed { border-color: #f0a500; background: #fff4cc; animation: pyd-cell 1.1s ease-out; }
.pyd-cell.is-new { border-color: #23a55a; background: #e3f7ea; }
.pyd-cell.is-more { justify-content: center; color: var(--pyd-muted); font-size: .75rem; padding: 0 6px; border-style: dotted; }
@keyframes pyd-cell { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }
.pyd-cells-empty { color: var(--pyd-muted); font-style: italic; font-size: .85rem; }
.pyd-grid { border-collapse: collapse; margin-top: 3px; font-family: var(--pyd-mono); font-size: .85em; }
.pyd-grid th { color: var(--pyd-muted); font-weight: 500; font-size: .75em; padding: 0 5px; text-align: center; }
.pyd-grid td { border: 1px solid #cfd8e3; padding: 2px 7px; text-align: center; background: #fff; }
.pyd-grid td.is-changed { background: #fff4cc; border-color: #f0a500; }
.pyd-grid td.is-new { background: #e3f7ea; }
.pyd-pairs { border-collapse: collapse; margin-top: 3px; font-family: var(--pyd-mono); font-size: .9em; max-width: 100%; }
.pyd-pairs td { border: 1px solid #dfe5ed; padding: 2px 8px; vertical-align: top; overflow-wrap: anywhere; }
.pyd-pk { color: #1f3b63; background: #f4f7fb; }
.pyd-pv { color: #b35c00; }
.pyd-pairs tr.is-changed td { background: #fff4cc; }
.pyd-pairs tr.is-new td { background: #e3f7ea; }
.pyd-obj .pyd-muted { font-size: .85em; }
.pyd-more { color: var(--pyd-muted); font-size: .78rem; }
.pyd-banner-inline {
    margin: 6px 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: .88rem;
}
.pyd-banner-inline.is-ret { background: #e8f7ee; color: #17663a; }
.pyd-banner-inline.is-err { background: #fdecec; color: #8f2424; }
.pyd-banner-inline.is-end { background: #e8f7ee; color: #17663a; }
.pyd-empty { color: #8a96a8; text-align: center; padding: 26px 12px; font-style: italic; }
.pyd-empty-sm { padding: 12px; }

/* ---------- кнопки управления ---------- */
.pyd-controls {
    display: flex;
    align-items: center;
    gap: 8px 16px;
    flex-wrap: wrap;
    padding: 8px 10px;
    margin-top: 12px;
}
.pyd-ctl-main, .pyd-ctl-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pyd-ctl-nav { flex: 1 1 360px; }
.pyd-btn {
    border: 0;
    border-radius: 8px;
    padding: 9px 16px;
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
    transition: transform .12s, box-shadow .12s, background .12s;
}
.pyd-btn:disabled { opacity: .55; cursor: default; transform: none !important; box-shadow: none !important; }
.pyd-btn-run { background: var(--pyd-green); }
.pyd-btn-run:hover:not(:disabled) { background: #1d914e; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(35, 165, 90, .3); }
.pyd-btn-step { background: var(--pyd-accent); }
.pyd-btn-step:hover:not(:disabled) { background: #1f6fd8; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(47, 128, 237, .3); }
.pyd-btn-stop { background: var(--pyd-red); }
.pyd-btn-ghost { background: #eef1f5; color: #3b4757; }
.pyd-btn-ghost:hover { background: #e2e7ee; }
.pyd-ctl-nav button {
    border: 1px solid var(--pyd-line);
    background: #f6f8fb;
    color: #2c3e50;
    border-radius: 7px;
    min-width: 36px;
    height: 34px;
    padding: 0 9px;
    font-size: .95rem;
    cursor: pointer;
    white-space: nowrap;
}
.pyd-ctl-nav button:hover:not(:disabled) { background: #e9eef5; }
.pyd-ctl-nav button:disabled { opacity: .45; cursor: default; }
.pyd-ctl-nav button.is-on { background: var(--pyd-accent); color: #fff; border-color: var(--pyd-accent); }
.pyd-ctl-nav .pyd-nav-next:not(:disabled) { background: #e7f0fd; border-color: #b9d3f7; color: #1f5fbf; font-weight: 700; }
.pyd-ctl-nav select { height: 34px; border: 1px solid var(--pyd-line); border-radius: 7px; background: #fff; font-size: .85rem; padding: 0 4px; width: auto; max-width: 120px; }
.pyd-ctl-nav input[type=range] { flex: 1 1 100px; min-width: 90px; accent-color: var(--pyd-accent); }
.pyd-btn-icon { padding: 9px 12px; }
.pyd-ctl-nav:not(.is-active) { opacity: .6; }
.pyd-kbd-hint { font-size: .78rem; color: var(--pyd-muted); }

/* ---------- ввод / вывод ---------- */
.pyd-io { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.pyd-in-card, .pyd-out-card { display: flex; flex-direction: column; min-height: 0; }
.pyd-tabs {
    display: flex;
    gap: 2px;
    background: var(--pyd-head);
    padding: 6px 8px 0;
    border-radius: var(--pyd-radius) var(--pyd-radius) 0 0;
}
.pyd-tab {
    border: 0;
    background: transparent;
    color: #c9d3e0;
    font-weight: 600;
    font-size: .88rem;
    padding: 6px 12px 8px;
    border-radius: 7px 7px 0 0;
    cursor: pointer;
}
.pyd-tab.is-active { background: #fff; color: var(--pyd-ink); }
.pyd-tabpane { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 8px 10px; }
.pyd-tabpane[hidden] { display: none; }
.pyd-tabpane.is-drop { outline: 2px dashed var(--pyd-accent); outline-offset: -6px; background: #f2f7ff; }
#pydInput {
    flex: 1 1 auto;
    min-height: 60px;
    width: 100%;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    padding: 8px 10px;
    font-family: var(--pyd-mono);
    font-size: calc(var(--pyd-font) - 1px);
    line-height: 1.45;
    resize: none;
}
#pydInput:focus { outline: none; border-color: var(--pyd-accent); box-shadow: 0 0 0 2px rgba(47, 128, 237, .15); }
.pyd-hint { font-size: .78rem; color: var(--pyd-muted); margin-top: 5px; }
.pyd-files { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.pyd-file-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 5px 4px;
    border-bottom: 1px solid #eef1f5;
    font-size: .88rem;
}
.pyd-file-name { font-family: var(--pyd-mono); font-weight: 600; }
.pyd-file-badge { font-size: .7rem; background: #e3f7ea; color: #17663a; border-radius: 999px; padding: 0 7px; }
.pyd-file-meta { color: var(--pyd-muted); font-size: .78rem; flex: 1 1 auto; }
.pyd-file-acts button { border: 1px solid var(--pyd-line); background: #fff; border-radius: 5px; padding: 1px 7px; cursor: pointer; margin-left: 2px; }
.pyd-files-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.pyd-btn-sm {
    display: inline-block;
    border: 1px solid #cfd8e3;
    background: #fff;
    color: #24364d;
    border-radius: 7px;
    padding: 5px 11px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.3;
}
.pyd-btn-sm:hover { background: #f1f5fa; text-decoration: none; color: #24364d; }
.pyd-file-editor {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.pyd-file-editor[hidden] { display: none; }
.pyd-file-editor-box {
    background: #fff;
    border-radius: 12px;
    width: min(760px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 14px;
    gap: 8px;
}
.pyd-file-editor-box textarea { flex: 1 1 auto; min-height: 260px; font-family: var(--pyd-mono); font-size: 14px; border: 1px solid #d7dee8; border-radius: 6px; padding: 8px; }
.pyd-file-editor-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.pyd-out {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 8px 12px;
    background: #fbfcfe;
}
.pyd-out-pre {
    margin: 0;
    font-family: var(--pyd-mono);
    font-size: calc(var(--pyd-font) - 1px);
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #1f2a37;
    background: transparent;
    border: 0;
    padding: 0;
}
.pyd-out-new { background: #fff1b8; border-radius: 3px; box-shadow: 0 0 0 1px #f5d76e; }
.pyd-out-note { margin-top: 8px; font-size: .82rem; color: #17663a; background: #e8f7ee; border-radius: 6px; padding: 5px 8px; }
.pyd-error {
    border-top: 1px solid #f3c4c4;
    background: #fff5f5;
    padding: 9px 12px;
    font-size: .88rem;
    max-height: 60%;
    overflow-y: auto;
    border-radius: 0 0 var(--pyd-radius) var(--pyd-radius);
}
.pyd-err-title { color: #a12a2a; font-family: var(--pyd-mono); overflow-wrap: anywhere; }
.pyd-err-ru { font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; color: #b94a4a; }
.pyd-err-where { margin-top: 3px; color: #6b3a3a; font-size: .83rem; }
.pyd-err-line { color: #c0392b; font-weight: 700; text-decoration: underline dotted; }
.pyd-err-hint { margin-top: 6px; color: #3d2f12; background: #fff7dd; border-radius: 6px; padding: 6px 9px; }
.pyd-err-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pyd-ai-btn { border-color: #c9b8f5; color: #5a35b8; }
.pyd-ai-answer { margin-top: 8px; background: #fff; border: 1px solid #e3dcf7; border-radius: 8px; padding: 8px 10px; color: #2a2340; }
.pyd-ai-answer[hidden] { display: none; }
.pyd-ai-text p:last-child { margin-bottom: 0; }
.pyd-ai-text pre, .pyd-ai-text code { background: #f4f2fb; border-radius: 4px; padding: 1px 4px; }
.pyd-ai-left { font-size: .75rem; margin-top: 4px; }
.pyd-err-inline { color: #a12a2a; }

/* ---------- окно «Поделиться» ---------- */
.pyd-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.pyd-modal[hidden] { display: none; }
.pyd-modal-box {
    background: #fff;
    border-radius: 12px;
    width: min(560px, 100%);
    padding: 18px 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
}
.pyd-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pyd-modal-head h2 { font-size: 1.15rem; margin: 0; }
.pyd-modal-x { border: 0; background: transparent; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #6b7686; }
.pyd-share-row { display: flex; gap: 8px; }
.pyd-share-row input { flex: 1 1 auto; min-width: 0; border: 1px solid #cfd8e3; border-radius: 7px; padding: 8px 10px; font-family: var(--pyd-mono); font-size: .88rem; }
.pyd-share-opt { margin: 10px 0 0; font-size: .9rem; display: flex; gap: 6px; align-items: center; }
.pyd-share-note { font-size: .82rem; color: var(--pyd-muted); margin: 10px 0 0; }
.pyd-share-msg { color: #a12a2a; font-size: .88rem; margin-top: 6px; }

/* ---------- полноэкранный режим (урок на проекторе) ---------- */
.pyd-app:fullscreen { background: var(--pyd-bg); padding: 12px; overflow: auto; }
.pyd-app:fullscreen, .pyd-app.pyd-pseudo-fs { height: 100vh !important; max-height: none; }
.pyd-app.pyd-pseudo-fs { position: fixed; inset: 0; z-index: 3000; background: var(--pyd-bg); padding: 12px; overflow: auto; }

/* ---------- десктоп: весь инструмент в один экран ----------
   слева редактор и кнопки, справа переменные; внизу ввод и вывод */
@media (min-width: 992px) {
    .pyd-app {
        display: grid;
        grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
        grid-template-rows: minmax(0, 1fr) auto 190px;
        grid-template-areas: "editor state" "controls state" "input output";
        gap: 12px;
        /* --pyd-avail: высота до низа окна, считает js (fitHeight) */
        height: max(520px, min(var(--pyd-avail, calc(100vh - 200px)), 1100px));
    }
    .pyd-work, .pyd-io { display: contents; }
    .pyd-editor-card { grid-area: editor; }
    .pyd-state-card { grid-area: state; }
    .pyd-controls { grid-area: controls; margin-top: 0; }
    .pyd-in-card { grid-area: input; }
    .pyd-out-card { grid-area: output; }
}
@media (min-width: 992px) and (max-height: 820px) {
    .pyd-app { grid-template-rows: minmax(0, 1fr) auto 150px; }
    .pyd-head h1 { font-size: 1.3rem; }
    .pyd-head { margin-bottom: 8px; }
}

/* ---------- планшет и телефон ---------- */
@media (max-width: 991px) {
    .pyd-editor-card { height: 44vh; min-height: 280px; }
    .pyd-state-card { max-height: 60vh; min-height: 160px; }
    .pyd-in-card { height: 200px; }
    .pyd-out-card { min-height: 160px; max-height: 60vh; }
}
@media (max-width: 600px) {
    .pyd-page { padding: 8px 8px 0; }
    .pyd-head h1 { font-size: 1.2rem; }
    .pyd-sub { font-size: .87rem; }
    .pyd-head-actions { width: 100%; }
    .pyd-hbtn { flex: 1 1 auto; padding: 7px 8px; font-size: .86rem; }
    .pyd-menu { flex: 1 1 auto; display: flex; }
    .pyd-menu .pyd-hbtn { width: 100%; }
    .pyd-menu-pop { left: 0; right: auto; width: min(320px, calc(100vw - 32px)); }
    .pyd-controls { position: sticky; bottom: 0; z-index: 20; box-shadow: 0 -4px 14px rgba(15, 23, 42, .08); gap: 8px; padding: 8px; }
    .pyd-ctl-main { width: 100%; }
    .pyd-ctl-main .pyd-btn { flex: 1 1 auto; padding: 9px 8px; }
    .pyd-ctl-nav { flex-basis: 100%; }
    .pyd-ctl-nav button { min-width: 0; flex: 1 1 auto; padding: 0 6px; }
    .pyd-ctl-nav .pyd-btn-label { display: none; }
    .pyd-ctl-nav #pydPlay .pyd-btn-label { display: inline; }
    .pyd-ctl-nav input[type=range] { flex-basis: 100%; }
    .pyd-kbd-hint { display: none; }
    .pyd-editor-card { height: 46vh; }
    .pyd-head-tools #pydFullscreen { display: none; }
}

/* ---------- текст страницы (SEO) ---------- */
.pyd-seo { max-width: 1000px; margin: 28px auto 0; padding: 0 4px 40px; color: #20242b; font-size: 1rem; line-height: 1.6; }
.pyd-seo h2 { font-size: 1.45rem; margin: 30px 0 12px; color: #1f2a37; }
.pyd-seo h3 { font-size: 1.1rem; margin: 18px 0 8px; color: #1f2a37; }
.pyd-seo p { margin: 0 0 12px; }
.pyd-seo a { color: var(--pyd-accent); }
.pyd-seo-lead { font-size: 1.06rem; }
.pyd-seo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 14px 0; }
.pyd-seo-card { background: #fff; border: 1px solid var(--pyd-line); border-radius: 12px; padding: 14px 16px; }
.pyd-seo-card b { display: block; margin-bottom: 4px; color: #1f2a37; }
.pyd-seo ol, .pyd-seo ul { padding-left: 22px; margin: 6px 0 14px; }
.pyd-seo li { margin-bottom: 6px; }
.pyd-seo details { background: #fff; border: 1px solid var(--pyd-line); border-radius: 10px; margin: 8px 0; padding: 0 16px; }
.pyd-seo details summary { cursor: pointer; font-weight: 600; padding: 12px 0; color: #1f2a37; }
.pyd-seo details .pyd-ans { padding: 0 0 12px; }
.pyd-ex-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 16px; margin: 10px 0 16px; padding: 0; list-style: none; }
.pyd-ex-links li { margin: 0; }
.pyd-ex-group { font-weight: 700; color: var(--pyd-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin-top: 10px; }
.pyd-seo-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 4px; }
.pyd-seo-links a { background: #eef2fb; border: 1px solid #dbe4f7; border-radius: 8px; padding: 7px 13px; font-weight: 500; text-decoration: none; }
.pyd-seo-links a:hover { background: #e2eafb; }
.pyd-ex-intro { background: #fff; border: 1px solid var(--pyd-line); border-radius: 12px; padding: 16px 20px; }
.pyd-ex-intro h2 { margin-top: 4px; }
.pyd-ex-code { background: #272822; color: #f8f8f2; border-radius: 8px; padding: 12px 14px; font-family: var(--pyd-mono); font-size: .9rem; line-height: 1.45; overflow-x: auto; }
.pyd-ex-code code { background: transparent; color: inherit; padding: 0; }
