html.page--record_detail .main{--pw-paper:var(--ref-panel,#fff);--pw-line:var(--ref-line,#bfcbd7);--pw-accent:var(--ref-accent,#355dc1)}
/* Replace the upstream fixed em offset with a shared title/action row. */
:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .code-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"title actions" "code code";align-items:center;column-gap:12px;min-width:0}
:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .code-toolbar>h2{grid-area:title;margin:0 0 8px!important;min-width:0}
:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .code-toolbar>pre{grid-area:code;min-width:0;margin-top:0!important}
:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .code-toolbar>.toolbar{grid-area:actions;position:static!important;inset:auto!important;justify-self:end;display:flex;align-items:center;padding:0;margin:0 0 8px;opacity:1!important;background:none;line-height:1;white-space:nowrap}
:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .code-toolbar>.toolbar>.toolbar-item{display:block;padding:0;margin:0}
:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .code-toolbar>.toolbar>.scratchpad-fill-button{display:none!important}
:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .problem-copy-button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-width:var(--copy-width,82px);min-height:var(--copy-height,30px);box-sizing:border-box;margin:0;padding:var(--copy-padding,5px 9px);border:1px solid color-mix(in srgb,var(--pw-accent) 25%,var(--pw-line));border-radius:6px;background:color-mix(in srgb,var(--pw-accent) 8%,var(--pw-paper));color:var(--pw-accent);font:600 12px/18px "Segoe UI","Microsoft YaHei",sans-serif;text-decoration:none;box-shadow:0 1px 2px #253e5a08;cursor:pointer;user-select:none;transition:background-color .12s,border-color .12s}
:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .problem-copy-button svg{flex:none}
:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .problem-copy-button:hover{background:color-mix(in srgb,var(--pw-accent) 15%,var(--pw-paper));border-color:var(--pw-accent)}
:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .problem-copy-button:focus-visible{outline:2px solid var(--pw-accent);outline-offset:2px}
:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .problem-copy-button[data-state=success]{color:#206b51;background:#e7f3ed;border-color:#badbcb}
:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .problem-copy-button[data-state=error]{color:#9a3735;background:#fff0ee;border-color:#ebc4be}
:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .problem-copy-button:disabled{cursor:wait}
html.theme--dark :is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .problem-copy-button{color:#c4d5ff;background:#2d4263;border-color:#5873a0}
html.theme--dark :is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .problem-copy-button:hover{background:#3a567f;border-color:#94b3ed}
html.theme--dark :is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .problem-copy-button[data-state=success]{color:#ace3c9;background:#253f35;border-color:#466e5b}
html.theme--dark :is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .problem-copy-button[data-state=error]{color:#ffb6af;background:#4c2d30;border-color:#855357}
@media(prefers-reduced-motion:reduce){:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .problem-copy-button{transition:none}}
@media print{:is(#problem-workspace .problem-content, html.page--record_detail .main, .md-editor-preview-wrapper, .dm-preview) .code-toolbar>.toolbar{display:none!important}}

/* Preview panes can be much narrower than a reader, independently of viewport size. */
:is(.md-editor-preview-wrapper,.dm-preview){--copy-width:60px;--copy-height:28px;--copy-padding:4px 7px;--pw-paper:var(--md-panel,#fff);--pw-line:var(--md-line,#d7dfeb);--pw-accent:var(--md-blue,#355fc3);container:dyoj-preview / inline-size}
html.hydro-refined :is(.md-editor-preview-wrapper,.dm-preview) .dyoj-preview-samples{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:16px 0 22px;width:auto;max-width:none}
html.hydro-refined :is(.md-editor-preview-wrapper,.dm-preview) .dyoj-preview-samples::before,
html.hydro-refined :is(.md-editor-preview-wrapper,.dm-preview) .dyoj-preview-samples::after{display:none}
html.hydro-refined :is(.md-editor-preview-wrapper,.dm-preview) .sample{float:none;width:auto;padding:0;align-content:start;column-gap:8px}
:is(.md-editor-preview-wrapper,.dm-preview) .code-toolbar>h2{font-size:14px!important;line-height:22px!important;color:var(--md-text);font-weight:650}
:is(.md-editor-preview-wrapper,.dm-preview) .code-toolbar>pre{box-sizing:border-box;width:100%;margin:0!important;padding:12px!important;min-height:64px;border:1px solid var(--md-line);border-radius:6px;background:var(--md-wash)!important;overflow:auto}
:is(.md-editor-preview-wrapper,.dm-preview) .code-toolbar>pre>code{display:block;font:13px/1.6 Consolas,"Microsoft YaHei",monospace!important;color:var(--md-text);white-space:pre;overflow-wrap:normal;word-break:normal}
:is(.md-editor-preview-wrapper,.dm-preview) pre.dyoj-empty-sample::before{content:"（空）";color:var(--md-muted);font:13px/22px "Segoe UI","Microsoft YaHei",sans-serif}
@container dyoj-preview (max-width:420px){html.hydro-refined :is(.md-editor-preview-wrapper,.dm-preview) .dyoj-preview-samples{grid-template-columns:minmax(0,1fr);gap:14px}}

/* Submission source actions belong beside the section title, not on an empty row. */
html.page--record_detail .record-code-section{scroll-margin-top:90px}
html.page--record_detail .record-code-section>.section__header{display:flex;align-items:center;justify-content:space-between;gap:12px}
html.page--record_detail .record-code-section .section__title{margin:0}
html.page--record_detail .record-code-section .section__tools{position:static;float:none;display:flex;align-items:center;gap:8px;margin:0;transform:none}
html.page--record_detail .record-code-section .section__tools :is(.button,.problem-copy-button){display:inline-flex;align-items:center;justify-content:center;gap:5px;box-sizing:border-box;height:34px!important;min-height:34px;min-width:76px;padding:6px 10px!important;margin:0;border:1px solid var(--pw-line);border-radius:6px!important;font:600 12px/20px "Segoe UI","Microsoft YaHei",sans-serif;background:var(--ref-hover)!important;color:var(--ref-ink)!important;box-shadow:none}
html.page--record_detail .record-code-section .section__tools :is(.button,.problem-copy-button):hover{border-color:var(--pw-accent);color:var(--pw-accent)!important}
html.page--record_detail .record-code-section .section__tools .problem-copy-button[data-state=success]{color:#206b51!important;background:#e7f3ed!important;border-color:#badbcb}
html.page--record_detail .record-code-section .section__tools .problem-copy-button[data-state=error]{color:#9a3735!important;background:#fff0ee!important;border-color:#ebc4be}
html.page--record_detail .record-code-section .copy-in-header{display:block}
html.page--record_detail .record-code-section .copy-in-header>.toolbar{display:none!important}
html.page--record_detail .record-code-section .copy-in-header>pre{margin:0!important}
html.theme--dark.page--record_detail .record-code-section .section__tools .problem-copy-button[data-state=success]{color:#ace3c9!important;background:#253f35!important;border-color:#466e5b}
html.theme--dark.page--record_detail .record-code-section .section__tools .problem-copy-button[data-state=error]{color:#ffb6af!important;background:#4c2d30!important;border-color:#855357}
@media(pointer:coarse){html.page--record_detail .record-code-section .section__tools :is(.button,.problem-copy-button){height:40px!important;min-height:40px}}
@media print{html.page--record_detail .record-code-section .section__tools{display:none!important}}
