/* Source-owned presentation only. Existing theme/preference owners supply
   workspace tokens; no API/role/readiness state is encoded in this stylesheet. */
.lacuna-native-shell,
.lacuna-plan0-surface {
  --lacuna-control: 36px;
  --lacuna-radius: 8px;
  --lacuna-space: 16px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--workspace-text);
  background: var(--workspace-bg);
  min-width: 0;
  overflow-wrap: anywhere;
}
.lacuna-native-shell *,.lacuna-plan0-surface * { box-sizing: border-box; }
.lacuna-native-shell__header {
  display: flex; align-items: center; gap: 16px; min-height: 56px;
  padding: 8px 16px; border-bottom: 1px solid var(--workspace-line);
}
.lacuna-native-shell__brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.lacuna-native-shell__tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.lacuna-native-shell button,.lacuna-plan0-surface button,
.lacuna-plan0-surface input,.lacuna-plan0-surface textarea,.lacuna-plan0-surface select {
  font: inherit; color: inherit; min-height: var(--lacuna-control);
}
.lacuna-native-shell__tab,.lacuna-native-shell__rail-toggle,
.lacuna-plan0-surface button {
  border: 1px solid var(--workspace-line); border-radius: var(--lacuna-radius);
  background: var(--workspace-panel); padding: 6px 12px;
}
.lacuna-native-shell__tab[aria-current=page] {
  background: var(--workspace-soft); color: var(--workspace-blue);
  border-color: var(--workspace-blue);
}
.lacuna-native-shell__rail-toggle { margin-left: auto; }
.lacuna-native-shell__body { display: grid; grid-template-columns: 224px minmax(0,1fr); align-items: start; }
.lacuna-native-shell[data-context=true] .lacuna-native-shell__body { grid-template-columns: 224px minmax(0,1fr) 300px; }
.lacuna-native-shell[data-compact=true] .lacuna-native-shell__body { grid-template-columns: 64px minmax(0,1fr); }
.lacuna-native-shell[data-compact=true][data-context=true] .lacuna-native-shell__body { grid-template-columns: 64px minmax(0,1fr) 300px; }
.lacuna-native-shell__rail { min-width: 0; padding: 12px 8px; border-right: 1px solid var(--workspace-line); }
.lacuna-native-shell__main { min-width: 0; padding: 20px; margin: 0; max-width: none; width: 100%; }
.lacuna-native-shell__context { min-width: 0; padding: 16px; border-left: 1px solid var(--workspace-line); }
.lacuna-native-shell__status,.lacuna-native-shell__version { margin: 0; padding: 8px 16px; color: var(--workspace-muted); font-size: 12px; }
.lacuna-native-shell__version { border-top: 1px solid var(--workspace-line); }
.lacuna-native-shell[data-compact=true] [data-lacuna-rail-label] { display: none; }
.lacuna-plan0-surface { display: grid; gap: 16px; width: 100%; max-width: none; }
.lacuna-plan0-surface h1 { font-size: 22px; line-height: 1.3; margin: 0; }
.lacuna-plan0-surface h2 { font-size: 16px; line-height: 1.4; margin: 0; }
.lacuna-plan0-surface p { margin: 0; }
.lacuna-plan0-surface__hint,.lacuna-plan0-surface__basis { font-size: 12px; color: var(--workspace-muted); }
.lacuna-plan0-surface__goal { display: grid; gap: 8px; }
.lacuna-plan0-surface textarea,.lacuna-plan0-surface input,.lacuna-plan0-surface select {
  background: var(--workspace-panel); border: 1px solid var(--workspace-line);
  border-radius: var(--lacuna-radius); padding: 8px 10px; min-width: 0; max-width: 100%;
}
.lacuna-plan0-surface textarea { width: 100%; resize: vertical; }
.lacuna-plan0-surface__actions,.lacuna-plan0-surface__group-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lacuna-plan0-surface__primary { color: var(--workspace-bg)!important; background: var(--workspace-blue)!important; border-color: var(--workspace-blue)!important; }
.lacuna-plan0-surface button:disabled { opacity: .55; }
.lacuna-plan0-surface__questions { display: grid; gap: 12px; }
.lacuna-plan0-surface__question { padding: 14px; border: 1px solid var(--workspace-line); border-radius: var(--lacuna-radius); background: var(--workspace-panel); display: grid; gap: 10px; }
.lacuna-plan0-surface .lab-question-card { display: grid; gap: 10px; margin: 0; }
.lacuna-plan0-surface .lab-question-card__options { padding: 0; margin: 0; border: 0; display: grid; gap: 6px; }
.lacuna-plan0-surface .lab-question-card__legend { font-size: 12px; color: var(--workspace-muted); }
.lacuna-plan0-surface .lab-question-card__option,.lacuna-plan0-surface .lab-question-card__custom { display: flex; gap: 8px; align-items: center; min-height: 36px; }
.lacuna-plan0-surface input[type=radio],.lacuna-plan0-surface input[type=checkbox] { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; accent-color: var(--workspace-blue); }
.lacuna-plan0-surface .lab-question-card__number { color: var(--workspace-muted); font-size: 12px; }
.lacuna-plan0-surface .lab-question-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lacuna-plan0-surface .lab-adaptive-field { display: grid; gap: 6px; }
.lacuna-plan0-surface .lab-question-card__hint,.lacuna-plan0-surface .lab-question-card__status { color: var(--workspace-muted); font-size: 12px; }
.lacuna-plan0-surface .lab-question-card__error,[data-lacuna-error] { color: var(--workspace-amber); }
.lacuna-plan0-surface details { border-top: 1px solid var(--workspace-line); padding-top: 10px; }
.lacuna-plan0-surface summary { min-height: 36px; padding: 6px 0; }
.lacuna-plan0-surface__basics { display: grid; gap: 12px; padding: 12px 0; }
.lacuna-plan0-surface__basics label { display: grid; gap: 6px; }
.lacuna-plan0-surface__definition { display: grid; gap: 10px; padding: 12px 0; }
.lacuna-plan0-surface__answered { display: grid; gap: 10px; padding: 12px 0; }
/* Shared answer provenance: secondary metadata inside the existing Lab card. */
.lab-answer-provenance { display:grid; gap:5px; min-width:0; font-size:12px; color:var(--workspace-muted); }
.lab-answer-provenance :is(p,time,span) { margin:0; white-space:normal; overflow-wrap:anywhere; }
.lab-answer-provenance__meta { line-height:1.5; }
.lab-answer-provenance .lab-answer-provenance__details { border:0; padding:0; background:transparent; }
.lab-answer-provenance .lab-answer-provenance__details > summary { min-height:36px; padding:4px 0; cursor:pointer; }
.lab-answer-provenance__actions { display:flex; flex-wrap:wrap; gap:4px 10px; }
.lab-answer-provenance .lab-answer-provenance__action { min-height:36px; padding:4px 0; border:0; border-radius:0; color:var(--workspace-blue); background:transparent; text-align:left; white-space:normal; overflow-wrap:anywhere; }
.lab-answer-provenance .lab-answer-provenance__action:focus-visible { outline:2px solid var(--workspace-blue); outline-offset:2px; }
.lab-answer-provenance__technical { color:var(--workspace-muted); font-size:11px; line-height:1.5; }
.lab-answer-provenance__reason,.lab-answer-provenance__material { padding-block:5px; }
.lab-answer-provenance__status { color:var(--workspace-amber); }
.lab-answer-provenance [hidden] { display:none!important; }
/* Existing Result tab: small read-only verified-output entry, not product approval. */
.forge-result-available { display:grid; gap:10px; min-width:0; }
.forge-result-available__boundary { font-size:12px; line-height:1.5; color:var(--workspace-muted); }
.forge-result-available__file { display:grid; gap:6px; min-width:0; padding:8px 0; border-bottom:1px solid var(--workspace-line); }
.forge-result-available__name,.forge-result-available__version { min-width:0; white-space:normal; overflow-wrap:anywhere; }
.forge-result-available__version { color:var(--workspace-muted); font-size:11px; }
.forge-result-available .domain-file-evidence-link { display:inline-flex; align-items:center; min-height:36px; white-space:normal; overflow-wrap:anywhere; }
@media(max-width:760px) { .forge-result-available .domain-file-evidence-link { min-height:44px; } }
@media(max-width:760px) { .lab-answer-provenance .lab-answer-provenance__action,.lab-answer-provenance .lab-answer-provenance__details > summary { min-height:44px; } }
.lacuna-plan0-surface__read-only { padding: 14px; border-left: 2px solid var(--workspace-blue); background: var(--workspace-panel); }
.choices-adoption > p { padding: 8px 0 12px; color: var(--workspace-muted); }
.choices-adoption__form { display: grid; gap: 12px; padding-top: 14px; min-width: 0; }
.choices-adoption__form > label,.choices-adoption__form > div > label { display: grid; gap: 6px; min-width: 0; }
.choices-adoption__form select { width: 100%; max-width: 100%; }
.choices-adoption__form label:has(input[type=checkbox]) { display: flex; align-items: center; gap: 8px; }
.choices-adoption__preview { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px;
  border: 1px solid var(--workspace-line); border-radius: var(--lacuna-radius); background: var(--workspace-bg); }
.choices-adoption button { justify-self: start; max-width: 100%; }
.lacuna-native-shell [hidden],.lacuna-plan0-surface [hidden] { display: none!important; }
.shell[data-lacuna-native=true] { display: block; padding: 0; max-width: none; gap: 0; }
.shell[data-lacuna-native=true][hidden] { display: none!important; }
.shell[data-lacuna-native=true] .lacuna-native-shell__body { align-items: stretch; }
.shell[data-lacuna-native=true] .lacuna-native-shell__rail { padding: 0; }
.shell[data-lacuna-native=true] .black-lab-rail {
  position: static!important; inset: auto!important; width: 100%!important;
  min-width: 0; max-width: none; transform: none!important;
  height: calc(100dvh - 56px); border-radius: 0; overflow: auto;
}
.shell[data-lacuna-native=true] .lacuna-native-shell__main { padding: 0; }
.shell[data-lacuna-native=true] .native-citadel-owned-content,.shell[data-lacuna-native=true] .conversation { min-width: 0; width: 100%; max-width: none; }
.shell[data-lacuna-native=true] .brand { padding: 0!important; border: 0; min-height: 36px!important; height: auto; }
.shell[data-lacuna-native=true] .lacuna-native-shell__header { min-height: 56px!important; height: 56px; flex-wrap: nowrap; }
.shell[data-lacuna-native=true] .brand { height: 36px!important; width: auto!important; margin: 0!important; display: flex!important; }
.shell[data-lacuna-native=true] .brand-mark { height: 32px!important; width: 32px!important; font-size: 32px!important; line-height: 1; }
.shell[data-lacuna-native=true] .black-lab-rail { grid-template-rows: minmax(0,1fr) auto!important; }
.shell[data-lacuna-native=true] .black-lab-rail > .domain-context-rail { grid-row: 1!important; }
.shell[data-lacuna-native=true] #blackLabIdentityFooter { grid-row: 2!important; }
.shell[data-lacuna-native=true] #labDomainContent { max-width: none!important; margin: 0!important; width: 100%; }
.shell[data-lacuna-native=true] .brand-lockup > div > span { display: none; }
.shell[data-lacuna-native=true] .brand-controls { display: none; }
.shell[data-lacuna-native=true] .lab-domain-detail[data-native-intake=true] { display: block!important; padding: 20px; max-width: none; width: 100%; }
.lacuna-plan0-surface > button { width: fit-content; max-width: 100%; justify-self: start; }
.native-intake-advanced { margin-top: 20px; border-top: 1px solid var(--workspace-line); }
.native-intake-advanced > summary { min-height: 40px; padding: 8px 0; color: var(--workspace-muted); }
/* Main installs HEADER, optional STATUS and BODY, without a footer. Explicit
   rows keep BODY in the remaining viewport track when STATUS is hidden. Only
   Chat needs a bounded feed/composer viewport; Lab/Forge keep their own flow. */
