/* Layout adapter for existing OPC modules. Their own surfaces, colors and typography remain authoritative. */
.opc-workspace-content { min-width:0; }
.opc-workspace-content > .zmt-baiye { min-width:0; background:#fff; }
body.baiye-shell .opc-workspace-content .baiye-page-wrap { width:100%; max-width:none; padding:0 0 32px; }
.opc-workspace-content .baiye-list-page .baiye-breadcrumb,
.opc-workspace-content .zmt-case-page .baiye-breadcrumb { min-height:38px; }
.opc-workspace-content .baiye-list-page .baiye-library-hero h1,
.opc-workspace-content .baiye-detail .baiye-detail-intro h1,
.opc-workspace-content .zmt-case-hero h1 { font-size:clamp(34px,3.3cqw,48px); }
.opc-workspace-content .zmt-baiye :is(a,button,input,select,textarea):focus-visible { outline:3px solid #76b2ff; outline-offset:3px; }
.opc-workspace-content .zmt-case-section,.opc-workspace-content .zmt-case-sources,
.opc-workspace-content .baiye-section { scroll-margin-top:110px; }
.opc-workspace-content .zmt-case-sidebar-sticky,.opc-workspace-content .baiye-toc,
.opc-workspace-content .baiye-action-rail { top:100px; }
.opc-planner-view { min-width:0; }
.opc-planner-view .zmtopc-shell.is-workspace { width:100%; min-height:0; margin:0; background:transparent; }
.opc-planner-view .zmtopc-shell.is-workspace .zmtopc-base-layout { display:block; width:100%; padding:0; }
.opc-planner-view .zmtopc-shell.is-workspace .zmtopc-base-main { width:100%; padding:0; }
.opc-planner-view .zmtopc-shell.is-workspace .zmtopc-base-breadcrumb { margin:2px 0 20px; }
.opc-workspace-content[data-opc-view="planner"] { min-width:0; }
.opc-workspace-content[aria-busy="true"] { opacity:.84; transition:opacity 140ms ease; }
.opc-workspace-notice { position:fixed; z-index:10060; right:20px; bottom:20px; max-width:min(420px,calc(100vw - 40px)); padding:13px 16px; border:1px solid #c7d9eb; border-radius:11px; background:#fff; color:#244263; font-size:13px; line-height:1.5; box-shadow:0 14px 36px rgba(32,65,97,.18); }
.opc-workspace-notice a { margin-left:10px; color:#2166d1; font-weight:700; }

@container (max-width:1150px) {
  body.baiye-shell .opc-workspace-content .baiye-list-page .baiye-grid,
  body.baiye-shell .opc-workspace-content .zmt-case-page .zmt-case-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .opc-workspace-content .baiye-detail .baiye-reading-layout { grid-template-columns:minmax(0,1fr) minmax(225px,270px); gap:25px; }
  .opc-workspace-content .baiye-detail .baiye-action-rail { grid-column:2; grid-row:1; margin:0 0 30px; }
  .opc-workspace-content .zmt-case-filters { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .opc-workspace-content .zmt-case-search-label { grid-column:span 2; }
}
@container (max-width:950px) {
  .opc-workspace-content .baiye-list-page .baiye-library-hero { grid-template-columns:minmax(0,1fr) 235px; column-gap:24px; padding:27px; }
  .opc-workspace-content .baiye-detail .baiye-detail-hero { gap:24px; padding:32px; grid-template-columns:minmax(0,1fr) minmax(240px,.8fr); }
  .opc-workspace-content .zmt-case-detail-hero { grid-template-columns:minmax(0,1fr) 250px; gap:22px; }
  .opc-workspace-content .zmt-case-reading { grid-template-columns:minmax(0,1fr) 210px; gap:20px; }
  .opc-workspace-content .zmt-case-section { padding:24px; }
  .opc-workspace-content .baiye-section--overview .baiye-prose { grid-template-columns:1fr; }
}
@container (max-width:740px) {
  .opc-workspace-content .baiye-list-page .baiye-library-hero { grid-template-columns:1fr; grid-template-areas:"copy" "search" "entry"; padding:25px 20px 22px; }
  .opc-workspace-content .baiye-list-page .baiye-hero-search { margin-top:19px; }
  .opc-workspace-content .baiye-list-page .baiye-case-link { min-height:164px; margin-top:20px; }
  .opc-workspace-content .baiye-detail .baiye-detail-hero { display:flex; flex-direction:column; min-height:0; }
  .opc-workspace-content .baiye-detail .baiye-detail-cover { width:100%; min-height:0; height:auto; aspect-ratio:1.62; }
  .opc-workspace-content .baiye-detail .baiye-reading-layout { display:flex; flex-direction:column; gap:0; margin-top:24px; }
  .opc-workspace-content .baiye-detail .baiye-action-rail { display:contents; }
  .opc-workspace-content .baiye-detail .baiye-toc { position:static; display:flex; align-items:center; gap:4px; overflow-x:auto; margin:0 0 25px; padding:8px 0; border-left:0; border-bottom:1px solid var(--atlas-line); white-space:nowrap; }
  .opc-workspace-content .baiye-detail .baiye-toc { order:0; align-self:stretch; }
  .opc-workspace-content .baiye-detail .baiye-toc :is(.baiye-rail-kicker,h2) { display:none; }
  .opc-workspace-content .baiye-detail .baiye-toc a { flex:none; min-height:42px; margin:0; padding:8px 10px; border-left:0; border-bottom:2px solid transparent; }
  .opc-workspace-content .baiye-detail .baiye-toc a:is(:hover,.is-active) { border-left:0; border-bottom-color:var(--atlas-red); }
  .opc-workspace-content .baiye-detail .baiye-sections { order:1; align-self:stretch; width:100%; }
  .opc-workspace-content .baiye-detail .baiye-action-card { order:2; align-self:stretch; max-width:none; margin-bottom:28px; }
  .opc-workspace-content .zmt-case-detail-hero { grid-template-columns:1fr; }
  .opc-workspace-content .zmt-case-reading { grid-template-columns:1fr; }
  .opc-workspace-content .zmt-case-sidebar { grid-row:1; }
  .opc-workspace-content .zmt-case-sidebar-sticky { position:static; }
  .opc-workspace-content .zmt-case-sidebar nav { display:none; }
  .opc-workspace-content .zmt-case-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@container (max-width:620px) {
  body.baiye-shell .opc-workspace-content .baiye-list-page .baiye-grid,
  body.baiye-shell .opc-workspace-content .zmt-case-page .zmt-case-grid { grid-template-columns:1fr; }
  .opc-workspace-content .zmt-case-hero { grid-template-columns:1fr; }
  .opc-workspace-content .zmt-case-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .opc-workspace-content .zmt-case-search-label { grid-column:span 2; }
  .opc-workspace-content .baiye-list-page .baiye-filters { display:block; }
  .opc-workspace-content .opc-detail-layout { grid-template-columns:1fr; }
  .opc-workspace-content .opc-detail-layout>aside { position:static; }
}
@media (max-width:599px) {
  .opc-workspace-content .baiye-list-page .baiye-library-hero h1,
  .opc-workspace-content .baiye-detail .baiye-detail-intro h1,
  .opc-workspace-content .zmt-case-hero h1 { font-size:34px; }
  .opc-workspace-content .baiye-detail .baiye-section--overview .baiye-prose { grid-template-columns:1fr; }
  .opc-workspace-content .zmt-case-actions { display:grid; grid-template-columns:1fr 1fr; }
}
/* Keep the original library surfaces while giving both indexes a readable canvas. */
body.baiye-shell .opc-workspace-content :is(.baiye-list-page,.zmt-case-list) .baiye-page-wrap {
  box-sizing:border-box;
  width:100%;
  max-width:1480px;
  margin-inline:auto;
  padding:0 clamp(16px,4cqw,64px) 32px;
}
body.baiye-shell .opc-workspace-content .baiye-detail .baiye-page-wrap {
  box-sizing:border-box;
  width:100%;
  max-width:1480px;
  margin-inline:auto;
  padding:0 clamp(16px,4cqw,64px) 32px;
}
/* opc-mobile-detail-width: share the phone canvas across indexes and articles. */
@media (max-width:767px) {
  body.baiye-shell .opc-workspace-content > :is(.baiye-list-page,.zmt-case-list,.baiye-detail,.zmt-case-detail) {
    width:auto;
    margin-left:calc(0px - var(--opc-gutter));
    margin-right:calc(0px - var(--opc-gutter));
  }
  body.baiye-shell .opc-workspace-content :is(.baiye-list-page,.zmt-case-list,.baiye-detail,.zmt-case-detail) .baiye-page-wrap {
    padding-left:max(8px,env(safe-area-inset-left));
    padding-right:max(8px,env(safe-area-inset-right));
  }
  .opc-workspace-content .zmt-case-detail .zmt-case-section {
    padding:20px 14px;
  }
  .opc-workspace-content .zmt-case-detail .zmt-case-prose {
    width:100%;
    min-width:0;
    max-width:none;
  }
  .opc-workspace-content .zmt-case-detail .zmt-case-prose p {
    max-width:none;
    text-wrap:wrap;
  }
}
@container (min-width:621px) {
  body.baiye-shell .opc-workspace-content .baiye-list-page .baiye-grid,
  body.baiye-shell .opc-workspace-content .zmt-case-list .zmt-case-grid {
    grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  }
}
@media print {
  .opc-base-sidebar,.opc-mobile-nav,.opc-mobile-drawer,.opc-footer { display:none!important; }
  .opc-base-layout { display:block; padding:0; }
  .opc-base-main { padding:0; }
  .opc-workspace-content .baiye-page-wrap { padding:0!important; }
}
@media (prefers-reduced-motion:reduce) {
  .opc-workspace-content[aria-busy="true"] { transition:none; }
}
