/* PR118 — Surface alignment
 * Align Procedure, Developer and Help with the current Oroko product shell,
 * and remove the canvas' artificial bottom gutter.
 */

/* ---------- Canvas chrome ---------- */
@media (min-width:821px){
  /* The toolbar and legend are fixed overlays. Reserving 72px below the
     canvas created the plain strip visible after the legend was closed. */
  .app.pr28-canvas-mode .canvas-wrap{
    padding:54px 324px 14px 72px!important;
  }

  .app.pr28-canvas-mode .editor-toolbar{
    left:78px!important;
    bottom:14px!important;
    min-height:42px!important;
    padding:5px!important;
    gap:4px!important;
    border:1px solid var(--line)!important;
    border-radius:12px!important;
    background:color-mix(in srgb,var(--surface) 94%,transparent)!important;
    box-shadow:0 8px 24px rgba(30,27,24,.10)!important;
    backdrop-filter:blur(14px);
  }

  .app.pr28-canvas-mode .editor-toolbar .state-switch,
  .app.pr28-canvas-mode .editor-toolbar .canvas-controls{
    border:0!important;
    box-shadow:none!important;
    background:transparent!important;
    padding:0!important;
  }

  .app.pr28-canvas-mode .editor-toolbar .state-switch{
    padding-right:5px!important;
    margin-right:2px!important;
    border-right:1px solid var(--line)!important;
    border-radius:0!important;
  }

  .app.pr28-canvas-mode .editor-toolbar .state-switch button,
  .app.pr28-canvas-mode .editor-toolbar .canvas-controls button{
    min-height:32px!important;
  }

  .app.pr28-canvas-mode .legend-wrap{
    bottom:14px!important;
    padding:0!important;
  }

  .app.pr28-canvas-mode .pr28-legend-toggle{
    min-height:38px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }

  /* Full bar mode used to leave the compact canvas header under the full
     topbar and allowed the canvas to run underneath the 64px bar. */
  .app.pr28-canvas-mode.pr28-topbar-open .pr28-canvas-header{
    opacity:0!important;
    pointer-events:none!important;
  }

  .app.pr28-canvas-mode.pr28-topbar-open .canvas-wrap{
    padding-top:78px!important;
  }

  .app.pr28-canvas-mode.pr28-topbar-open .inspector{
    top:78px!important;
  }

  .app.pr28-canvas-mode.pr28-topbar-open .canvas-palette{
    top:78px!important;
  }

  .app.pr28-canvas-mode.pr28-topbar-open>.topbar{
    height:64px!important;
    min-height:64px!important;
    align-items:center!important;
  }

  .app.pr28-canvas-mode.pr28-topbar-open>.topbar .brand-area,
  .app.pr28-canvas-mode.pr28-topbar-open>.topbar .topbar-body{
    height:64px!important;
    align-items:center!important;
  }

  .app.pr28-canvas-mode.pr28-topbar-open>.topbar .topbar-body{
    padding-top:0!important;
    padding-bottom:0!important;
  }

  .app.pr28-canvas-mode.pr28-topbar-open>.topbar .process-header,
  .app.pr28-canvas-mode.pr28-topbar-open>.topbar .top-actions{
    align-self:center!important;
  }
}

/* ---------- Shared reading-page grammar ---------- */
/* Developer's live markup (productisation.js's renderDeveloper) is a flat
   grid of .b5-card sections, not the tabbed .pr55-dev docs-explorer layout
   this file originally targeted - that markup belongs to
   pr55-developer-docs.js, which never mounts on a real page. Retargeted to
   the classes the live page actually renders, and scoped with
   .pr118-developer-page (added only on the real Developer page) since
   .b5-head/.b5-page are shared with Workspace Settings. */
.pr118-procedure-page,
.pr34-page.pr118-help-page,
.b5-page.pr118-developer-page{
  width:min(1180px,100%);
  max-width:1180px!important;
  margin:0 auto!important;
  padding:32px 34px 56px!important;
}

.pr118-procedure-page .page-head,
.pr34-page.pr118-help-page .pr34-page-head,
.b5-page.pr118-developer-page .b5-head{
  align-items:flex-end!important;
  margin-bottom:26px!important;
}

.pr118-procedure-page .page-head h1,
.pr34-page.pr118-help-page .pr34-page-head h1,
.b5-page.pr118-developer-page .b5-head h1{
  margin:0!important;
  font-size:30px!important;
  line-height:1.05!important;
  letter-spacing:-.045em!important;
  color:var(--ink)!important;
}

.pr118-procedure-page .page-head p,
.pr34-page.pr118-help-page .pr34-page-head p,
.b5-page.pr118-developer-page .b5-head p{
  max-width:650px;
  margin-top:8px!important;
  color:var(--muted)!important;
  font-size:13px!important;
  line-height:1.55!important;
}

.pr118-procedure-page .eyebrow,
.pr34-page.pr118-help-page .pr34-eyebrow{
  margin-bottom:9px!important;
  padding:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:var(--muted)!important;
  font-size:9.5px!important;
  line-height:1!important;
  font-weight:800!important;
  letter-spacing:.09em!important;
  text-transform:uppercase;
}