.shell[data-lacuna-native=true][data-product-mode=chat] > .lacuna-native-shell {
  display: grid; height: 100dvh; block-size: 100dvh; min-height: 0;
  grid-template-rows: 56px auto minmax(0,1fr); overflow: hidden;
}
.shell[data-lacuna-native=true][data-product-mode=chat] .lacuna-native-shell__header { grid-row: 1; }
.shell[data-lacuna-native=true][data-product-mode=chat] .lacuna-native-shell__status { grid-row: 2; }
.shell[data-lacuna-native=true][data-product-mode=chat] .lacuna-native-shell__body {
  grid-row: 3; position: relative; min-height: 0; height: 100%; overflow: hidden;
}
.shell[data-lacuna-native=true][data-product-mode=chat] .lacuna-native-shell__main,
.shell[data-lacuna-native=true][data-product-mode=chat] .native-citadel-owned-content,
.shell[data-lacuna-native=true][data-product-mode=chat] .conversation {
  min-height: 0; min-block-size: 0; height: 100%; block-size: 100%; overflow: hidden;
}
.shell[data-lacuna-native=true][data-product-mode=chat] .black-lab-rail {
  min-height: 0; height: 100%; block-size: 100%;
}
.shell[data-lacuna-native=true][data-product-mode=chat] #chatRoomTruth {
  min-height: 0; overflow-y: auto;
}
@media (max-width: 900px) {
  .lacuna-native-shell__header { flex-wrap: wrap; gap: 8px; }
  .lacuna-native-shell__brand { width: auto; }
  .lacuna-native-shell__tabs { flex: 1; }
  .lacuna-native-shell__rail-toggle { font-size: 12px; }
  .lacuna-native-shell__body,.lacuna-native-shell[data-context=true] .lacuna-native-shell__body,
  .lacuna-native-shell[data-compact=true] .lacuna-native-shell__body,
  .lacuna-native-shell[data-compact=true][data-context=true] .lacuna-native-shell__body { grid-template-columns: 64px minmax(0,1fr); }
  .lacuna-native-shell__context { grid-column: 2; border-left: 0; border-top: 1px solid var(--workspace-line); }
}
@media (max-width: 560px) {
  .lacuna-native-shell__header { padding: 8px; }
  .lacuna-native-shell__brand { display: none; }
  .lacuna-native-shell__tabs { width: 100%; flex: 1 1 100%; flex-wrap: nowrap; }
  .lacuna-native-shell__tab { flex: 1; padding: 6px 8px; }
  .shell[data-lacuna-native=true][data-product-mode=chat] .lacuna-native-shell__rail-toggle { display: none; }
  .shell[data-lacuna-native=true][data-product-mode=chat] .lacuna-native-shell__tab {
    white-space: nowrap; overflow-wrap: normal; word-break: normal;
  }
  /* Own the three mode tracks under native Chat: generic nav/button flex
     specificity must not collapse them to their padding-only width at320. */
  .shell[data-lacuna-native=true][data-product-mode=chat] .lacuna-native-shell__header > .lacuna-native-shell__tabs {
    display: grid; grid-template-columns: repeat(3,minmax(0,1fr));
    flex: 1 1 auto; min-width: 0; width: 100%; gap: 4px;
  }
  .shell[data-lacuna-native=true][data-product-mode=chat] .lacuna-native-shell__tabs > .lacuna-native-shell__tab {
    min-width: 0; width: 100%; min-height: 44px; padding: 6px 4px;
  }
  .shell[data-lacuna-native=true][data-product-mode=chat] .chat-command-title {
    font-size: 18px; line-height: 1.3; display: -webkit-box;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  }
  .shell[data-lacuna-native=true][data-product-mode=chat] .studio-chat-tabs {
    display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 2px;
  }
  .shell[data-lacuna-native=true][data-product-mode=chat] .studio-chat-tabs > button {
    min-width: 0; padding-inline: 2px; font-size: 12px; white-space: nowrap;
  }
  .lacuna-native-shell__body,.lacuna-native-shell[data-context=true] .lacuna-native-shell__body,
  .lacuna-native-shell[data-compact=true] .lacuna-native-shell__body,
  .lacuna-native-shell[data-compact=true][data-context=true] .lacuna-native-shell__body { grid-template-columns: minmax(0,1fr); }
  .lacuna-native-shell__rail { border-right: 0; border-bottom: 1px solid var(--workspace-line); }
  .lacuna-native-shell[data-compact=true] .lacuna-native-shell__rail { display: none; }
  .lacuna-native-shell__main { padding: 12px; }
  .lacuna-native-shell__context { grid-column: 1; }
  .lacuna-plan0-surface textarea,.lacuna-plan0-surface input,.lacuna-plan0-surface select { font-size: 16px; }
  /* Reuse the existing drawer flag and original rail. A full rail must not
     consume a flow row before the conversation on a narrow Chat viewport. */
  .shell[data-lacuna-native=true][data-product-mode=chat] .lacuna-native-shell__main { grid-row: 1; grid-column: 1; }
  .shell[data-lacuna-native=true][data-product-mode=chat] .lacuna-native-shell__rail { display: none; }
  .shell[data-lacuna-native=true][data-product-mode=chat][data-chat-rail-drawer=open] .lacuna-native-shell__rail {
    display: block; position: absolute; inset: 0 auto 0 0; z-index: 120;
    width: min(86vw,320px); height: 100%; overflow: auto;
    background: var(--workspace-panel); border-right: 1px solid var(--workspace-line);
  }
}
@media (pointer: coarse) {
  .lacuna-native-shell,.lacuna-plan0-surface { --lacuna-control: 44px; }
  .lacuna-plan0-surface .lab-question-card__option,.lacuna-plan0-surface .lab-question-card__custom { min-height: 44px; }
}

