:root {
  color-scheme: light;
  --ink: #24211f;
  --muted: #6f6863;
  --line: #d8d2cd;
  --panel: #fbfaf8;
  --paper: #ffffff;
  --mud: #47322b;
  --mud-strong: #2f211d;
  --clay: #9b5f3b;
  --blue: #315f7d;
  --green: #55795e;
  --danger: #a13f35;
  --focus: #d69d5b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: #ece8e2;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: 64px 1fr;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
}

h1,
h2,
p,
dl {
  margin: 0;
}

.brand-block h1 {
  font-size: 1.15rem;
  line-height: 1.1;
}

.brand-block p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.connection-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--muted);
}

.connection-pill.online .connection-dot {
  background: var(--green);
}

.connection-pill.offline {
  color: var(--mud);
  background: #fff6e7;
  border-color: #d8b270;
}

.connection-pill.offline .connection-dot {
  background: #c18330;
}

.icon-button,
.tool-button,
.workspace-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.icon-button:hover,
.tool-button:hover,
.text-button:hover {
  border-color: var(--focus);
}

.icon-button.danger {
  color: var(--danger);
}

.icon-button.danger:hover {
  border-color: var(--danger);
  background: #fff4f2;
}

.text-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.text-button.primary {
  background: var(--mud);
  border-color: var(--mud);
  color: #fff;
}

.text-button.danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.text-button.full-width {
  width: 100%;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 390px;
  overflow: hidden;
}

.workspace-rail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px;
  background: var(--mud-strong);
  border-right: 1px solid #201713;
}

.workspace-button {
  width: 92px;
  height: 64px;
  align-content: center;
  gap: 5px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #f7f1ed;
}

.workspace-button span {
  font-size: 1.15rem;
  line-height: 1;
}

.workspace-button strong {
  font-size: 0.72rem;
  line-height: 1;
}

.workspace-button.active {
  background: #f0d7a6;
  color: var(--mud-strong);
  border-color: #f0d7a6;
}

.document-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #f3f0eb;
}

.focus-mode .document-stage {
  grid-template-rows: 1fr;
}

.focus-mode .stage-toolbar {
  display: none;
}

.stage-toolbar {
  display: grid;
  grid-template-columns: minmax(170px, 0.55fr) minmax(260px, 1fr) auto auto;
  align-items: stretch;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.stage-title {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
}

.stage-title h2 {
  font-size: 1.08rem;
}

.stage-title p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.drop-control {
  flex: 1;
  min-height: 70px;
  display: grid;
  align-content: center;
  border: 1px dashed #b9aca2;
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.68);
}

.drop-control.dragging {
  border-color: var(--blue);
  background: #edf5fa;
}

.drop-control input {
  display: none;
}

.drop-title {
  font-weight: 800;
}

.drop-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 8px;
}

.stat-strip div {
  display: grid;
  align-content: center;
  min-width: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--paper);
}

.stat-strip strong {
  font-size: 1.1rem;
}

.stat-strip span {
  color: var(--muted);
  font-size: 0.78rem;
}

.editor-surface {
  position: relative;
  min-height: 0;
  display: grid;
  overflow: hidden;
}

.page-grid,
.expanded-editor,
.document-preview {
  grid-area: 1 / 1;
}

.document-preview {
  min-height: 0;
  overflow: auto;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 18px;
  padding: 0 22px 22px;
  background: #ded8d0;
}

.preview-review-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: calc(100% + 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  background: var(--paper);
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-review-bar div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.preview-review-bar strong,
.preview-review-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-review-bar span {
  color: var(--muted);
  font-size: 0.8rem;
}

.page-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, 230px);
  grid-auto-rows: 340px;
  align-content: start;
  justify-content: start;
  gap: 14px;
  padding: 16px;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 390px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  color: var(--ink);
  font-size: 1.35rem;
}

.empty-state p {
  max-width: 520px;
  line-height: 1.5;
}

.page-card {
  position: relative;
  width: 230px;
  height: 340px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(47, 33, 29, 0.08);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.preview-page {
  position: relative;
  z-index: 0;
  width: min(100%, 860px);
  display: grid;
  gap: 8px;
}

.preview-page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.preview-page-header strong {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--mud);
  color: #fff;
  font-size: 0.78rem;
}

.preview-page-header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-canvas-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: fit-content;
  max-width: 100%;
  align-self: center;
  justify-self: center;
}

.preview-canvas-stage canvas,
.preview-canvas-stage .annotation-layer {
  grid-area: 1 / 1;
}

.preview-canvas-stage .annotation-layer {
  z-index: 1;
}

.preview-canvas-stage .annotation-layer.readonly {
  pointer-events: none;
}