.pr118-procedure-page .eyebrow::before,
.pr34-page.pr118-help-page .pr34-eyebrow::before{
  content:"";
  width:7px;
  height:7px;
  margin-right:7px;
  display:inline-block;
  border-radius:22%;
  background:var(--orange);
}

/* ---------- Procedure ---------- */
.pr118-procedure-page{
  --pr118-rail:44px;
}

.pr118-procedure-page>.process-note{
  display:none!important;
}

.pr118-procedure-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 250px;
  gap:26px;
  align-items:start;
}

.pr118-procedure-main{
  min-width:0;
}

.pr118-procedure-summary{
  position:sticky;
  top:84px;
  padding:18px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
  box-shadow:var(--shadow-xs);
}

.pr118-procedure-summary .pr118-summary-kicker{
  margin:0 0 7px;
  color:var(--muted);
  font-size:9px;
  font-weight:800;
  letter-spacing:.09em;
  text-transform:uppercase;
}

.pr118-procedure-summary h2{
  margin:0;
  color:var(--ink);
  font-size:16px;
  line-height:1.2;
  letter-spacing:-.025em;
}

.pr118-procedure-summary>p{
  margin:8px 0 17px;
  color:var(--muted);
  font-size:11px;
  line-height:1.5;
}

.pr118-procedure-stats{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:14px;
}

.pr118-procedure-stat{
  min-width:0;
  padding:10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface-soft);
}

.pr118-procedure-stat strong{
  display:block;
  color:var(--ink);
  font-size:16px;
  line-height:1;
}

.pr118-procedure-stat span{
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:9px;
}

.pr118-procedure-live{
  display:flex;
  gap:8px;
  align-items:flex-start;
  padding-top:13px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:10px;
  line-height:1.45;
}

.pr118-procedure-live::before{
  content:"";
  width:7px;
  height:7px;
  margin-top:3px;
  flex:0 0 auto;
  border-radius:50%;
  background:var(--green);
  box-shadow:0 0 0 3px var(--green-soft);
}

.pr118-procedure-page .procedure-list{
  position:relative;
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
}

.pr118-procedure-page .procedure-list::before{
  content:"";
  position:absolute;
  left:21px;
  top:26px;
  bottom:26px;
  width:1px;
  background:var(--line);
}

.pr118-procedure-page .procedure-item{
  position:relative;
  z-index:1;
  display:grid!important;
  grid-template-columns:var(--pr118-rail) minmax(0,1fr)!important;
  gap:14px!important;
  margin:0!important;
  padding:17px 18px 17px 13px!important;
  border:1px solid var(--line)!important;
  border-radius:14px!important;
  background:var(--surface)!important;
  box-shadow:var(--shadow-xs)!important;
}

.pr118-procedure-page .procedure-item:hover{
  border-color:var(--line-strong)!important;
  box-shadow:var(--shadow-sm)!important;
}

.pr118-procedure-page .procedure-num{
  position:relative;
  z-index:2;
  width:30px!important;
  height:30px!important;
  margin-left:0;
  border:1px solid var(--line-strong)!important;
  border-radius:10px!important;
  background:var(--surface)!important;
  color:var(--ink)!important;
  font-size:10px!important;
  box-shadow:0 0 0 5px var(--surface);
}

.pr118-procedure-page .procedure-item h3{
  margin:0 0 5px!important;
  color:var(--ink)!important;
  font-size:14.5px!important;
  line-height:1.25!important;
  letter-spacing:-.015em;
}

.pr118-procedure-page .procedure-item p{
  max-width:760px;
  color:var(--muted)!important;
  font-size:11.5px!important;
  line-height:1.55!important;
}

.pr118-procedure-page .procedure-meta{
  margin-top:12px!important;
  gap:6px!important;
}

.pr118-procedure-page .procedure-meta span{
  padding:5px 7px!important;
  border:1px solid var(--line)!important;
  border-radius:7px!important;
  background:var(--surface-soft)!important;
  color:var(--muted)!important;
  font-size:9.5px!important;
  line-height:1.2;
}

.pr118-procedure-page .procedure-branches{
  gap:6px!important;
  margin-top:11px!important;
}

.pr118-procedure-page .procedure-branches span{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 8px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--orange-soft);
  color:var(--ink);
  font-size:9.5px;
  font-weight:700;
}

.pr118-procedure-page .procedure-toggle{
  margin-top:12px!important;
  padding:6px 0!important;
  color:var(--orange)!important;
  font-size:10.5px!important;
}

.pr118-procedure-page .procedure-expand{
  margin-top:11px!important;
  padding:14px!important;
  border:1px solid var(--line)!important;
  border-radius:11px!important;
  background:var(--surface-soft)!important;
  gap:13px!important;
}

.pr118-procedure-page .procedure-iogrid{
  gap:12px!important;
}

.pr118-procedure-page .procedure-iohead{
  color:var(--muted)!important;
  font-size:8.5px!important;
  letter-spacing:.08em!important;
}