/* R7 canonical left navigation. Scoped to this renderer, not data owners. */
.shell[data-lacuna-native=true] > .lacuna-native-shell[data-design=lacuna-r7] {
  display:grid!important;height:100dvh;min-height:0;grid-template-rows:auto minmax(0,1fr);overflow:hidden;
}
.lacuna-native-shell[data-design=lacuna-r7] > .lacuna-native-shell__status { grid-row:1; }
.lacuna-native-shell[data-design=lacuna-r7] > .lacuna-native-shell__body { grid-row:2;min-height:0;height:100%;grid-template-columns:224px minmax(0,1fr); }
.shell[data-lacuna-native=true] > .lacuna-native-shell[data-design=lacuna-r7] > .lacuna-native-shell__body { grid-row:2; }
.shell[data-lacuna-native=true] > .lacuna-native-shell[data-design=lacuna-r7] > .lacuna-native-shell__status { grid-row:1; }
.lacuna-native-shell[data-design=lacuna-r7] > .lacuna-native-shell__version { grid-row:3; }
.lacuna-native-shell[data-design=lacuna-r7][data-context=true] > .lacuna-native-shell__body { grid-template-columns:224px minmax(0,1fr) 320px; }
.lacuna-native-shell[data-design=lacuna-r7][data-compact=true] > .lacuna-native-shell__body { grid-template-columns:76px minmax(0,1fr); }
.lacuna-native-shell[data-design=lacuna-r7][data-compact=true][data-context=true] > .lacuna-native-shell__body { grid-template-columns:76px minmax(0,1fr) 320px; }
.lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__rail { display:flex;flex-direction:column;min-height:0;padding:12px;border-right:1px solid var(--workspace-line);overflow:auto; }
.lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__rail-chrome { flex:0 0 auto;margin-bottom:12px; }
.shell[data-lacuna-native=true] .lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__header { height:52px!important;min-height:52px!important;padding:0;border:0;gap:8px; }
.lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__rail-toggle { margin-left:auto;min-width:32px;padding:4px;font-size:0; }
.lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__rail-toggle::before { content:"«";font-size:20px; }
.lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__rail-toggle::before { content:"»"; }
.lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__tabs { display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;width:100%;padding:8px 0 12px;border-bottom:1px solid var(--workspace-line); }
.lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__tab { min-width:0;width:100%;height:44px;min-height:44px;padding:5px 2px;font-size:11px;white-space:nowrap; }
.lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__tab { display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px; }
.shell[data-lacuna-native=true] .lacuna-native-shell[data-design=lacuna-r7] button.lacuna-native-shell__tab,
.shell[data-lacuna-native=true] .lacuna-native-shell[data-design=lacuna-r7] button.lacuna-native-shell__rail-toggle { background:var(--workspace-panel);color:var(--workspace-text);border:1px solid var(--workspace-line);border-radius:8px; }
.shell[data-lacuna-native=true] .lacuna-native-shell[data-design=lacuna-r7] button.lacuna-native-shell__tab[aria-current=page] { color:var(--workspace-blue);border-color:var(--workspace-blue);background:var(--workspace-raised); }
.lacuna-native-shell__mode-mark { font-size:18px;line-height:18px; }
.lacuna-native-shell__mode-label { font-size:10px;line-height:12px; }
.lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__mode-label { display:none; }
.lacuna-native-shell[data-design=lacuna-r7] button:focus-visible { outline:2px solid var(--workspace-blue);outline-offset:-3px; }
.lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__tabs { grid-template-columns:minmax(0,1fr); }
.lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__brand { display:flex;width:32px;min-width:32px; }
.lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__brand .brand-lockup > div { display:none; }
.lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__header { gap:0!important; }
.lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__rail-toggle { min-width:20px;width:20px;padding:0; }
.shell[data-lacuna-native=true] .lacuna-native-shell[data-design=lacuna-r7] .black-lab-rail { height:auto!important;min-height:0;flex:1;overflow:auto;border:0; }
.lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__main { min-height:0;overflow:hidden;padding:0; }
.lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__context { padding:16px;min-height:0;overflow:auto; }
@media(max-width:1100px){
  .lacuna-native-shell[data-design=lacuna-r7][data-context=true] > .lacuna-native-shell__body { grid-template-columns:224px minmax(0,1fr) 260px; }
  .lacuna-native-shell[data-design=lacuna-r7][data-compact=true][data-context=true] > .lacuna-native-shell__body { grid-template-columns:76px minmax(0,1fr) 260px; }
  .lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__context { grid-column:3; }
}
@media(max-width:800px){.lacuna-native-shell[data-design=lacuna-r7][data-context=true] > .lacuna-native-shell__body,.lacuna-native-shell[data-design=lacuna-r7][data-compact=true][data-context=true] > .lacuna-native-shell__body{grid-template-columns:76px minmax(0,1fr);grid-template-rows:minmax(180px,1fr) auto;}.lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__context{grid-column:2;grid-row:2;max-height:35vh;}.lacuna-native-shell[data-design=lacuna-r7][data-context=true] .lacuna-native-shell__rail{grid-row:1/-1;}}
@media(max-width:560px){
  .lacuna-native-shell[data-design=lacuna-r7] > .lacuna-native-shell__body,
  .lacuna-native-shell[data-design=lacuna-r7][data-context=true] > .lacuna-native-shell__body,
  .lacuna-native-shell[data-design=lacuna-r7][data-compact=true] > .lacuna-native-shell__body,
  .lacuna-native-shell[data-design=lacuna-r7][data-compact=true][data-context=true] > .lacuna-native-shell__body { grid-template-columns:minmax(0,1fr); }
  .shell[data-lacuna-native=true] > .lacuna-native-shell[data-design=lacuna-r7] > .lacuna-native-shell__body { grid-template-rows:auto minmax(0,1fr); }
  .shell[data-lacuna-native=true] .lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__rail { display:flex;grid-row:1;grid-column:1;max-height:45dvh;padding:6px 12px;border-right:0;border-bottom:1px solid var(--workspace-line); }
  .shell[data-lacuna-native=true] .lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__main { grid-row:2;grid-column:1; }
  .lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__rail-chrome { margin-bottom:0; }
  .shell[data-lacuna-native=true] .lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__header { height:32px!important;min-height:32px!important; }
  .shell[data-lacuna-native=true] .lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__rail-toggle { display:block;min-width:36px;width:36px; }
  .lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__brand { width:auto; }
  .lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__brand .brand-lockup > div { display:block; }
  .lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__tabs,.lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__tabs { grid-template-columns:repeat(3,minmax(0,1fr));padding:4px 0 0;border:0; }
  .lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__mode-label { display:block; }
  .shell[data-lacuna-native=true] .lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .black-lab-rail { display:none; }
  .lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__context { grid-column:1;grid-row:3;max-height:35vh; }
  .shell[data-lacuna-native=true][data-chat-rail-drawer=open] .lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__rail { display:flex;position:absolute;inset:0 auto 0 0;width:min(86vw,280px);z-index:120;background:var(--workspace-bg); }
  .shell[data-lacuna-native=true][data-chat-rail-drawer=open] .lacuna-native-shell[data-design=lacuna-r7] .black-lab-rail { display:grid; }
}

/* Main's canonical catalogue already lives inside the padded r7 rail. Avoid
   applying the old full-page domain/card insets a second time to its slots. */
.lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__rail .domain-context-rail { padding:0!important; }
.lacuna-native-shell[data-design=lacuna-r7] .lacuna-native-shell__rail .chat-command-rooms { padding:0; }
.lacuna-native-shell[data-design=lacuna-r7] .chat-command-room-toolbar__heading { display:grid;gap:4px; }
.lacuna-native-shell[data-design=lacuna-r7] .chat-command-room-toolbar__heading > strong { white-space:nowrap; }

/* A76px outer compact rail cannot contain the legacy76px inner rail plus
   another padding layer. Size native slots to the available inner width. */
@media(min-width:561px) {
  .lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__rail { padding:12px 6px; }
  .lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .black-lab-rail { grid-template-columns:minmax(0,1fr)!important; }
  .lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__brand > .brand { width:100%;min-width:0;max-width:100%; }
  .lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .lacuna-native-shell__brand .brand-controls { display:none; }
  .lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .black-lab-rail :is(.domain-context-rail,.black-lab-identity-footer) { width:100%!important;min-width:0;max-width:100%; }
  .lacuna-native-shell[data-design=lacuna-r7][data-compact=true] .black-lab-identity-footer .account-control { width:100%;min-width:0;max-width:100%; }
}

/* V8.1 visual projection. The parent still owns theme tokens, product slots,
   routes, compact preference, drawer scope and all authenticated data. */
.lacuna-native-shell[data-visual-version="v8.1"] { --lacuna-control:36px;--lacuna-radius:8px;--lacuna-space:16px;font-family:"Segoe UI",Arial,sans-serif;font-size:14px;line-height:1.5; }
.lacuna-native-shell[data-visual-version="v8.1"]>.lacuna-native-shell__body { grid-template-columns:224px minmax(0,1fr); }
.lacuna-native-shell[data-visual-version="v8.1"][data-context=true]>.lacuna-native-shell__body { grid-template-columns:224px minmax(0,1fr) 330px; }
.lacuna-native-shell[data-visual-version="v8.1"][data-compact=true]>.lacuna-native-shell__body { grid-template-columns:76px minmax(0,1fr); }
.lacuna-native-shell[data-visual-version="v8.1"][data-compact=true][data-context=true]>.lacuna-native-shell__body { grid-template-columns:76px minmax(0,1fr) 330px; }
.lacuna-native-shell[data-visual-version="v8.1"] .lacuna-native-shell__rail { padding:12px; }
.lacuna-native-shell__citadel-mark { display:grid;place-items:center;flex:none;width:32px;height:34px;color:var(--workspace-blue); }
.lacuna-native-shell[data-visual-version="v8.1"] .lacuna-native-shell__brand { gap:8px;min-width:0; }
.lacuna-native-shell[data-visual-version="v8.1"] .lacuna-native-shell__brand .brand-mark { display:none!important; }
.lacuna-native-shell[data-visual-version="v8.1"] .lacuna-native-shell__brand .brand-lockup { gap:0; }
.lacuna-native-shell[data-visual-version="v8.1"] .lacuna-native-shell__mode-label { font-size:11px;line-height:14px; }
.lacuna-native-shell[data-visual-version="v8.1"] .lacuna-native-shell__tab { height:50px;min-height:50px;gap:4px; }
.lacuna-native-shell[data-visual-version="v8.1"] .lacuna-native-shell__rail-toggle { border-color:transparent!important;background:transparent!important; }
.lacuna-native-shell[data-visual-version="v8.1"] .lacuna-native-shell__context { padding:16px;min-width:0; }
.lacuna-native-shell[data-visual-version="v8.1"] .lacuna-native-shell__version { font-size:11px;padding:8px 12px; }
.lacuna-native-shell[data-visual-version="v8.1"][data-compact=true] .lacuna-native-shell__brand> :not(.lacuna-native-shell__citadel-mark) { display:none; }
.lacuna-native-shell[data-visual-version="v8.1"][data-compact=true] .lacuna-native-shell__rail { padding:12px 6px; }
@media(max-width:1200px){
  .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]>.lacuna-native-shell__body{grid-template-columns:224px minmax(0,1fr) 290px}
  .lacuna-native-shell[data-visual-version="v8.1"][data-compact=true][data-context=true]>.lacuna-native-shell__body{grid-template-columns:76px minmax(0,1fr) 290px}
}
@media(max-width:800px){
  .lacuna-native-shell[data-visual-version="v8.1"]>.lacuna-native-shell__body,.lacuna-native-shell[data-visual-version="v8.1"][data-context=true]>.lacuna-native-shell__body,.lacuna-native-shell[data-visual-version="v8.1"][data-compact=true]>.lacuna-native-shell__body,.lacuna-native-shell[data-visual-version="v8.1"][data-compact=true][data-context=true]>.lacuna-native-shell__body{grid-template-columns:76px minmax(0,1fr)}
}
@media(max-width:560px){
  .lacuna-native-shell[data-visual-version="v8.1"]>.lacuna-native-shell__body,.lacuna-native-shell[data-visual-version="v8.1"][data-context=true]>.lacuna-native-shell__body,.lacuna-native-shell[data-visual-version="v8.1"][data-compact=true]>.lacuna-native-shell__body,.lacuna-native-shell[data-visual-version="v8.1"][data-compact=true][data-context=true]>.lacuna-native-shell__body{grid-template-columns:minmax(0,1fr)}
  .shell[data-lacuna-native=true] .lacuna-native-shell[data-visual-version="v8.1"] .lacuna-native-shell__rail{padding:6px 12px}
  .lacuna-native-shell[data-visual-version="v8.1"] .lacuna-native-shell__tab{height:44px;min-height:44px}
  .lacuna-native-shell[data-visual-version="v8.1"][data-compact=true] .lacuna-native-shell__brand> :not(.lacuna-native-shell__citadel-mark){display:flex}
}
@media(pointer:coarse){.lacuna-native-shell[data-visual-version="v8.1"]{--lacuna-control:44px}}

/* Exact/current HOLD presentation only; no global status palette or readiness. */
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true][data-product-mode=project]) .domain-rail-item[data-current=true][data-execution-state=hold] .domain-rail-meta { color:var(--amber); }
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .forge-execution-workspace .forge-execution-next--hold { min-width:0; padding:10px 12px; border-inline-start:3px solid var(--amber); background:var(--surface); }
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .forge-execution-workspace .forge-execution-next--hold .domain-kicker { color:var(--amber); }
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .forge-execution-workspace .forge-execution-next--hold :is(strong,p,button) { max-width:100%; overflow-wrap:anywhere; }
/* HOLD cause/owner/navigation is one existing block, not another status frame. */
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .forge-execution-workspace .forge-hold-facts { display:grid; grid-template-columns:48px minmax(0,1fr); gap:6px 10px; margin:8px 0; font-size:12px; }
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .forge-execution-workspace .forge-hold-facts :is(dt,dd) { margin:0; min-width:0; white-space:normal; overflow-wrap:anywhere; }
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .forge-execution-workspace .forge-hold-cause { border:0; padding:0; background:transparent; }
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .forge-execution-workspace .forge-hold-cause > summary { min-height:36px; cursor:pointer; }
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .forge-execution-workspace .forge-hold-cause__copy { display:block; line-height:1.5; white-space:normal; overflow-wrap:anywhere; }
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .forge-execution-workspace :is(.forge-hold-technical,.forge-hold-maintenance,.forge-execution-maintenance-note) { font-size:11px; color:var(--workspace-muted); overflow-wrap:anywhere; }
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .forge-execution-workspace :is(.forge-hold-native-summary,.forge-hold-native-blocker) { white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:760px) { :where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .forge-execution-workspace .forge-hold-cause > summary { min-height:44px; } }

