html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

.app-shell {
  --workqueue-nav-width: clamp(216px, 18vw, 280px);
  --workqueue-titlebar-height: 54px;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  background: var(--ds-color-bg);
}

.app-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--workqueue-titlebar-height);
  padding: 0 var(--ds-space-4);
  border-bottom: 1px solid var(--ds-color-border);
  background: var(--ds-color-surface);
  box-sizing: border-box;
}

.app-titlebar-main {
  display: flex;
  align-items: center;
  min-width: 0;
}

.app-titlebar-title {
  color: var(--ds-color-text);
  font-size: var(--ds-font-xl);
  font-weight: 800;
  line-height: var(--ds-line-compact);
}

.app-titlebar-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--ds-space-2);
  min-width: 0;
}

.workqueue-layout {
  display: grid;
  grid-template-columns: var(--workqueue-nav-width) minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
}

.workqueue-nav {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: var(--ds-space-3);
  border-right: 1px solid var(--ds-color-border);
  background: #f6f8fb;
  box-sizing: border-box;
}

.workqueue-new-request {
  width: 100%;
  min-height: 40px;
  margin-bottom: var(--ds-space-3);
  border-radius: var(--ds-radius-md);
  font-size: var(--ds-font-sm);
  font-weight: 800;
}

.workqueue-folder-list {
  display: grid;
  align-content: start;
  gap: var(--ds-space-2);
  min-height: 0;
  overflow: auto;
}

.workqueue-folder {
  min-width: 0;
}

.workqueue-folder-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  column-gap: 4px;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 0 var(--ds-space-2);
  border: 1px solid transparent;
  border-radius: var(--ds-radius-md);
  background: transparent;
  color: var(--ds-color-text);
  font: inherit;
  font-size: var(--ds-font-sm);
  font-weight: 800;
  line-height: var(--ds-line-compact);
  text-align: left;
}

.workqueue-folder-row[role="button"] {
  cursor: pointer;
}

.workqueue-folder-row[role="button"]:hover,
.workqueue-folder-row[role="button"]:focus-visible,
.workqueue-folder-row.is-active {
  border-color: rgba(15, 98, 254, 0.26);
  background: #fff;
  outline: none;
}

.workqueue-folder-row.is-active {
  box-shadow: inset 3px 0 0 var(--ds-color-primary);
}

.workqueue-folder-row[data-workqueue-parent="drafts"] {
  border-color: rgba(15, 98, 254, 0.1);
  background: var(--ds-color-info-bg);
  box-shadow: inset 2px 0 0 rgba(15, 98, 254, 0.34);
}

.workqueue-folder-row[data-workqueue-parent="unprocessed"] {
  border-color: rgba(218, 30, 40, 0.1);
  background: var(--ds-color-error-bg);
  box-shadow: inset 2px 0 0 rgba(218, 30, 40, 0.3);
}

.workqueue-folder-row[data-workqueue-parent="processing"] {
  border-color: rgba(138, 77, 0, 0.12);
  background: var(--ds-color-warning-bg);
  box-shadow: inset 2px 0 0 rgba(138, 77, 0, 0.28);
}

.workqueue-folder-row[data-workqueue-parent="done"] {
  border-color: rgba(25, 128, 56, 0.1);
  background: var(--ds-color-success-bg);
  box-shadow: inset 2px 0 0 rgba(25, 128, 56, 0.3);
}

.workqueue-folder-toggle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--ds-radius-sm);
  background: transparent;
  color: var(--ds-color-text-sub);
  font: inherit;
  font-size: var(--ds-font-xs);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.workqueue-folder-glyph {
  display: inline-grid;
  place-items: center;
  width: 10px;
  height: 10px;
  font-size: 0;
  line-height: 0;
}

.workqueue-folder-glyph::before {
  display: block;
  width: 10px;
  height: 10px;
  background: currentColor;
  clip-path: polygon(18% 8%, 82% 50%, 18% 92%);
  content: "";
  transform: rotate(90deg);
  transform-origin: 50% 50%;
}

.workqueue-folder-toggle[aria-expanded="false"] .workqueue-folder-glyph::before {
  transform: rotate(0deg);
}

.workqueue-folder-toggle:hover,
.workqueue-folder-toggle:focus-visible {
  border-color: #c7d4e4;
  background: #fff;
  color: var(--ds-color-text);
  outline: none;
}

.workqueue-folder-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workqueue-folder-count {
  display: inline-block;
  min-width: 2ch;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ds-color-text-sub);
  font-size: var(--ds-font-xs);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: var(--ds-line-compact);
  text-align: right;
  box-sizing: border-box;
}

.workqueue-children {
  display: grid;
  gap: 2px;
  margin: 3px 0 0;
  padding: 0 0 0 28px;
}

.workqueue-children[hidden] {
  display: none;
}

.workqueue-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 32px;
  padding: 0 8px 0 10px;
  border: 1px solid transparent;
  border-radius: var(--ds-radius-sm);
  background: transparent;
  color: var(--ds-color-text);
  font: inherit;
  font-size: var(--ds-font-sm);
  line-height: var(--ds-line-compact);
  text-align: left;
  cursor: pointer;
  column-gap: 8px;
}

.workqueue-child:hover,
.workqueue-child:focus-visible {
  border-color: #cad6e2;
  background: #fff;
  outline: none;
}

.workqueue-child.is-selected {
  border-color: rgba(0, 123, 255, 0.32);
  background: #fff;
  box-shadow: inset 3px 0 0 var(--ds-color-primary);
  color: var(--ds-color-primary);
  font-weight: 800;
}

.workqueue-child-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.workqueue-child-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--ds-color-text-sub);
  font-size: 11px;
  line-height: 1;
}

