.detail-window { position: fixed; inset: 0; margin: auto; width: min(1100px, 84vw); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); box-shadow: var(--shadow-md); }
.detail-window.is-active-window { border-color: var(--accent); }
.detail-window > .editor-header { flex: 0 0 auto; }
.detail-frame-window iframe { display: block; width: 100%; min-height: 0; flex: 1 1 0; border: 0; background: var(--surface); }
.detail-frame-window { height: min(760px, 84dvh); }
.detail-frame-loading { margin: 8px 16px; }
.detail-window-status { position: fixed; inset: auto 16px 16px; z-index: 2147483000; padding: 12px 16px; margin: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--ink-950); box-shadow: var(--shadow-md); }
.detail-window-chooser { padding: 0; }
.detail-window-backdrop { position: fixed; inset: 0; z-index: 1099; background: rgb(9 18 25 / 58%); }
.detail-window-backdrop[hidden] { display: none; }
.is-background-scroll-locked { overflow: hidden !important; overscroll-behavior: none !important; }
html.has-background-scroll-gutter { scrollbar-gutter: stable; }
:is(.detail-window, .embedded-detail) :is(.editor-body, .editor-scroll, .detail-panel) { overscroll-behavior: contain; }
.auxiliary-surface-slot { flex: 1 1 0; min-height: 0; }
.auxiliary-surface-slot[hidden] { display: none; }
.has-auxiliary-surface { overflow: visible; }
.has-auxiliary-surface::backdrop { background: transparent; }
.has-auxiliary-surface > iframe.is-auxiliary-surface { position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 1; background: transparent; }
.auxiliary-surface-active,
.auxiliary-surface-active :is(body, .app-layout, .app-main, .app-content, #workspaceContent, .workspace-list-layout, .master-detail) { background: transparent; }
.embedded-detail.auxiliary-surface-active .embedded-detail-primary,
.embedded-detail.auxiliary-surface-active #workspaceContent > .master-detail { position: fixed; inset: auto; left: var(--detail-source-x); top: var(--detail-source-y); width: var(--detail-source-width); height: var(--detail-source-height); }
.auxiliary-window:not(.auxiliary-top)::backdrop,
.auxiliary-window[data-background-hidden="true"]::backdrop { background: transparent; }
.auxiliary-window > .editor-form { flex: 1; min-height: 0; }
.auxiliary-window .editor-body { flex: 1; min-height: 0; }
.detail-window .detail-window-drag-handle { cursor: grab; touch-action: none; user-select: none; }
.detail-window .detail-window-drag-handle h3 { flex: 1 1 120px; min-width: 0; overflow-wrap: anywhere; }
.detail-window .detail-window-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.detail-window-actions .button { min-width: 32px; min-height: 32px; padding: 4px 8px; }
.detail-window-actions [aria-pressed="false"] { background: var(--surface-subtle); }
.detail-window .detail-window-actions button { cursor: pointer; }
.is-detail-window-dragging, .is-detail-window-dragging .detail-window-drag-handle { cursor: grabbing; user-select: none; }
.is-detail-window-dragging iframe { pointer-events: none; }
.embedded-detail, .embedded-detail body { margin: 0; height: 100%; overflow: hidden; }
.embedded-detail :is(.app-sidebar, .sidebar-backdrop, .app-header) { display: none !important; }
.embedded-detail :is(.app-layout, .app-main, .app-content, #workspaceContent, .workspace-list-layout, .master-detail) { display: block; margin: 0; padding: 0; width: 100%; height: 100%; min-width: 0; }
.embedded-detail :is(.workspace-list-layout, .master-detail) > :not(.detail-panel):not(dialog) { display: none; }
.embedded-detail #workspaceContent > :not(.workspace-list-layout):not(.master-detail):not(dialog) { display: none; }
.embedded-detail .embedded-detail-primary { position: fixed; inset: 0; margin: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; border: 0; border-radius: 0; box-shadow: none; }
.embedded-detail .embedded-detail-primary > .editor-header { display: none; }
.embedded-detail .detail-panel { height: 100%; overflow: auto; border: 0; border-radius: 0; }
.embedded-detail .embedded-detail-primary > .detail-panel { flex: 1; }
.embedded-detail :is(.embedded-detail-primary, .master-detail) { container: detail-content / inline-size; }
@container detail-content (min-width: 720px) {
    .embedded-detail.is-wide-detail-view .detail-fields-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .embedded-detail.is-wide-detail-view .detail-fields-grid > :is(h4, .detail-role-badges, .detail-memo, .parameter-table-scroll) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .detail-window { width: calc(100vw - 16px); }
}

/* 320px 화면의 상세 iframe은 바깥 여백 때문에 320px보다 좁다. */
html.embedded-detail { min-width: 0; }

/* 상세 문서와 입력 상태를 유지한 채 숨기며, 복원 목록은 배경보다 위에 둔다. */
.detail-window.is-minimized-window { display: none !important; }
.detail-window-overview { position: fixed; z-index: 2147482000; right: 8px; bottom: 8px; max-width: min(360px, calc(100vw - 16px)); max-height: 30dvh; overflow: auto; padding: 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); }
.detail-window-overview[hidden] { display: none; }
.detail-window-overview summary { cursor: pointer; font-size: 12px; }
.detail-window-overview details[open] summary { margin-bottom: 4px; }
.detail-window-overview ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.detail-window-overview button { width: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.detail-window-overview button[aria-pressed="true"] { border-color: var(--accent); }

.detail-window-status { pointer-events: none; }