/* Execution task summary presentation only. Full exact label remains first in body.
   Keep before component/layout guards; native details/current-task ownership is unchanged. */
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .forge-execution-workspace .forge-execution-task__label { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; max-block-size:2.9em; overflow:hidden; line-height:1.45; white-space:normal; word-break:normal; overflow-wrap:break-word; }
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .forge-execution-workspace .forge-execution-task__full-label { margin:0; white-space:pre-wrap; word-break:normal; overflow-wrap:break-word; }

/* Native question presentation: Rick Native Lab/Forge, independent of r6 context.
   :where() adds the namespace without increasing original selector specificity.
   Keep this component section BEFORE the guarded Native56 layout-r1 addendum. */
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-briefing-disclosure {border:1px solid var(--workspace-line,var(--line,#294044));border-radius:10px;background:var(--workspace-panel,var(--panel-strong,#102129));box-shadow:none}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-briefing-disclosure>summary {min-height:56px;padding:14px 16px;gap:12px;cursor:pointer;list-style:none}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-briefing-disclosure>summary::-webkit-details-marker {display:none}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-briefing-disclosure>summary::after {content:'⌄';margin-left:auto;color:var(--muted,#9eb2b6);font-size:20px;flex-shrink:0}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-briefing-disclosure[open]>summary::after {transform:rotate(180deg)}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-briefing-disclosure[open]>summary {border-bottom:1px solid var(--workspace-line,var(--line,#294044))}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-briefing-item__heading-copy {min-width:0;gap:7px}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-briefing-item__heading-copy strong {font-size:14px;line-height:1.5;overflow-wrap:anywhere}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-briefing-item__state {font-size:11px;gap:6px}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-briefing-item__body {padding:0 16px 16px;background:transparent}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card {border:0;border-radius:0;background:transparent;padding:14px 0 0;box-shadow:none;gap:12px}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card__options {gap:3px;border:0;padding:0;margin:0;min-width:0}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card__option {border-radius:7px;padding:9px 10px;border-color:transparent;min-height:44px;background:transparent}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card__option[data-selected="true"] {background:var(--workspace-soft,var(--soft,#173b38));border-color:var(--workspace-line,var(--line,#294044))}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card__custom {border-top:1px solid var(--workspace-line,var(--line,#294044));padding-top:12px}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card__ownership {border-top:1px solid var(--workspace-line,var(--line,#294044));padding-top:12px;color:var(--muted,#9eb2b6);font-size:12px;line-height:1.5}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card__retained {opacity:.85;resize:vertical}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card__actions {position:sticky;bottom:0;padding:10px 0;background:var(--workspace-panel,var(--panel-strong,#102129));margin-top:8px;z-index:1}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card__hint,
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card__status,
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card__error {font-size:12px;line-height:1.6}
:where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card[aria-busy="true"] .lab-question-card__status {opacity:.8}
@media(max-width:700px){
  :where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-briefing-disclosure>summary{padding:12px;align-items:flex-start}
  :where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-briefing-item__body{padding:0 12px 12px}
  :where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-briefing-item__state{flex-wrap:wrap}
  :where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card__actions{display:flex;flex-wrap:wrap;gap:8px}
  :where(.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project])) .lab-question-card textarea{width:100%;max-width:100%;box-sizing:border-box}
}

/* R17-API1 component BEGIN: additional selected-version view.
   Component-owned rules stay before guarded shell/layout/sidebar addenda. */
.lab-plan-api-read .p17-pilot{--p17-cyan:var(--lab-tone,var(--accent));height:100%;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:var(--bg)}
.p17-catalog-item{display:flex;gap:10px;align-items:center;width:100%;border:1px solid var(--line);border-radius:10px;padding:13px 10px;background:var(--soft);color:var(--text);text-align:left;font:inherit;cursor:pointer}.p17-catalog-item>svg{width:20px;height:20px;flex:none;color:var(--accent)}.p17-catalog-item strong{display:block;font-size:11px;line-height:1.5}.p17-catalog-item small{display:block;font-size:9px;color:var(--muted);margin-top:5px}.p17-catalog-note{font-size:9px;line-height:1.8;color:var(--muted);padding:6px}
.catalog .p17-catalog-item{margin-bottom:10px}.p17-legacy-label{font-size:9px!important;line-height:1.7;color:var(--muted);border:1px solid var(--line);border-radius:6px;padding:6px 9px;margin:8px 0 0}.p17-entry+ .r15-entry{margin-top:5px}
.r17-obligations{border-block:1px solid var(--line);font-size:11px;line-height:1.7;margin:16px 0;padding:7px 0}.r17-obligations>summary{cursor:pointer;min-height:32px;padding:5px 0;font-weight:500}.r17-obligations article{padding:10px 0}.r17-obligations article+article{border-top:1px solid var(--line)}.r17-obligations strong{font-size:11px;font-weight:500;white-space:pre-wrap}.r17-obligations small{display:block;color:var(--forge-tone);font-size:10px;margin:5px 0}.r17-obligations p{margin:5px 0;font-size:10px}.r17-obligations b{font-weight:500}.r17-obligations details{font-size:9px;color:var(--muted)}.r17-obligations code{overflow-wrap:anywhere}
.lab-plan-api-read .p17-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;padding:22px 28px 18px;flex:none;background:radial-gradient(ellipse at 95% 0,color-mix(in srgb,var(--p17-cyan) 7%,transparent),transparent 70%)}
.p17-heading{min-width:0}.p17-heading>p{display:flex;align-items:center;gap:7px;font-size:10px;color:var(--p17-cyan);margin:0 0 9px}.p17-heading>p svg{width:14px;height:14px}.p17-heading h1{font-size:clamp(24px,2.5vw,32px);line-height:1.2;letter-spacing:-.03em;margin:0 0 12px;overflow-wrap:anywhere}
.p17-head-tags{display:flex;gap:8px 13px;flex-wrap:wrap;align-items:center;font-size:10px;line-height:1.6;color:var(--muted)}.p17-snapshot{display:flex;gap:5px;align-items:center;color:var(--p17-cyan)}.p17-snapshot svg{width:13px;height:13px}
.p17-header-side{display:grid;gap:10px;min-width:180px;max-width:30%;font-size:10px;line-height:1.6;color:var(--muted);text-align:right}.p17-header-side>span{font-size:9px;border:1px solid var(--line);border-radius:20px;padding:5px 9px;margin-left:auto}.p17-header-side details{max-width:100%}.p17-header-side summary{cursor:pointer;display:flex;align-items:center;justify-content:flex-end;gap:7px}.p17-header-side svg{width:12px;height:12px}.p17-header-side code{display:block;overflow-wrap:anywhere;font-size:9px;margin-top:6px}.p17-header-side small{display:block;margin-top:8px}
.lab-plan-api-read .p17-surfaces{display:flex;gap:0;padding:0 25px;border-bottom:1px solid var(--line);flex:none}.lab-plan-api-read .p17-surfaces .button{border:0;border-bottom:2px solid transparent;border-radius:0;background:none;font-size:12px;padding:11px 19px;min-height:44px;color:var(--muted)}.lab-plan-api-read .p17-surfaces .button[aria-current=page]{border-bottom-color:var(--p17-cyan);color:var(--text)}
.p17-current{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:14px 28px 10px;font-size:11px;line-height:1.6;color:var(--text);flex:none}.p17-current>span:first-child{display:flex;align-items:center;gap:7px}.p17-current>span:last-child{font-size:9px;color:var(--muted)}.p17-current svg{width:15px;height:15px;color:var(--p17-cyan)}
.lab-plan-api-read .p17-rail{position:relative;isolation:isolate;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:0 28px;flex:none;border-bottom:1px solid var(--line)}.p17-rail:before{content:"";position:absolute;height:1px;background:var(--line);top:18px;left:14%;right:14%;z-index:-1}.lab-plan-api-read .p17-rail button{background:transparent;border:0;border-bottom:2px solid transparent;color:var(--muted);font:inherit;font-size:11px;cursor:pointer;padding:0 4px 10px;display:flex;align-items:center;flex-direction:column;gap:4px;min-width:0;min-height:80px}.p17-rail button>span{display:grid;place-items:center;width:37px;height:37px;border:1px solid var(--line-strong);border-radius:50%;background:var(--bg)}.p17-rail svg{width:18px;height:18px}.p17-rail strong{font-size:10px;font-weight:500}.p17-rail small{font-size:10px}.lab-plan-api-read .p17-rail button[data-current=true]{color:var(--p17-cyan)}.lab-plan-api-read .p17-rail button[data-current=true]>span{border-color:var(--p17-cyan);box-shadow:0 0 0 4px color-mix(in srgb,var(--p17-cyan) 8%,transparent)}.lab-plan-api-read .p17-rail button[aria-pressed=true]{border-bottom-color:var(--text);color:var(--text)}
.lab-plan-api-read .p17-body{flex:1;min-height:0;overflow:auto;padding:20px 28px 30px;overscroll-behavior:contain}.p17-toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;color:var(--muted);font-size:10px;margin-bottom:16px}.p17-toolbar .button{font-size:10px;min-height:32px;padding:5px 9px}.p17-layout{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(220px,1fr);gap:24px;max-width:1200px;margin:auto}.p17-content,.p17-context{min-width:0}.p17-pilot[data-p17-focus=artifact] .p17-layout{grid-template-columns:1fr;max-width:900px}.p17-pilot[data-p17-focus=artifact] .p17-context{display:none}
.p17-section{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:20px;margin:0 0 18px;min-width:0}.p17-section-title{display:flex;gap:9px;align-items:center;flex-wrap:wrap;margin-bottom:15px}.p17-section-title>svg{width:18px;height:18px;color:var(--p17-cyan);flex:none}.p17-section-title h2{font-size:18px;line-height:1.35;margin:0;letter-spacing:-.02em;font-weight:550}.p17-tag{font-size:9px;color:var(--muted);padding:4px 7px;border-radius:20px;border:1px solid var(--line);margin-left:auto}.p17-muted{color:var(--muted);font-size:11px;line-height:1.7;overflow-wrap:anywhere}.p17-section blockquote{border-left:2px solid var(--p17-cyan);padding-left:14px;margin:15px 0;font-size:13px;line-height:1.8;white-space:pre-wrap}
.p17-unknown{display:flex;gap:11px;align-items:flex-start;font-size:12px;line-height:1.75;padding:13px 0}.p17-unknown>svg{width:18px;height:18px;flex:none;color:var(--muted);margin-top:2px}.p17-unknown strong{font-size:13px;font-weight:500}.p17-unknown p{font-size:11px;color:var(--muted);margin:6px 0 0;max-width:65ch}
.p17-source-chain{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:17px 0}.p17-source-chain>div{display:flex;gap:8px;align-items:center;background:var(--bg);border:1px solid var(--line);padding:11px;border-radius:8px;min-width:0}.p17-source-chain>div>span{color:var(--p17-cyan);flex:none}.p17-source-chain svg{width:18px;height:18px}.p17-source-chain strong,.p17-source-chain small{display:block;overflow-wrap:anywhere}.p17-source-chain strong{font-size:11px;font-weight:500}.p17-source-chain small{font-size:9px;color:var(--muted);margin-top:4px}
.p17-details{font-size:10px;line-height:1.8;color:var(--muted);margin-top:15px;border-top:1px solid var(--line);padding-top:5px}.p17-details>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;cursor:pointer;min-height:36px;list-style:none}.p17-details svg{width:13px;height:13px;flex:none}.p17-details code{display:block;font-size:9px;line-height:1.7;overflow-wrap:anywhere;margin-top:4px}.p17-details p{font-size:11px}.p17-context>section{margin:0 0 18px;padding-bottom:15px;border-bottom:1px solid var(--line)}.p17-context h3{font-size:13px;font-weight:550;margin:0 0 9px}.p17-context p{font-size:11px;line-height:1.8;color:var(--muted);margin:0 0 12px}.p17-axis{display:grid;grid-template-columns:1fr auto;gap:7px;font-size:10px}.p17-axis span{color:var(--muted)}.p17-axis strong{font-weight:500}
.p17-gate{display:flex;align-items:flex-start;gap:10px;padding:15px 0;border-top:1px solid var(--line);font-size:11px;line-height:1.75}.p17-gate>span{color:var(--forge-tone);flex:none}.p17-gate svg{width:18px;height:18px}.p17-gate strong{font-weight:550;font-size:12px}.p17-gate p{margin:5px 0;color:var(--muted)}.p17-gate small{display:block;font-size:10px;color:var(--muted);margin-top:6px}
.p17-summary{padding:0 0 18px;margin-bottom:18px;border-bottom:1px solid var(--line)}.p17-summary-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:14px}.p17-summary-head>span{display:flex;gap:8px;align-items:center;font-size:15px;font-weight:500}.p17-summary-head svg{width:18px;height:18px;color:var(--p17-cyan)}.p17-summary .button{font-size:10px;min-height:32px;padding:5px 9px}.p17-facts{display:grid;gap:0}.p17-facts>div{display:flex;justify-content:space-between;gap:14px;font-size:12px;line-height:1.6;padding:11px 0;border-top:1px solid var(--line)}.p17-facts span{color:var(--muted)}.p17-facts strong{font-weight:500;text-align:right}.p17-summary>p{font-size:10px;line-height:1.8;color:var(--muted);margin:12px 0 0}
.p17-readonly-row{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:12px;margin-top:12px;font-size:9px;color:var(--muted)}.p17-readonly-row>span:first-child{display:flex;gap:6px;align-items:center}.p17-readonly-row svg{width:13px;height:13px}.p17-job{white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.8 system-ui,sans-serif}.p17-event{display:flex;gap:11px;padding:15px 0;border-top:1px solid var(--line);min-width:0}.p17-event>span{color:var(--p17-cyan);flex:none}.p17-event svg{width:17px;height:17px}.p17-event>div{min-width:0}.p17-event strong,.p17-event small{display:block}.p17-event strong{font-size:12px;font-weight:500}.p17-event small{font-size:10px;color:var(--muted);margin-top:5px}.p17-event p{font-size:11px;line-height:1.8;color:var(--muted);margin:8px 0 0}.p17-event code{font-size:9px;overflow-wrap:anywhere}.p17-local-links{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.p17-local-links .button{font-size:10px;min-height:33px;padding:6px 9px}
.p17-footer{display:flex;gap:7px;align-items:center;justify-content:flex-end;padding:8px 16px;border-top:1px solid var(--line);font-size:8px;color:var(--muted);flex:none;line-height:1.6}.p17-footer svg{width:12px;height:12px}
@media(max-width:1050px){.p17-layout{grid-template-columns:1fr}.p17-context{display:grid;grid-template-columns:1fr 1fr;gap:15px}.p17-context>.p17-details{grid-column:1/-1}.p17-source-chain{grid-template-columns:1fr 1fr 1fr}}
@media(max-width:650px){.lab-plan-api-read .p17-header{padding:15px 16px 12px;display:block}.p17-heading h1{font-size:24px}.p17-heading>p{font-size:9px}.p17-head-tags{font-size:9px;gap:6px 10px}.p17-header-side{max-width:none;min-width:0;display:flex;gap:12px;align-items:center;text-align:left;margin-top:12px}.p17-header-side>span{margin:0;font-size:8px}.p17-header-side details{font-size:9px}.p17-header-side details[open]{max-width:100%;flex:1}.p17-header-side code{font-size:8px}.lab-plan-api-read .p17-surfaces{padding:0 8px}.lab-plan-api-read .p17-surfaces .button{padding:10px 12px;flex:1;font-size:11px}.p17-current{padding:11px 16px 8px;flex-wrap:wrap;font-size:10px}.p17-current>span:last-child{font-size:8px}.lab-plan-api-read .p17-rail{padding:0 12px}.lab-plan-api-read .p17-rail button{min-height:73px}.p17-rail button>span{width:33px;height:33px}.p17-rail:before{top:16px}.lab-plan-api-read .p17-body{padding:15px 16px 23px}.p17-section{padding:16px}.p17-section-title h2{font-size:17px}.p17-tag{font-size:8px}.p17-source-chain{grid-template-columns:1fr}.p17-context{display:block}.p17-footer{font-size:7px;justify-content:flex-start}.p17-facts>div{font-size:11px}.p17-toolbar{font-size:9px}.p17-summary-head>span{font-size:14px}}

/* Load after unchanged R17 pilot.css. No parent app permissions/action styling. */
.p17-api-read .p17-section code{display:block;white-space:pre-wrap;overflow-wrap:anywhere;font-size:10px;line-height:1.7;max-width:100%;margin:7px 0}
.p17-api-read .p17-section h3{font-size:13px;font-weight:500;margin:20px 0 8px}
.p17-api-read .p17-source-chain .button{font-size:10px;min-height:32px;max-width:100%;white-space:normal;padding:5px 7px;margin-top:8px}
.p17-api-read .p17-toolbar>.p17-local-links{margin:0}

.lab-plan-api-read{--accent:var(--workspace-blue,#58e2cb);--lab-tone:var(--accent);--forge-tone:var(--workspace-amber,#f2c65d);--soft:var(--workspace-soft,#13332f);min-width:0;margin-top:24px;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.lab-plan-api-read .p17-pilot{height:auto;max-height:none}
.lab-plan-api-read .p17-body{overflow:visible}
.lab-plan-api-read .button{font:inherit;color:inherit;border:1px solid var(--line);border-radius:8px;background:var(--panel);cursor:pointer}
.lab-plan-api-read .p17-rail button:focus-visible,.lab-plan-api-read .button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
/* R17-API1 component END. */

/* Forge focus r1: top modes, bounded reading canvas, one inline context.
   Original slots/controls and error states remain owned by their renderers. */
.shell[data-lacuna-native=true] > .lacuna-native-shell[data-layout=forge-focus-r1] {
  grid-template-rows:auto auto minmax(0,1fr) auto!important;
}
.lacuna-native-shell[data-layout=forge-focus-r1] > .lacuna-native-shell__topbar {
  grid-row:1; display:flex; align-items:center; gap:24px; padding:0 20px;
  min-height:64px; border-bottom:1px solid var(--workspace-line); min-width:0;
}
.shell[data-lacuna-native=true] .lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__header {
  width:204px; flex:0 0 204px; height:56px!important; gap:12px!important;
}
.lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__tabs {
  display:flex!important; grid-template-columns:none!important; padding:0; width:auto;
  flex-wrap:nowrap; gap:6px; border:0;
}
.shell[data-lacuna-native=true] .lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__tab {
  width:auto; min-width:88px; padding:8px 14px; flex-direction:row; gap:8px; font-size:14px;
}
.lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__mode-label { display:block!important; font-size:13px; line-height:1.3; }
.shell[data-lacuna-native=true] .lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__tab[data-mode=project][aria-current=page] {
  color:var(--workspace-amber); border-color:var(--workspace-amber);
}
.lacuna-native-shell[data-layout=forge-focus-r1] > .lacuna-native-shell__status { grid-row:2!important; }
.lacuna-native-shell[data-layout=forge-focus-r1] > .lacuna-native-shell__version { grid-row:4!important; }
.shell[data-lacuna-native=true] > .lacuna-native-shell[data-layout=forge-focus-r1] > .lacuna-native-shell__body {
  grid-row:3!important; min-height:0; width:100%; max-width:1840px; margin-inline:auto;
}
.lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__rail-chrome { margin:0; }
.lacuna-native-shell[data-layout=forge-focus-r1][data-compact=true] .lacuna-native-shell__brand .brand-lockup > div { display:block; }
.lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__brand .brand-controls { display:none; }
.lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__brand .brand-lockup > span { display:none; }
.lacuna-native-shell[data-layout=forge-focus-r1][data-compact=true] .lacuna-native-shell__brand { width:auto; min-width:0; }
@media(min-width:561px) {
  .shell[data-lacuna-native=true] > .lacuna-native-shell[data-layout=forge-focus-r1][data-compact=true]:not([data-context=true]) > .lacuna-native-shell__body { grid-template-columns:var(--native-catalog-width,160px) minmax(0,1fr)!important; }
}
.shell[data-lacuna-native=true] .lacuna-native-shell[data-layout=forge-focus-r1][data-compact=true] .black-lab-rail { width:100%!important; inline-size:100%!important; }
.lacuna-native-shell[data-layout=forge-focus-r1] .domain-rail-item { overflow-wrap:anywhere; word-break:normal; }
.lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__context { padding:16px; }
.lacuna-native-shell[data-layout=forge-focus-r1] .native-citadel-owned-content { min-width:0; }
.lacuna-native-shell[data-layout=forge-focus-r1] .studio-global-context { margin:0; padding:8px 20px; border:0; font-size:12px; }
.lacuna-native-shell[data-layout=forge-focus-r1] .forge-domain-detail.studio-layout {
  display:grid; grid-template-columns:minmax(0,1fr)!important; gap:16px; border:0; box-shadow:none;
  max-width:1100px; margin-inline:auto; width:100%; padding:16px 24px;
}
.lacuna-native-shell[data-layout=forge-focus-r1] .forge-domain-detail.studio-layout > .studio-context-inline {
  grid-column:1!important; grid-row:auto!important; position:static; max-height:none;
  padding:10px 0; border:0; border-top:1px solid var(--workspace-line); background:transparent;
}
.lacuna-native-shell[data-layout=forge-focus-r1] .studio-context-inline > .studio-context-title {
  font-size:13px; margin:0; min-height:36px; cursor:pointer; color:var(--workspace-muted);
}
.lacuna-native-shell[data-layout=forge-focus-r1] .studio-context-inline[open] > :not(summary) { margin-top:12px; }
.lacuna-native-shell[data-layout=forge-focus-r1] .forge-domain-detail .studio-header { margin:0; padding:0 0 12px; }
.lacuna-native-shell[data-layout=forge-focus-r1] .forge-domain-detail .studio-header h2 { font-size:clamp(22px,2vw,30px); line-height:1.3; overflow-wrap:anywhere; word-break:normal; }
.lacuna-native-shell[data-layout=forge-focus-r1] .forge-domain-detail .studio-tabs { gap:4px; flex-wrap:wrap; }
.lacuna-native-shell[data-layout=forge-focus-r1] .forge-domain-detail .studio-tab[aria-selected=true] { color:var(--workspace-amber); border-color:var(--workspace-amber); }
.lacuna-native-shell[data-layout=forge-focus-r1] .chat-conversation-text-disclosure { border:0; margin:4px 0; }
.lacuna-native-shell[data-layout=forge-focus-r1] .chat-conversation-text-disclosure > summary {
  display:flex; align-items:start; gap:8px; line-height:1.5; cursor:pointer;
  padding:8px 0; color:var(--workspace-muted); font-size:13px;
}
.lacuna-native-shell[data-layout=forge-focus-r1] .chat-conversation-text-disclosure__excerpt {
  min-width:0; flex:1; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden;
}
.lacuna-native-shell[data-layout=forge-focus-r1] .chat-conversation-text-disclosure > summary::after { content:"⌄"; flex:0 0 18px; font-size:18px; }
.lacuna-native-shell[data-layout=forge-focus-r1] .chat-conversation-text-disclosure[open] > summary::after { transform:rotate(180deg); }
.lacuna-native-shell[data-layout=forge-focus-r1] .chat-conversation-text-disclosure :is(.chat-command-card-copy,.message-body) { white-space:pre-wrap; overflow-wrap:anywhere; }
@media(min-width:1101px) {
  .lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-project-conversation[data-presentation=inline] .lacuna-project-conversation__content { height:calc(100dvh - 96px)!important; min-height:0; }
  .shell[data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-layout=forge-focus-r1][data-context=true] > .lacuna-native-shell__body {
    grid-template-columns:224px minmax(0,1fr) var(--native-context-width,clamp(360px,26vw,560px))!important;
  }
  .shell[data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-layout=forge-focus-r1][data-context=true][data-compact=true] > .lacuna-native-shell__body {
    grid-template-columns:var(--native-catalog-width,160px) minmax(0,1fr) var(--native-context-width,clamp(360px,26vw,560px))!important;
  }
  .shell[data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-layout=forge-focus-r1][data-context=true]:has(.lacuna-project-conversation[data-panel-width=wide]) > .lacuna-native-shell__body {
    grid-template-columns:224px minmax(0,1fr) var(--native-context-width,clamp(440px,32vw,660px))!important;
  }
  .shell[data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-layout=forge-focus-r1][data-context=true][data-compact=true]:has(.lacuna-project-conversation[data-panel-width=wide]) > .lacuna-native-shell__body {
    grid-template-columns:var(--native-catalog-width,160px) minmax(0,1fr) var(--native-context-width,clamp(440px,32vw,660px))!important;
  }
  .shell[data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-layout=forge-focus-r1][data-context=true]:has(.lacuna-project-conversation[data-presentation=inline] > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body {
    grid-template-columns:var(--native-catalog-width,224px) minmax(0,1fr)!important;
  }
  .shell[data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-layout=forge-focus-r1][data-context=true][data-compact=true]:has(.lacuna-project-conversation[data-presentation=inline] > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body {
    grid-template-columns:var(--native-catalog-width,160px) minmax(0,1fr)!important;
  }
}

/* Canonical Chat outer tracks R1: hidden project context cannot reserve space.
   The authoritative caller mode wins a stale Native mode/has-wide subtree.
   Inner ChatStudio remains its existing owner; no visibility/route mutation. */
@media(min-width:761px) {
  .shell[data-ui-edition="rick"][data-lacuna-native=true][data-product-mode=chat] > .lacuna-native-shell[data-layout=forge-focus-r1] > .lacuna-native-shell__body { grid-template-columns:224px minmax(0,1fr)!important; }
  .shell[data-ui-edition="rick"][data-lacuna-native=true][data-product-mode=chat] > .lacuna-native-shell[data-layout=forge-focus-r1][data-compact=true] > .lacuna-native-shell__body { grid-template-columns:76px minmax(0,1fr)!important; }
}
@media(max-width:760px) {
  .shell[data-ui-edition="rick"][data-lacuna-native=true][data-product-mode=chat] > .lacuna-native-shell[data-layout=forge-focus-r1] > .lacuna-native-shell__body { grid-template-columns:minmax(0,1fr)!important; }
}
@media(max-width:760px) {
  .lacuna-native-shell[data-layout=forge-focus-r1] > .lacuna-native-shell__topbar { display:grid; gap:0; padding:4px 12px; }
  .shell[data-lacuna-native=true] .lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__header { width:100%; height:40px!important; min-height:40px!important; }
  .lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__tabs { width:100%; }
  .shell[data-lacuna-native=true] .lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__tab { min-width:0; flex:1; padding:6px; }
  .shell[data-lacuna-native=true] .lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__rail { max-height:160px; }
  .shell[data-lacuna-native=true] .lacuna-native-shell[data-layout=forge-focus-r1][data-compact=false] .black-lab-rail:not([hidden]) { display:grid!important; min-height:128px; }
  .shell[data-lacuna-native=true] .lacuna-native-shell[data-layout=forge-focus-r1][data-compact=true] .lacuna-native-shell__rail { padding:0; border:0; }
  .lacuna-native-shell[data-layout=forge-focus-r1] .forge-domain-detail.studio-layout { padding:12px; }
}

/* Native domain scroll ownership: bound the reparented ancestor chain.
   The EXISTING visible domain workspace is the one scroll owner. */
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-layout=forge-focus-r1] > .lacuna-native-shell__body > .lacuna-native-shell__main { height:100%; min-height:0; overflow:hidden; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) .lacuna-native-shell__main > .native-citadel-owned-content { display:flex; flex-direction:column; height:100%; min-height:0; overflow:hidden; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) .native-citadel-owned-content > :not(.conversation) { flex:0 0 auto; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) .native-citadel-owned-content > .conversation { display:flex; flex-direction:column; flex:1 1 0; height:auto; min-height:0; overflow:hidden; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) .conversation > :not(.domain-workspace) { flex:0 0 auto; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) .conversation > .domain-workspace:not([hidden]) { flex:1 1 0; height:auto; min-height:0; overflow-y:auto; overscroll-behavior-y:contain; }

/* Focus r2 archive card: separate header/status tracks, no syllable wrapping.
   Native disclosure exposes the same reason computed by the History owner. */
.lacuna-native-shell[data-layout=forge-focus-r1] .history-mode { container:history-card / inline-size; }
.lacuna-native-shell[data-layout=forge-focus-r1] .history-toggle > span:first-child { min-width:0; }
.lacuna-native-shell[data-layout=forge-focus-r1] .history-toggle :is(.pane-kicker,strong,.status) {
  overflow-wrap:normal; word-break:normal; hyphens:none; text-transform:none;
}
.lacuna-native-shell[data-layout=forge-focus-r1] .history-toggle .status { width:fit-content; max-width:100%; white-space:normal; letter-spacing:normal; }
.lacuna-native-shell[data-layout=forge-focus-r1] .history-availability-details { padding:0 10px 10px; color:var(--workspace-muted); font-size:12px; }
.lacuna-native-shell[data-layout=forge-focus-r1] .history-availability-details > summary { cursor:pointer; min-height:36px; display:list-item; overflow-wrap:normal; word-break:normal; }
.lacuna-native-shell[data-layout=forge-focus-r1] .history-availability-details > p { margin:8px 0 0; line-height:1.5; overflow-wrap:anywhere; }
.lacuna-native-shell[data-layout=forge-focus-r1] .history-availability-details > p:focus-visible { outline:2px solid var(--workspace-blue); outline-offset:2px; }
@container history-card (max-width:220px) {
  .lacuna-native-shell[data-layout=forge-focus-r1] .history-toggle { display:grid; grid-template-columns:minmax(0,1fr); justify-items:start; align-items:start; gap:8px; padding:10px; }
  .lacuna-native-shell[data-layout=forge-focus-r1] .history-toggle strong { white-space:nowrap; }
}
@media(max-width:560px) {
  .shell[data-lacuna-native=true] .lacuna-native-shell[data-layout=forge-focus-r1] .lacuna-native-shell__rail:has(.history-availability-details[open]) { max-height:240px; }
}

/* Native modal boundary: the owner flag hides closed Chat catalogue and the
   same original close control lives INSIDE the open mobile rail. */
.lacuna-native-shell[data-layout=forge-focus-r1] #blackLabRail > .lacuna-native-shell__rail-chrome > #chatRailClose { display:none; }
.lacuna-native-shell[data-layout=forge-focus-r1] #blackLabRail > .lacuna-native-shell__rail-chrome { display:none; }
@media(max-width:760px) {
  .shell[data-lacuna-native=true][data-product-mode=chat][data-chat-rail-drawer=closed] > .lacuna-native-shell[data-layout=forge-focus-r1] > .lacuna-native-shell__body { grid-template-columns:minmax(0,1fr)!important; grid-template-rows:minmax(0,1fr); }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=chat],[data-product-mode=lab],[data-product-mode=project])[data-chat-rail-drawer=closed] > .lacuna-native-shell[data-layout=forge-focus-r1][data-navigation-placement=mobile-header] > .lacuna-native-shell__body > .lacuna-native-shell__rail { display:none!important; }
  .shell[data-lacuna-native=true][data-product-mode=chat][data-chat-rail-drawer=closed] > .lacuna-native-shell[data-layout=forge-focus-r1] > .lacuna-native-shell__body > .lacuna-native-shell__main { grid-column:1!important; grid-row:1!important; }
  .shell[data-lacuna-native=true][data-chat-rail-drawer=open] > .lacuna-native-shell[data-layout=forge-focus-r1] > .lacuna-native-shell__body > .lacuna-native-shell__rail { max-height:none!important; height:100%; position:absolute; inset:0 auto 0 0; width:min(86vw,280px); z-index:120; }
  .shell[data-lacuna-native=true][data-chat-rail-drawer=open] > .lacuna-native-shell[data-layout=forge-focus-r1] #blackLabRail { grid-template-rows:auto minmax(0,1fr) auto!important; }
  .shell[data-lacuna-native=true][data-chat-rail-drawer=open] > .lacuna-native-shell[data-layout=forge-focus-r1] #blackLabRail > .lacuna-native-shell__rail-chrome { display:block; grid-row:1!important; }
  .shell[data-lacuna-native=true][data-chat-rail-drawer=open] > .lacuna-native-shell[data-layout=forge-focus-r1] #blackLabRail > .domain-context-rail { grid-row:2!important; }
  .shell[data-lacuna-native=true][data-chat-rail-drawer=open] > .lacuna-native-shell[data-layout=forge-focus-r1] #blackLabRail > #blackLabIdentityFooter { grid-row:3!important; }
  .shell[data-lacuna-native=true][data-chat-rail-drawer=open] > .lacuna-native-shell[data-layout=forge-focus-r1] #blackLabRail > .lacuna-native-shell__rail-chrome > #chatRailClose:not([hidden]) { display:grid!important; min-width:44px; min-height:44px; margin-bottom:8px; }
}

/* Native56 layout-r1: one fixed right context, no DOM/business ownership change.
   Plan-version discussion/readiness/team stay their SAME nodes in ordinary flow.
   Append after frozen adapter CSS. Explicit wide choice remains functional. */
@media(min-width:1101px) {
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) > .lacuna-native-shell__body { grid-template-columns:224px minmax(0,1fr) 330px; }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true][data-compact=true]:has(.lacuna-project-conversation[data-surface-r6=true]) > .lacuna-native-shell__body { grid-template-columns:76px minmax(0,1fr) 330px; }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-panel-width=wide]) > .lacuna-native-shell__body { grid-template-columns:224px minmax(0,1fr) 440px; }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true][data-compact=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-panel-width=wide]) > .lacuna-native-shell__body { grid-template-columns:76px minmax(0,1fr) 440px; }
}
/* An open outer project chat already owns the right-hand track. The nested
   fixed-width Studio context must not reserve a second track inside main. */
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) :is(.studio-layout,.studio-workspace-layout) {
  grid-template-columns:minmax(0,1fr); gap:16px;
}
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .studio-layout > :is(.studio-main,.studio-context,.lab-plan-main,.lab-plan-rail,.lab-readiness-rail,.lab-plan-read-only-notice),
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .lab-plan-v1.studio-layout:has(> .lab-plan-read-only-notice) > :is(.lab-plan-main,.lab-plan-rail,.lab-readiness-rail) {
  grid-column:1; grid-row:auto; min-inline-size:0; max-inline-size:100%;
}
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .studio-layout > :is(.studio-context,.lab-plan-rail,.lab-readiness-rail) {
  position:static; inset-block-start:auto; max-block-size:none;
  border-inline-start:0; border-block-start:1px solid var(--workspace-line);
  padding:16px 0; overflow:visible; scrollbar-gutter:auto;
}
/* Progress metadata must wrap onto a new row, not reduce the heading copy to
   a letter-wide flex item even on a legitimately narrow viewport. */
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .forge-execution-heading {
  flex-wrap:wrap; align-items:flex-start; gap:8px 12px;
}
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .forge-execution-heading__copy { flex:1 1 240px; min-inline-size:0; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .forge-execution-progress { flex:0 1 auto; max-inline-size:100%; white-space:normal; }

/* R2: CSS placement must not inherit the Plan DOM's historical rail-before-main
   order. Keep actual nodes and scope, place main first, inner context below.
   A displayed read-only notice keeps its first row; hidden decisions stay hidden. */
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .studio-layout > .studio-main { grid-row:1; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .studio-layout > .studio-context { grid-row:2; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .lab-plan-v1.studio-layout > .lab-plan-main { grid-row:1; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .lab-plan-v1.studio-layout > .lab-plan-rail { grid-row:2; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .lab-plan-v1.studio-layout > .lab-readiness-rail { grid-row:3; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .lab-plan-v1.studio-layout > .lab-plan-read-only-notice { grid-row:1; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .lab-plan-v1.studio-layout:has(> .lab-plan-read-only-notice) > .lab-plan-main { grid-row:1; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .lab-plan-v1.studio-layout:has(> .lab-plan-read-only-notice) > .lab-plan-rail { grid-row:2; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .lab-plan-v1.studio-layout:has(> .lab-plan-read-only-notice) > .lab-readiness-rail { grid-row:3; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .lab-plan-v1.studio-layout:has(> .lab-plan-read-only-notice:not([hidden])) > .lab-plan-main { grid-row:2; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .lab-plan-v1.studio-layout:has(> .lab-plan-read-only-notice:not([hidden])) > .lab-plan-rail { grid-row:3; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) .lab-plan-v1.studio-layout:has(> .lab-plan-read-only-notice:not([hidden])) > .lab-readiness-rail { grid-row:4; }
/* Six native lifecycle tabs may exceed705px as a single forced-scroll row.
   Wrapping preserves each exact button, paired ARIA panel and Arrow/Home/End
   handler. Do not abbreviate labels or add a second navigation owner. */
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) :is(.studio-tabs,.lab-lifecycle-tabs) { flex-wrap:wrap; overflow-x:visible; max-inline-size:100%; }
.shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true]) :is(.studio-tabs,.lab-lifecycle-tabs) > :is(button,[role=tab]) { min-inline-size:0; max-inline-size:100%; white-space:normal; }

/* Closed-context R1: presence is not expansion. Use the existing inline
   launcher's public ARIA/hidden state; no JS, storage or authority mutation.
   Keep its SAME reachable control in a compact row above main, not in a
   zero-width/hidden third track. Open normal/wide and drawer stay unchanged. */
@media(min-width:1101px) {
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-presentation=inline] > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body {
    grid-template-columns:var(--native-catalog-width,224px) minmax(0,1fr);
    grid-template-rows:auto minmax(0,1fr);
  }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true][data-compact=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-presentation=inline] > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body {
    grid-template-columns:76px minmax(0,1fr);
  }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-presentation=inline] > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body > .lacuna-native-shell__rail {
    grid-column:1; grid-row:1 / 3;
  }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-presentation=inline] > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body > .lacuna-native-shell__main {
    grid-column:2; grid-row:2; min-block-size:0;
  }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-presentation=inline] > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body > .lacuna-native-shell__context {
    grid-column:2; grid-row:1; min-width:0; min-inline-size:0;
    min-block-size:0; max-block-size:none; padding:8px 16px;
    border-inline-start:0; border-block-end:1px solid var(--workspace-line);
    position:static;
  }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-presentation=inline] > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body > .lacuna-native-shell__context .lacuna-project-conversation__launcher {
    max-inline-size:100%; white-space:normal;
  }
}

/* Upper SIDEBAR row R1: H37's reference is not a global desktop topbar.
   The renderer moves the SAME controls; mode/routing/hidden owners stay intact.
   Mobile keeps the one reachable header outside the existing modal catalogue. */
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar] {
  --native-catalog-width:224px;
  grid-template-rows:auto minmax(0,1fr) auto!important;
}
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar] > .lacuna-native-shell__status { grid-row:1!important; }
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar] > .lacuna-native-shell__body { grid-row:2!important; }
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar] > .lacuna-native-shell__version { grid-row:3!important; }
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar] .lacuna-native-shell__rail > .lacuna-native-shell__topbar {
  display:flex; flex-direction:column; align-items:stretch; gap:0; width:100%; min-width:0;
  min-height:0; padding:0; flex:0 0 auto; border:0;
}
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar] .lacuna-native-shell__header {
  width:100%; flex:0 0 auto; height:46px!important; min-height:46px!important; gap:8px!important;
}
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar] .lacuna-native-shell__brand { flex:1; min-width:0; }
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar] .brand-lockup,
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar] .brand-lockup > div { min-width:0; }
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar] .brand-lockup > div > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar] .lacuna-native-shell__tabs {
  display:grid!important; grid-template-columns:repeat(3,minmax(0,1fr))!important;
  width:100%; gap:4px; margin:8px 0 12px; padding:0 0 12px; border-bottom:1px solid var(--workspace-line);
}
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar] .lacuna-native-shell__tab {
  display:flex; width:100%; min-width:0; height:50px; min-height:44px;
  padding:5px 2px; flex-direction:column; gap:4px;
}
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar] .lacuna-native-shell__mode-label { font-size:12px; line-height:1.3; }
@media(min-width:761px) {
  .shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar][data-compact=true] { --native-catalog-width:76px; }
  .shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar][data-compact=true] .lacuna-native-shell__tabs { grid-template-columns:minmax(0,1fr)!important; }
  .shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar][data-compact=true] .lacuna-native-shell__rail { padding-inline:6px; }
  .shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar][data-compact=true] .lacuna-native-shell__brand { flex:0 0 32px; width:32px; min-width:32px; }
  .shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar][data-compact=true] .brand-lockup > div { display:none!important; }
  .shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar][data-compact=true] .lacuna-native-shell__mode-label { display:none!important; }
  .shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=sidebar][data-compact=true] .lacuna-native-shell__rail-toggle { flex:0 0 24px; width:24px; min-width:24px; }
}
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=mobile-header] { --native-catalog-width:0px; }
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=mobile-header] .lacuna-native-shell__rail-toggle::before { content:"☰"; }
.shell[data-ui-edition="rick"][data-lacuna-native=true] > .lacuna-native-shell[data-navigation-placement=mobile-header][data-catalogue-open=true] .lacuna-native-shell__rail-toggle::before { content:"×"; }

