turbo-frame#shell_viewer {
  display: contents;
}

.shell__viewer, .sheet { --chrome-top: 0px; }

.shell__viewer {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  justify-content: flex-end;
  pointer-events: auto;
}

.shell__viewer-scrim {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--text-primary) 40%, transparent);
  pointer-events: auto;
}

.sheet {
  position: fixed;
  top: 0;
  right: 0;
  width: 560px;
  max-width: 100vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface-base);
  border-left: 1px solid var(--border-subtle);
  pointer-events: auto;
  z-index: calc(var(--z-overlay) + 1);
}

.sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sheet__heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.sheet__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.sheet__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.sheet__subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
}

.sheet__badge {
  flex-shrink: 0;
}

.shell__viewer--fresh-copy .sheet {
  border-left: 3px solid var(--accent-primary);
}

.sheet__body {
  flex: 1;
  overflow-x: clip;
  overflow-y: auto;
  padding: var(--space-5);

  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sheet__body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.sheet__body .resource-form__actions {
  position: sticky;
  bottom: 0;
  background: var(--surface-base);
  margin-left: calc(-1 * var(--space-5));
  margin-right: calc(-1 * var(--space-5));
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

.sheet__body .smart-list {
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.sheet__body .smart-list > turbo-frame {
  display: block;
  width: 100%;
  min-width: 0;
}

.sheet__body .smart-list__row {
  padding-left: 0;
  padding-right: 0;
  min-width: 0;
}

.sheet__body .smart-list--highlights .smart-list__editor {
  margin-left: 0;
  margin-right: 0;
}

@media (max-width: 768px) {
  .sheet {
    width: 100%;
    max-width: 100vw;
  }
}

.sheet--reader { width: min(920px, 100vw); }

.sheet__header--reader {
  padding: var(--space-3) var(--space-4);
  gap: var(--space-2);
}

.sheet__docmeta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}
.sheet__docmeta-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sheet__docmeta .sheet__title {
  font-size: var(--text-base);
  line-height: var(--leading-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet__docmeta-line {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: var(--leading-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet__header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.sheet__body--reader {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet__doc--framed {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-zone-well);
  padding: var(--space-2);
  overflow-y: auto;
}
.sheet__page {
  flex: 1;
  min-height: 0;
  background: var(--surface-base);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.sheet__page--image {
  flex: none;
  max-width: 680px;
  margin: auto;
  box-shadow: var(--shadow-md);
}
.sheet__page iframe { width: 100%; height: 100%; border: 0; display: block; }
.sheet__page img { width: 100%; height: auto; display: block; }
.sheet__doc--framed .empty-state { margin: auto; }