.pr118-procedure-page .procedure-iolist,
.pr118-procedure-page .procedure-note-box{
  font-size:11px!important;
  line-height:1.55!important;
}

.pr118-procedure-page .procedure-note-box{
  background:var(--surface)!important;
}

/* ---------- Help ---------- */
.pr34-page.pr118-help-page{
  position:relative;
}

.pr34-page.pr118-help-page .pr34-docs-link{
  display:inline-flex;
  align-items:center;
  min-height:38px;
  padding:0 13px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface);
  color:var(--ink)!important;
  font-size:10.5px!important;
  text-decoration:none!important;
}

.pr34-page.pr118-help-page .pr34-docs-link:hover{
  border-color:var(--line-strong);
  background:var(--surface-soft);
}

.pr34-page.pr118-help-page .pr34-help-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:12px!important;
}

.pr34-page.pr118-help-page .pr34-help-card{
  position:relative;
  min-height:205px;
  padding:20px!important;
  border:1px solid var(--line)!important;
  border-radius:14px!important;
  background:var(--surface)!important;
  box-shadow:var(--shadow-xs)!important;
  overflow:hidden;
}

.pr34-page.pr118-help-page .pr34-help-card::before{
  display:grid;
  place-items:center;
  width:31px;
  height:31px;
  margin-bottom:18px;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--surface-soft);
  color:var(--ink);
  font-size:13px;
  font-weight:800;
}

.pr34-page.pr118-help-page .pr34-help-card:nth-child(1)::before{content:"01"}
.pr34-page.pr118-help-page .pr34-help-card:nth-child(2)::before{content:"02"}
.pr34-page.pr118-help-page .pr34-help-card:nth-child(3)::before{content:"03"}
.pr34-page.pr118-help-page .pr34-help-card:nth-child(4)::before{content:"04"}

.pr34-page.pr118-help-page .pr34-help-card h2{
  margin:0 0 7px!important;
  color:var(--ink);
  font-size:15px!important;
  letter-spacing:-.015em;
}

.pr34-page.pr118-help-page .pr34-help-card p{
  max-width:480px;
  margin-bottom:18px!important;
  color:var(--muted)!important;
  font-size:11.5px!important;
  line-height:1.55!important;
}

.pr34-page.pr118-help-page .pr34-help-links{
  margin-top:auto;
  display:flex!important;
  flex-wrap:wrap;
  gap:7px!important;
}

.pr34-page.pr118-help-page .pr34-help-links button{
  min-height:34px;
  padding:0 10px!important;
  border:1px solid var(--line)!important;
  border-radius:9px!important;
  background:var(--surface)!important;
  color:var(--ink)!important;
  font-size:10px!important;
}

.pr34-page.pr118-help-page .pr34-help-links button:hover{
  border-color:var(--line-strong)!important;
  background:var(--surface-soft)!important;
}

/* Developer has no tabbed docs-explorer, side-nav or split doc-shell layout
   on the live page (that structure belongs to pr55-developer-docs.js, which
   never mounts) - only the shared reading-page grammar above applies. Its
   .b5-card sections already have their own border/radius/background styling
   from productisation.js, so there's nothing further to align here. */

/* ---------- Responsive ---------- */
@media(max-width:980px){
  .pr118-procedure-layout{
    grid-template-columns:1fr;
  }
  .pr118-procedure-summary{
    position:static;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:12px 18px;
    align-items:start;
  }
  .pr118-procedure-summary>p{grid-column:1}
  .pr118-procedure-stats{grid-column:2;grid-row:1/3;margin:0}
  .pr118-procedure-live{grid-column:1/-1}
}

@media(max-width:820px){
  .pr118-procedure-page,
  .pr34-page.pr118-help-page,
  .b5-page.pr118-developer-page{
    padding:24px 18px 44px!important;
  }

  .pr118-procedure-page .page-head,
  .pr34-page.pr118-help-page .pr34-page-head,
  .b5-page.pr118-developer-page .b5-head{
    align-items:flex-start!important;
    flex-direction:column!important;
  }

  .pr34-page.pr118-help-page .pr34-help-grid{
    grid-template-columns:1fr!important;
  }
}

@media(max-width:640px){
  .pr118-procedure-page,
  .pr34-page.pr118-help-page,
  .b5-page.pr118-developer-page{
    padding:20px 14px 38px!important;
  }

  .pr118-procedure-page .page-head h1,
  .pr34-page.pr118-help-page .pr34-page-head h1,
  .b5-page.pr118-developer-page .b5-head h1{
    font-size:26px!important;
  }

  .pr118-procedure-summary{
    display:block;
  }

  .pr118-procedure-stats{
    margin:15px 0 13px;
  }

  .pr118-procedure-page .procedure-item{
    grid-template-columns:36px minmax(0,1fr)!important;
    padding:14px 12px 14px 10px!important;
    gap:10px!important;
  }

  .pr118-procedure-page .procedure-list::before{
    left:15px;
  }

  .pr118-procedure-page .procedure-num{
    width:28px!important;
    height:28px!important;
  }

  .pr118-procedure-page .procedure-iogrid{
    grid-template-columns:1fr!important;
  }
}