/* Native all-domain catalogue drawer: the SAME controller flag owns visibility.
   Closed Archive/account must not reserve a mobile working row. The relocated
   NAV/opener stays outside the rail; open dialog, close and inert stay owned. */
@media(max-width:760px) {
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=chat],[data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-layout=forge-focus-r1][data-navigation-placement=mobile-header] { position:relative; }
  /* Chrome stays above the root scrim; the drawer is anchored below it. */
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=chat],[data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-layout=forge-focus-r1][data-navigation-placement=mobile-header] > .lacuna-native-shell__topbar { position:relative; z-index:130; }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=chat],[data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-layout=forge-focus-r1][data-navigation-placement=mobile-header] > .lacuna-native-shell__body {
    position:relative; grid-template-columns:minmax(0,1fr)!important; grid-template-rows:minmax(0,1fr);
  }
  /* Override the legacy mobile-pane rooms-panel display only while this
     native drawer is open. Child [hidden] domain owners remain untouched. */
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=chat],[data-product-mode=lab],[data-product-mode=project])[data-chat-rail-drawer=open] > .lacuna-native-shell[data-layout=forge-focus-r1][data-navigation-placement=mobile-header] > .lacuna-native-shell__body > .lacuna-native-shell__rail #blackLabRail:not([hidden]) { display:grid!important; }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=chat],[data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-layout=forge-focus-r1][data-navigation-placement=mobile-header] > .lacuna-native-shell__body > .lacuna-native-shell__main { grid-column:1!important; grid-row:1!important; }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=chat],[data-product-mode=lab],[data-product-mode=project])[data-chat-rail-drawer=open] > .lacuna-native-shell[data-layout=forge-focus-r1][data-navigation-placement=mobile-header] > .black-lab-rail-scrim:not([hidden]) {
    display:block; position:absolute; inset:0; z-index:110;
    width:100%; height:100%; border:0; background:rgb(0 0 0 / 66%);
  }
}