.workqueue-child-progress {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: #374151;
}

.workqueue-child-meta-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  object-fit: contain;
}

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

.workqueue-child-placeholder {
  min-height: 30px;
  padding: 6px 8px;
  color: var(--ds-color-text-sub);
  font-size: 12px;
  line-height: 1.45;
}

.workqueue-workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--ds-color-surface);
}

.workqueue-aux-toggle {
  position: absolute;
  top: 50%;
  right: clamp(138px, 13vw, 190px);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: var(--ds-radius-md);
  font-size: var(--ds-font-lg);
  font-weight: 800;
  line-height: 1;
  transform: translate(50%, -50%);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.workqueue-workspace:not([data-right-pane-mode]) .workqueue-aux-toggle,
.workqueue-workspace[data-right-pane-mode="list"] .workqueue-aux-toggle,
.workqueue-aux-toggle[hidden],
.workqueue-aux-toggle[aria-hidden="true"] {
  display: none;
  pointer-events: none;
}

.workqueue-aux-toggle[aria-pressed="true"] {
  right: 8px;
  border-color: rgba(180, 35, 24, 0.26);
  background: #fff1f0;
  color: #b42318;
  transform: translateY(-50%);
}

.workqueue-aux-toggle:hover:not(:disabled),
.workqueue-aux-toggle:focus-visible,
.workqueue-aux-toggle:active:not(:disabled) {
  transform: translate(50%, -50%);
}

.workqueue-aux-toggle[aria-pressed="true"]:hover:not(:disabled),
.workqueue-aux-toggle[aria-pressed="true"]:focus-visible,
.workqueue-aux-toggle[aria-pressed="true"]:active:not(:disabled) {
  transform: translateY(-50%);
}

.workqueue-aux-toggle:focus-visible {
  outline: 2px solid rgba(0, 123, 255, 0.34);
  outline-offset: 2px;
}

.workqueue-stage {
  display: flex;
  position: relative;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.workqueue-stage > .content,
.workqueue-stage > .new-request-area,
.workqueue-stage > .approval-area {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.workqueue-stage > .content {
  box-sizing: border-box;
  overflow: auto;
}

#tab-content.workqueue-legacy-list-root:not(.approval-mode) {
  display: none !important;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  pointer-events: none;
}

.workqueue-stage > #tab-content.approval-mode {
  display: flex !important;
  position: static;
  width: auto;
  height: auto;
  clip-path: none;
  pointer-events: auto;
  padding: var(--ds-space-3) var(--ds-space-4);
}

.workqueue-workspace[data-right-pane-mode="approval"] > .workqueue-stage > #tab-content.approval-mode,
.workqueue-workspace[data-right-pane-mode="new-request"] > .workqueue-stage > #tab-content.approval-mode {
  display: none !important;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  pointer-events: none;
}

.workqueue-workspace[data-right-pane-mode="list"] > .workqueue-stage > .new-request-area:not(.approval-modal),
.workqueue-workspace[data-right-pane-mode="list"] > .workqueue-stage > .approval-area,
.workqueue-workspace[data-right-pane-mode="approval"] > .workqueue-stage > .new-request-area:not(.approval-modal),
.workqueue-workspace[data-right-pane-mode="new-request"] > .workqueue-stage > .approval-area {
  display: none !important;
  pointer-events: none;
}

.workqueue-stage #tab-content.approval-mode .approval-unprocessed-root {
  width: 100%;
  max-width: none;
  margin: 0;
}

.workqueue-stage #tab-content.approval-mode .approval-unprocessed-header {
  flex-wrap: wrap;
}

.workqueue-stage #tab-content.approval-mode .approval-unprocessed-actions {
  flex: 0 0 auto;
}

.workqueue-stage > .new-request-area {
  height: auto;
  margin: var(--ds-space-3) var(--ds-space-4);
}

.workqueue-stage > .approval-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.workqueue-workspace[data-right-pane-mode="approval"] > .workqueue-stage > .approval-area {
  display: flex !important;
}

.workqueue-stage > .approval-area .approval-modal {
  flex: 1 1 auto;
  min-height: 0;
}

.workqueue-legacy-tab-compat {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  pointer-events: none;
}

.app-titlebar .notification-center-trigger {
  position: static;
  min-width: 104px;
  min-height: 34px;
  padding-inline: 12px 10px;
}

.workqueue-stage .notification-center-panel {
  top: calc(var(--workqueue-titlebar-height) + 10px);
}

.app-shell[data-right-aux-collapsed="true"] .new-request-area .column.thumbnail-column,
.app-shell[data-right-aux-collapsed="true"] .approval-modal .column.thumbnail-column {
  flex-basis: 0;
  width: 0;
  min-width: 0;
  max-width: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

.app-shell[data-right-aux-collapsed="true"] .new-request-area .column.viewer-column,
.app-shell[data-right-aux-collapsed="true"] .approval-modal .column.viewer-column {
  min-width: 0;
}

@media (max-width: 1024px) {
  .app-shell {
    --workqueue-nav-width: 208px;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .workqueue-layout {
    grid-template-columns: 1fr;
  }

  .workqueue-nav {
    max-height: 38vh;
    border-right: 0;
    border-bottom: 1px solid var(--ds-color-border);
  }

  .app-titlebar {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--ds-space-2);
    padding-block: var(--ds-space-2);
  }

  .app-titlebar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .workqueue-aux-toggle {
    right: 8px;
    transform: translateY(-50%);
  }

  .workqueue-aux-toggle:hover:not(:disabled),
  .workqueue-aux-toggle:focus-visible,
  .workqueue-aux-toggle:active:not(:disabled) {
    transform: translateY(-50%);
  }
}
