/* Public shell additions. ProductWorkspace graph and inspector styling remains
   in the production desktop stylesheet. */
.public-share-shell {
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.public-share-download-actions {
  display: flex;
  align-items: center;
}

.public-share-main {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
}

.public-share-download-card {
  flex: none;
  margin-left: auto;
  display: flex;
  align-items: center;
}

.public-share-shell:not(.public-share-embed) .thread-header {
  flex-wrap: nowrap;
  min-height: 48px;
  height: auto;
  gap: 8px;
  padding: 6px 12px;
}

.public-share-shell:not(.public-share-embed) .thread-title-group {
  flex: 1;
  min-width: 0;
}

.public-share-primary-action {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 14px;
  border-radius: 7px;
  background: var(--text);
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.public-share-primary-action:hover,
.public-share-primary-action:focus-visible {
  filter: brightness(1.1);
}

.public-share-workspace-host {
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--panel);
}

.public-share-workspace-host .thread-view {
  height: 100%;
  min-height: 0;
}

/* Review mode still renders the shared ProductWorkspace markup. Keep every
   mutating affordance absent in the public surface, including future controls
   accidentally added to the desktop shell. */
.public-share-shell .conversation-settings,
.public-share-shell .thread-composer-shell,
.public-share-shell .approval-dock,
.public-share-shell .node-context-dock,
.public-share-shell .annotation-panel,
.public-share-shell #attachNodeContext {
  display: none !important;
}

.public-share-shell .workspace-layout {
  grid-template-rows: auto auto minmax(0, 1fr);
  padding-bottom: 0;
}

.public-share-shell .thread-header {
  border-radius: 12px;
}

.public-share-shell .interaction-banner {
  position: relative;
  margin-left: 0;
  min-height: 52px;
  padding-block: 7px;
}

.public-share-shell .turn-picker {
  position: static;
}

.public-share-shell .turn-popover:not(.interaction-graph-popover) {
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  width: auto;
  max-height: calc(52px * 5 + 2px);
}

.public-share-shell .environment-panel {
  display: none !important;
}

.public-share-error {
  display: grid;
  justify-items: center;
  gap: 8px;
  height: 100%;
  min-height: 0;
  align-content: center;
  padding: 32px;
  border: 0;
  border-radius: 0;
  background: var(--raised);
  text-align: center;
}

.public-share-error h2,
.public-share-error p {
  margin: 0;
}

.public-share-error p {
  color: var(--muted);
  font-size: 12px;
}

.public-share-reload {
  min-height: 34px;
  margin-top: 6px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}

html[data-theme="light"] .public-share-error {
  background: #fff;
}

@media (max-width: 1100px) {
  .public-share-shell .workspace-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(520px, 1fr);
    gap: 0;
    min-width: 0;
    padding: 12px;
    overflow: auto;
  }

  .public-share-shell .thread-header {
    grid-column: 1;
    grid-row: 1;
  }

  .public-share-shell .interaction-banner {
    grid-column: 1;
    grid-row: 2;
    margin: 0 0 12px;
  }

  .public-share-shell .thread-workspace {
    grid-column: 1;
    grid-row: 3;
  }
}

/* Standalone branding shares the title row; reading panes start directly below. */
@media(min-width:1101px){
 .public-share-shell .workspace-layout{grid-template-rows:auto auto minmax(0,1fr)}
 .public-share-shell .thread-header{grid-column:1 / -1;grid-row:1}
 .public-share-shell .interaction-banner{grid-column:1;grid-row:2}
 .public-share-shell .graph-column{grid-column:1;grid-row:3}
 .public-share-shell .workspace-divider{grid-row:2 / 4}
 .public-share-shell .inspector{grid-column:3;grid-row:2 / 4}
}

/* Embed presentation uses the same ProductWorkspace and authority boundary.
   Narrow-screen replacement details are the next delivery slice. */
.public-share-embed .public-share-main {
  display: flex;
  flex-direction: column;
}

.public-share-embed-branding {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  background: var(--panel);
}

.public-share-attribution {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.public-share-embed-branding a {
  color: var(--text);
  text-underline-offset: 3px;
}

.public-share-embed .public-share-workspace-host {
  flex: 1;
  height: auto;
}

@media (min-width: 1101px) {
  .public-share-embed .workspace-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .public-share-embed .thread-header,
  .public-share-embed .interaction-banner {
    grid-column: 1;
  }

  .public-share-embed .thread-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .public-share-embed .thread-workspace:has(.inspector:not(.hidden)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-share-embed .inspector {
    width: 100%;
  }
}

/* Bounded reading surface at every embed width. */
.public-share-embed .workspace-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: 12px;
  gap: 8px;
}
.public-share-embed .thread-header { grid-column: 1; grid-row: 1; }
.public-share-embed .interaction-banner { grid-column: 1; grid-row: 2; margin: 0; }
.public-share-embed .thread-workspace { grid-column: 1; grid-row: 3; min-height: 0; }
.public-share-embed .graph-stage { min-height: 0; touch-action: pan-y; }
.public-share-embed .inspector { min-height: 0; }
.public-share-embed .inspector-content { min-height: 0; overscroll-behavior: contain; }
.public-share-embed #closeInspector { width: auto; padding: 6px 8px; font-size: 11px; }
.public-share-embed :focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
@media (max-width: 1100px) {
  .public-share-embed .thread-workspace { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .public-share-embed .graph-column { grid-area: 1 / 1; min-height: 0; }
  .public-share-embed .thread-workspace:has(.inspector:not(.hidden)) .graph-column { display: none; }
  .public-share-embed .inspector {
    position: static; grid-area: 1 / 1; width: 100%; max-height: none;
    height: 100%; border: 1px solid var(--line); border-radius: 12px;
  }
  .public-share-embed .graph-hint { display: none; }
  .public-share-embed .interaction-banner { width: 100%; }
  .public-share-embed .interaction-copy { overflow: hidden; }
}
/* Vertical touch reading also works when the gesture begins on a node. */
.public-share-embed .graph-node { touch-action: pan-y; }

/* Embedded viewers share the adjustable wide split, with branding outside it. */
@media(min-width:1101px){
 .public-share-embed .workspace-layout{grid-template-columns:minmax(280px,clamp(280px,calc(var(--graph-share,50%) - 6px),calc(100% - 292px))) 12px minmax(280px,1fr);grid-template-rows:auto auto minmax(0,1fr);column-gap:0}
 .public-share-embed .thread-header{grid-column:1 / -1;grid-row:1}
 .public-share-embed .interaction-banner{grid-column:1;grid-row:2}
 .public-share-embed .thread-workspace{display:contents}
 .public-share-embed .graph-column{grid-column:1;grid-row:3}
 .public-share-embed .workspace-divider{grid-column:2;grid-row:2 / 4}
 .public-share-embed .inspector{grid-column:3;grid-row:2 / 4}
 .public-share-embed .workspace-layout:has(.inspector.hidden){grid-template-columns:minmax(0,1fr)}
}