.annotation-layer.readonly {
  pointer-events: none;
}

.preview-page canvas {
  max-width: 100%;
  background: #fff;
  border: 1px solid #d0c8c0;
  border-radius: 6px;
  box-shadow: 0 16px 34px rgba(47, 33, 29, 0.16);
}

.page-card.selected {
  outline: 3px solid rgba(49, 95, 125, 0.28);
  border-color: var(--blue);
}

.page-card.dragging {
  opacity: 0.58;
  transform: scale(0.98);
}

.page-card.drop-before,
.page-card.drop-after {
  border-color: var(--focus);
  box-shadow: 0 10px 28px rgba(47, 33, 29, 0.14);
}

.page-card.drop-before::before,
.page-card.drop-after::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  z-index: 3;
  width: 5px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(49, 95, 125, 0.16);
}

.page-card.drop-before::before {
  left: -3px;
}

.page-card.drop-after::after {
  right: -3px;
}

.page-preview {
  height: 284px;
  min-height: 284px;
  display: grid;
  place-items: center;
  margin: 12px;
  border: 1px solid #d7d7d7;
  padding: 8px;
  background: #e8e2dc;
  color: var(--muted);
  transition: transform 120ms ease;
  overflow: hidden;
}

.page-preview canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 4px 12px rgba(47, 33, 29, 0.12);
}

.page-preview .preview-canvas-stage {
  max-width: 100%;
  max-height: 100%;
  margin: auto;
}

.page-preview span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 30px;
  border-radius: 6px;
  background: var(--mud);
  color: #fff;
  font-weight: 900;
  font-size: 0.86rem;
}

.preview-paper {
  width: min(72%, 180px);
  aspect-ratio: 8.5 / 11;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid #d8d2cd;
  background: #fff;
  box-shadow: 0 10px 24px rgba(47, 33, 29, 0.1);
  text-align: center;
}

.preview-paper strong {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 0.9rem;
}

.preview-paper span,
.preview-paper small {
  color: var(--muted);
  font-size: 0.78rem;
}

.page-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 12px 12px;
  font-size: 0.82rem;
  min-width: 0;
}

.page-meta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-meta span,
.page-rotation {
  color: var(--muted);
  white-space: nowrap;
}

.page-position {
  font-weight: 800;
  color: var(--ink) !important;
}

.source-page-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(71, 50, 43, 0.18);
  border-radius: 8px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--mud);
  font-size: 0.74rem;
  font-weight: 800;
}

.expanded-editor {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #ded8d0;
}

.desk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  min-height: 56px;
  padding: 8px 14px;
  background: var(--paper);
}

.desk-title {
  display: grid;
  gap: 2px;
  min-width: 0;
  justify-items: center;
  text-align: center;
  flex: 1;
}

.desk-nav {
  display: flex !important;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
}

.zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: #fbfaf8;
}

.zoom-controls .icon-button {
  width: 30px;
  height: 30px;
}

.zoom-controls span {
  min-width: 42px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.desk-bar strong,
.desk-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-bar span {
  color: var(--muted);
  font-size: 0.8rem;
}

.desk-page-wrap {
  min-height: 0;
  overflow: auto;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 22px;
}

.desk-page {
  width: fit-content;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #d0c8c0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(47, 33, 29, 0.16);
}

.desk-page canvas {
  max-width: none;
  background: #fff;
}

.page-canvas-stage {
  position: relative;
  display: grid;
  width: fit-content;
  place-items: start center;
}

.page-canvas-stage canvas,
.annotation-layer {
  grid-area: 1 / 1;
}

.annotation-layer {
  z-index: 1;
  touch-action: none;
  overflow: visible;
}

.page-canvas-stage.annotatable .annotation-layer {
  cursor: crosshair;
}

.page-canvas-stage.annotatable .annotation-layer.selecting {
  cursor: default;
}

.annotation-selection {
  pointer-events: none;
}

.annotation-selection rect:first-child {
  fill: rgba(49, 95, 125, 0.08);
  stroke: var(--blue);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}

.annotation-selection .resize-handle {
  fill: var(--blue);
  stroke: #fff;
  stroke-width: 2.5;
}

.inspector {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: #f9f7f3;
  border-left: 1px solid var(--line);
}

.document-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.document-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fbfaf8;
}

.document-item div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.document-item strong,
.document-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-item span {
  color: var(--muted);
  font-size: 0.76rem;
}

.document-actions {
  display: flex;
  gap: 6px;
}

.document-actions .icon-button {
  width: 30px;
  height: 30px;
}

.empty-list-note {
  margin: 0;
  border: 1px dashed #cfc6be;
  border-radius: 8px;
  padding: 10px;
  background: #fbfaf8;
  color: var(--muted);
  font-size: 0.84rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 14px;
}