/* R4 Native reading geometry. Same document/context/actions; no business state.
   Flex gives the existing historical banner the full document containing block,
   and removes the empty 330px track when no project conversation is mounted. */
.shell[data-ui-edition="rick"][data-lacuna-native="true"][data-product-mode="lab"] #labDomainContent .lab-plan-v1.studio-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-inline-size: 0;
}
.shell[data-ui-edition="rick"][data-lacuna-native="true"][data-product-mode="lab"] #labDomainContent .lab-plan-v1.studio-layout > .lab-plan-read-only-notice { order: 0; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"][data-product-mode="lab"] #labDomainContent .lab-plan-v1.studio-layout > .lab-plan-main { order: 1; min-inline-size: 0; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"][data-product-mode="lab"] #labDomainContent .lab-plan-v1.studio-layout > .lab-plan-rail { order: 2; min-inline-size: 0; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"][data-product-mode="lab"] #labDomainContent .lab-plan-v1.studio-layout > .lab-readiness-rail { order: 3; min-inline-size: 0; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #labDomainContent .lab-blueprint-read__product { grid-template-columns: minmax(0,1fr); gap: 18px; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #labDomainContent .lab-blueprint-read__text { max-inline-size: 82ch; }
/* Only the initial successful-load announcement is visually quiet. Every
   action/error/waiting/read-only result has data-state and stays visible. */
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #labDomainContent .lab-plan-action-status:not([data-state]) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #labDomainContent .lab-lifecycle-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  min-block-size: 44px;
  padding-block: 0;
  scrollbar-width: thin;
}
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #labDomainContent .lab-lifecycle-tabs > button { flex: 0 0 auto; min-block-size: 44px; padding: 8px 12px; white-space: nowrap; }

