dialog.drawer:has(#indicator-studio) {display:flex;flex-direction:column;overflow:hidden;}
dialog:not([open]).drawer:has(#indicator-studio) {display:none;}
dialog:has(#indicator-studio) .dialog-head {flex:none;position:static;}
dialog:has(#indicator-studio) #dialog-content {display:flex;flex-direction:column;min-height:0;flex:1;padding:0;}
dialog:has(#indicator-studio) #dialog-content > .form-error:empty {display:none;}
#indicator-studio {min-height:0;flex:1;display:flex;flex-direction:column;color:var(--ink);}
.studio-entry {padding:22px;overflow:auto;}
.studio-entry textarea {width:100%;min-height:122px;resize:vertical;}
.studio-example,.studio-provenance,.studio-notes p,.studio-section .hint {font-size:.86rem;line-height:1.6;}
.studio-example {color:var(--muted);margin:10px 0 18px;}
.studio-entry-actions,.studio-bottom,.studio-tune {display:flex;align-items:center;gap:9px;}
.studio-link.button {background:transparent;border-color:transparent;color:var(--accent,#294979);padding-inline:5px;}
#indicator-save-state {color:var(--muted);font-size:.76rem;overflow-wrap:anywhere;}
.studio-entry #indicator-save-state {display:block;margin-top:9px;}
.studio-scroll {flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;}
.studio-content {padding:18px 20px 26px;}
.studio-content .field {margin-bottom:9px;min-width:0;}
.studio-content [name=name] {font-size:1.12rem;font-weight:650;}
.studio-content .field textarea {line-height:1.5;resize:vertical;max-width:100%;}
.studio-meta {display:grid;grid-template-columns:1.1fr 1.3fr minmax(64px,.65fr);gap:8px;}
.studio-meta input,.studio-meta select,.studio-tune input {width:100%;min-width:0;}
.studio-section {border-top:1px solid var(--line);margin-top:14px;padding-top:12px;}
.studio-section h3 {margin:0 0 10px;}
.studio-section textarea:not(:focus) {background:#f7f9fc;}
.studio-advanced,.studio-clauses,.studio-inspection {margin-top:12px;}
.studio-advanced {border-top:1px solid var(--line);padding:14px 0;}
.studio-advanced summary,.studio-clauses summary,.studio-inspection summary {cursor:pointer;font-weight:600;}
.studio-stack,.studio-flags {display:grid;gap:8px;margin-top:12px;}
.studio-provenance {display:flex;align-items:center;gap:7px;color:var(--muted);margin:0 0 10px;}
.studio-provenance svg {width:16px;height:16px;}
.studio-notes,.studio-changes {padding:10px 12px;margin-top:12px;border-left:3px solid #9bb2d0;background:#f4f7fb;}
.studio-notes p {margin:2px 0;}
.studio-changes > div:not(.section-head) {font-size:.86rem;margin-top:5px;overflow-wrap:anywhere;}
.studio-changes strong {margin-right:6px;}
.studio-changes del {color:var(--muted);}
.studio-changes ins {text-decoration:none;}
.studio-warning {color:#894900;}
.studio-footer {background:#fff;border-top:1px solid var(--line);padding:10px 20px max(10px,env(safe-area-inset-bottom));
  flex:none;max-height:45dvh;overflow-y:auto;}
.studio-tune input {flex:1;}
.studio-tune button,.studio-bottom button {flex:none;}
.studio-bottom .primary {margin-left:auto;}
.studio-confirm {font-size:.86rem;margin:6px 0;}
.studio-footer .form-error:empty {display:none;}
.studio-bottom {margin-top:7px;}
.bp-entry,.bp-library,.bp-tools,.bp-detail {display:grid;gap:10px;min-width:0;}
.bp-entry .primary {justify-self:start;}
.bp-entry textarea {min-height:100px;}
.bp-entry .hint,.bp-library .hint {margin:0;color:var(--muted);}
.bp-structure {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:4px 0 8px;}
.bp-structure>div {display:grid;gap:3px;padding:9px;background:#f4f7fb;border-radius:8px;}
.bp-structure small,.bp-common small,.bp-item summary small,#template-save-state {color:var(--muted);font-size:.8rem;}
.bp-structure span {font-weight:650;}
.bp-balance {display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:#f0f4fa;padding:12px;border-radius:8px;margin:10px 0;}
.bp-tools {border-block:1px solid var(--line);padding:12px 0;margin:10px 0;}
.bp-tools .form-error:empty,.bp-entry .form-error:empty {display:none;}
.bp-item,.bp-common,.bp-library details,.bp-diff,.bp-findings {padding:10px 0;border-bottom:1px solid var(--line);}
.bp-item summary,.bp-common summary,.bp-library summary,.bp-diff summary,.bp-findings summary {cursor:pointer;overflow-wrap:anywhere;}
.bp-item>summary {display:flex;gap:14px;align-items:center;justify-content:space-between;}
.bp-item>summary:before {content:'▸';color:var(--muted);}
.bp-item[open]>summary:before {content:'▾';}
.bp-item>summary span {flex:1;display:grid;gap:3px;min-width:0;}
.bp-item>summary strong {white-space:nowrap;}
.bp-detail {padding:12px 0 6px;}
.bp-common details,.bp-library details p {padding-left:12px;}
.bp-common small {display:inline-block;margin-left:5px;}
.bp-diff ul,.bp-findings ul {padding-left:18px;line-height:1.65;overflow-wrap:anywhere;}
.bp-confirm {margin:10px 0;}
@media(max-width:540px) {.bp-structure {grid-template-columns:repeat(2,minmax(0,1fr));}.bp-entry .primary{width:100%;}.bp-balance{gap:6px;}}
@media(max-width:520px) {
  .studio-content,.studio-entry {padding:14px;}
  .studio-footer {padding-inline:12px;}
  .studio-meta {grid-template-columns:1fr minmax(84px,.6fr);}
  .studio-meta .field:nth-child(2) {grid-column:1 / -1;grid-row:2;}
  .studio-bottom,.studio-tune {gap:5px;}
}