.panel.quiet {
  background: #f6f1ea;
}

.panel h2 {
  font-size: 0.95rem;
}

.panel p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 0.78rem;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #eee7e0;
  padding-bottom: 7px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.detail-list dd {
  text-align: right;
  font-weight: 700;
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.button-grid .danger {
  grid-column: 1 / -1;
}

.button-grid.page-action-grid .danger {
  grid-column: auto;
}

.tool-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid #eee7e0;
  padding-top: 12px;
  margin-top: 12px;
}

.panel-heading + .tool-section {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.tool-section h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(6, 38px);
  gap: 8px;
}

.tool-grid .tool-button {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.05rem;
}

.tool-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.tool-button .icon-fill {
  fill: currentColor;
  stroke: none;
}

.tool-grid .tool-button.active {
  border-color: #c89b61;
  background: #fff6e7;
  color: var(--mud-strong);
}

.sign-actions {
  display: grid;
  gap: 8px;
}

.sign-actions .text-button {
  justify-content: center;
}

.sign-actions .text-button.active {
  border-color: #c89b61;
  background: #fff6e7;
  color: var(--mud-strong);
}

.select-tool-row {
  display: grid;
  grid-template-columns: 38px 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.select-tool-row .text-button {
  min-width: 0;
  padding: 0 8px;
  font-size: 0.78rem;
}

.sign-select-row {
  grid-template-columns: 38px 1fr;
}

.control-row {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.tool-section .control-row {
  margin-bottom: 0;
}

.size-control {
  grid-template-columns: auto minmax(110px, 1fr) 46px;
}

.size-control output {
  color: var(--ink);
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.control-row input {
  width: 150px;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(8, 30px);
  gap: 8px;
}

.swatch {
  width: 30px;
  height: 30px;
  border: 1px solid #cfc6be;
  border-radius: 999px;
  background: var(--swatch);
}

.swatch.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line);
}

.inline-text-box {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.inline-text-box.editing {
  pointer-events: auto;
}

.inline-text-toolbar {
  position: absolute;
  z-index: 2;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 5px;
  width: min(100%, 280px);
  border: 1px solid rgba(49, 95, 125, 0.35);
  border-radius: 6px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(47, 33, 29, 0.12);
  pointer-events: auto;
}

.inline-text-toolbar select,
.inline-text-toolbar button {
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font: 700 12px Inter, Arial, sans-serif;
}

.inline-text-toolbar select {
  flex: 1 1 auto;
  min-width: 86px;
}

.inline-text-toolbar button {
  flex: 0 0 auto;
  min-width: 28px;
  padding: 0 7px;
}

.inline-text-toolbar .text-drag-handle {
  cursor: move;
  color: var(--blue);
}

.inline-text-toolbar button.active {
  background: #fff6e7;
  border-color: #c89b61;
}

.inline-text-toolbar span {
  min-width: 40px;
  color: var(--muted);
  font: 800 11px Inter, Arial, sans-serif;
  text-align: center;
}

.inline-text-editor {
  position: static;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 6px;
  outline: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.2;
  caret-color: var(--ink);
}

.inline-text-box.editing .inline-text-editor {
  position: absolute;
}

.inline-text-box.editing .inline-text-editor {
  border: 1px solid rgba(49, 95, 125, 0.52);
  background: transparent;
  pointer-events: auto;
  cursor: text;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.54);
}

.panel-note {
  margin-top: 10px;
}

.status-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(71, 50, 43, 0.18);
  border-radius: 8px;
  padding: 11px 14px;
  background: #2f211d;
  color: #fff;
  box-shadow: 0 16px 34px rgba(36, 33, 31, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.status-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(36, 33, 31, 0.42);
}

.signature-modal {
  width: min(780px, 100%);
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--paper);
  box-shadow: 0 24px 60px rgba(36, 33, 31, 0.28);
}

.modal-header,
.modal-actions,
.signature-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header,
.modal-actions {
  justify-content: space-between;
}

.signature-modal h2 {
  font-size: 1rem;
}

#signaturePad {
  width: 100%;
  height: 240px;
  border: 1px dashed #b9aca2;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

@media (max-width: 920px) {
  .workspace {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .workspace-button {
    width: 68px;
  }

  .stage-toolbar {
    grid-template-columns: 1fr;
  }

  .inspector {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inspector .quiet {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .app-shell {
    grid-template-rows: auto 1fr;
  }

  .topbar,
  .stage-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    padding: 12px;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace-rail {
    position: sticky;
    top: 0;
    z-index: 2;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #201713;
  }

  .inspector {
    grid-template-columns: 1fr;
  }

  .stat-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}