/* The Native renderer selects its existing context popup at all widths.
   No canonical feed, media, controls or failure utilities are cloned/removed. */
.shell[data-ui-edition="rick"][data-lacuna-native="true"][data-product-mode="chat"] #chatCommandContent .studio-chat[data-context-presentation="overlay"] {
  position: relative;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: auto auto auto auto auto minmax(0,1fr);
  column-gap: 0;
}
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .studio-chat[data-context-presentation="overlay"] > .studio-chat-context {
  position: absolute;
  grid-area: auto;
  inset: 0 0 0 auto;
  z-index: 6;
  inline-size: min(100%,380px);
  block-size: 100%;
  max-block-size: 100%;
  padding: 14px;
  border: 1px solid var(--studio-line-strong);
  border-radius: var(--studio-radius);
  background: var(--studio-panel);
  box-shadow: -12px 0 32px #0006;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .studio-chat[data-context-presentation="overlay"] > .studio-chat-context[hidden] { display: none!important; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .studio-chat-room-actions { display: grid; gap: 8px; margin-block: 12px; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .studio-chat-room-actions > h4 { margin: 0; font-size: 13px; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .studio-chat-room-actions > .chat-command-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .studio-chat-room-actions .chat-command-action { min-block-size: 44px; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .studio-chat-header > .chat-command-summary { display: none; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .studio-chat-tabs { min-block-size: 44px; padding: 0; margin-block: 0 4px; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .studio-chat-tabs > .studio-tab { min-block-size: 44px; padding: 8px 12px; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .studio-chat-tools { gap: 4px 8px; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .studio-chat-context-toggle { margin-block-end: 2px; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .native-source-return {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 4px 8px;
  padding: 6px 8px;
  min-inline-size: 0;
}
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .native-source-return > span { min-inline-size: 0; font-size: 12px; line-height: 1.35; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .native-source-return > button { min-block-size: 36px; padding: 6px 9px; font-size: 12px; white-space: nowrap; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .native-source-return > small { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Keep actor/mode, all errors, uploads, targets and actions. The ordinary draft
   hint duplicates the mode line, unlike semantic/error/storage state hints. */
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #messageForm #chatDraftState[data-draft-kind="ordinary"] { display: none; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"][data-product-mode="chat"] #messageForm { margin-block-start: 4px; padding: 8px 10px; gap: 4px; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"][data-product-mode="chat"] #messageForm .aaa-composer__editor-shell { padding: 6px 8px; }
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #messageForm .aaa-composer__hint-actions #chatSemanticGuide { white-space: nowrap; }
@media(max-width:600px) {
  .shell[data-ui-edition="rick"][data-lacuna-native="true"] #chatCommandContent .native-source-return > button { min-block-size: 44px; }
  .shell[data-ui-edition="rick"][data-lacuna-native="true"] #messageForm .aaa-composer__editor { font-size: 16px; }
}

/* L2 reading-context R2: APPEND fragment after the current shell adapter.
   Only the existing exact historical status section and its own children.
   No scroll-owner, document/Chat geometry, data, route or business state change.
   Source rules do not prove mounted sticky/occlusion/device acceptance. */
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #labDomainContent .lab-plan-v1[data-access-mode="historical-read-only"] > section.lab-plan-read-only-notice[data-state="historical-read-only"]:not([hidden]) {
  position: sticky;
  inset-block-start: 0;
  z-index: 4;
  align-self: start;
  inline-size: 100%;
  max-inline-size: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 8px;
  min-inline-size: 0;
  padding: 8px 10px;
  background: var(--panel);
  box-shadow: 0 1px 0 var(--line);
}
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #labDomainContent .lab-plan-v1[data-access-mode="historical-read-only"] > section.lab-plan-read-only-notice[data-state="historical-read-only"]:not([hidden]) > strong {
  grid-column: 1;
  grid-row: 1;
  min-inline-size: 0;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #labDomainContent .lab-plan-v1[data-access-mode="historical-read-only"] > section.lab-plan-read-only-notice[data-state="historical-read-only"]:not([hidden]) > p {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.shell[data-ui-edition="rick"][data-lacuna-native="true"] #labDomainContent .lab-plan-v1[data-access-mode="historical-read-only"] > section.lab-plan-read-only-notice[data-state="historical-read-only"]:not([hidden]) > button.lab-plan-primary-action {
  grid-column: 2;
  grid-row: 1;
  inline-size: auto;
  min-inline-size: 44px;
  min-block-size: 44px;
  max-inline-size: 100%;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .shell[data-ui-edition="rick"][data-lacuna-native="true"] #labDomainContent .lab-plan-v1[data-access-mode="historical-read-only"] > section.lab-plan-read-only-notice[data-state="historical-read-only"]:not([hidden]) {
    gap: 3px 6px;
    padding: 6px 8px;
  }
}

/* Touch-width PQ cards must not paint their actions over selectable answers.
   Keep all choices and helper text in normal flow before the actions. */
@media (max-width: 560px) {
  .shell[data-ui-edition="rick"][data-lacuna-native="true"] .lab-question-card__actions {
    position: static;
    inset: auto;
    z-index: auto;
  }
}

/* Closed medium drawer: context presence does not mean a visible side panel.
   Reuse the controller's existing launcher/presentation state and SAME nodes.
   Small-screen layout and the established wide inline rules stay unchanged. */
@media (min-width: 801px) and (max-width: 1100px) {
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-layout=forge-focus-r1][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-presentation=drawer]:not([hidden]) > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body {
    grid-template-columns:var(--native-catalog-width,224px) minmax(0,1fr);
    grid-template-rows:auto minmax(0,1fr);
  }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-layout=forge-focus-r1][data-context=true][data-compact=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-presentation=drawer]:not([hidden]) > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body {
    grid-template-columns:var(--native-catalog-width,76px) minmax(0,1fr);
  }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-layout=forge-focus-r1][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-presentation=drawer]:not([hidden]) > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body > .lacuna-native-shell__rail {
    grid-column:1; grid-row:1 / 3;
  }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-layout=forge-focus-r1][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-presentation=drawer]:not([hidden]) > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body > .lacuna-native-shell__main {
    grid-column:2; grid-row:2; min-block-size:0;
  }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-layout=forge-focus-r1][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-presentation=drawer]:not([hidden]) > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body > .lacuna-native-shell__context {
    grid-column:2; grid-row:1; min-width:0; min-inline-size:0;
    min-block-size:0; max-block-size:none; padding:8px 16px;
    border-inline-start:0; border-block-end:1px solid var(--workspace-line);
    position:static;
  }
  .shell[data-ui-edition="rick"][data-lacuna-native=true]:is([data-product-mode=lab],[data-product-mode=project]) > .lacuna-native-shell[data-visual-version="v8.1"][data-layout=forge-focus-r1][data-context=true]:has(.lacuna-project-conversation[data-surface-r6=true][data-presentation=drawer]:not([hidden]) > .lacuna-project-conversation__launcher[aria-expanded=false]:not([hidden])) > .lacuna-native-shell__body > .lacuna-native-shell__context .lacuna-project-conversation__launcher {
    max-inline-size:100%; white-space:normal;
  }
}
