:root {
  color-scheme: light;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
}

button,
a,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-touch-callout: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #aaaefe;
  outline-offset: 2px;
}

.brand-mark {
  height: 42px;
  width: 42px;
  border-radius: 15px;
  background: linear-gradient(145deg, #777cfb, #4c4edf);
  box-shadow: 0 8px 18px #5658e844;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -.09em;
}

.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 15px;
  border-radius: 13px;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
  transition: transform .17s, box-shadow .17s, background-color .17s, border-color .17s;
  min-height: 42px;
}

.app-btn:not(:disabled):hover {
  transform: translateY(-1px)
}

.btn-primary {
  background: #5559ed;
  color: #fff;
  box-shadow: 0 6px 14px #5559ed22;
  border: 1px solid #5559ed
}

.btn-primary:hover:not(:disabled) {
  background: #4548ce;
  box-shadow: 0 8px 19px #5559ed36
}

.btn-outline {
  border: 1px solid #e1e5ef;
  background: #fff;
  color: #333b55
}

.btn-outline:hover:not(:disabled) {
  border-color: #bbc1ff;
  background: #fafaff
}

.btn-quiet {
  background: #f5f6fb;
  color: #505a74;
  border: 1px solid #edf0f7
}

.btn-quiet:hover:not(:disabled) {
  background: #edefff
}

.btn-danger {
  background: #f43f5e;
  color: #fff;
  border: 1px solid #f43f5e
}

.btn-danger:hover:not(:disabled) {
  background: #e11d48
}

.btn-sm {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11px;
  gap: 5px
}

.icon-btn {
  height: 39px;
  width: 39px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid #e8ebf3;
  background: #fff;
  color: #5a647d;
  transition: .15s
}

.icon-btn:hover:not(:disabled) {
  color: #5559ed;
  border-color: #cdd0ff;
  background: #f7f7ff
}

.icon-btn svg,
.app-btn svg,
.view-tab svg {
  width: 16px;
  height: 16px;
  flex: none
}

/* Horizontal PDF tabs: no sidebar on desktop, tablet, or phone. */
.document-bar {
  position: sticky;
  top: 76px;
  z-index: 20;
  padding: 12px 0 13px;
  background: rgba(247, 248, 252, .97);
  border-bottom: 1px solid #e9edf6;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px)
}

.document-tabs-scroll {
  display: flex;
  align-items: stretch;
  gap: 9px;
  min-width: 0;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-behavior: smooth;
  padding: 2px 1px 5px;
  overscroll-behavior-x: contain
}

.document-tabs-scroll::-webkit-scrollbar {
  display: none
}

.document-tabs-scroll:focus-visible {
  outline: 2px solid #9296fa;
  outline-offset: 2px;
  border-radius: 12px
}

.document-tab {
  display: flex;
  align-items: center;
  min-width: 155px;
  max-width: 260px;
  flex: 0 0 auto;
  gap: 0;
  border: 1px solid #e6eaf3;
  background: #fff;
  border-radius: 14px;
  padding: 5px 5px 5px 7px;
  box-shadow: 0 2px 9px #28366c08;
  transition: border-color .17s, background .17s, box-shadow .17s
}

.document-tab:hover {
  border-color: #c8cdf4;
  background: #fdfdff
}

.document-tab.active {
  border-color: #c5c9ff;
  background: #eeeefe;
  box-shadow: 0 3px 12px #6769ed13
}

.document-tab-main {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 9px;
  min-width: 0;
  flex: 1;
  padding: 5px 3px 5px 5px
}

.document-tab-icon {
  flex: none;
  display: grid;
  place-items: center;
  height: 35px;
  width: 35px;
  border-radius: 10px;
  color: #5e64ec;
  background: #f2f3ff;
  border: 1px solid #e7e9ff
}

.document-tab.active .document-tab-icon {
  background: #fff;
  border-color: #dedfff
}

.document-tab-copy {
  min-width: 0;
  max-width: 164px;
  display: block
}

.document-tab-name {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #34405e;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35
}

.document-tab-sub {
  display: block;
  color: #9aa3b7;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.55;
  margin-top: 2px;
  white-space: nowrap
}

.document-tab.active .document-tab-name {
  color: #3f43b6
}

.document-tab-delete {
  display: grid;
  place-items: center;
  flex: none;
  width: 27px;
  height: 29px;
  border-radius: 9px;
  color: #9aa3b8;
  transition: background .15s, color .15s
}

.document-tab-delete:hover,
.document-tab-delete:focus-visible {
  background: #ffe8ed;
  color: #e11d48
}

.document-tab-empty {
  display: inline-flex;
  align-items: center;
  min-height: 45px;
  color: #8893ab;
  font-size: 12px;
  font-weight: 700
}

.document-add {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  height: 49px;
  border-radius: 14px;
  background: #5659eb;
  border: 1px solid #5155e3;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 5px 13px #5559ed25;
  transition: transform .15s, background .15s
}

.document-add:hover {
  background: #4549d2;
  transform: translateY(-1px)
}

.document-add svg {
  height: 17px;
  width: 17px
}

@media(max-width:449px) {
  .document-add-label {
    display: none
  }
}

@media(max-width:640px) {
  .document-bar {
    padding: 10px 0
  }

  .document-tab {
    min-width: 149px;
    max-width: 230px
  }

  .document-tab-icon {
    width: 31px;
    height: 32px
  }

  .document-tab-name {
    max-width: 130px
  }

  .document-add {
    height: 43px;
    padding: 0 12px
  }

  .document-tabs-scroll {
    gap: 7px
  }
}

.view-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 800;
  color: #8b94a8;
  border-radius: 11px;
  transition: .15s;
  white-space: nowrap
}

.view-tab.active {
  background: #fff;
  color: #5154e7;
  box-shadow: 0 4px 12px #28366c12
}

.tab-count {
  background: #eaedf5;
  color: #737e93;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 10px
}

.view-tab.active .tab-count {
  background: #eeeeff;
  color: #5659e6
}

.page-card {
  border: 1px solid #e7ebf3;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 10px 34px #26335a08;
  transition: transform .18s, box-shadow .18s, border-color .18s
}

.page-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px #26335a13
}

.page-card.selected {
  border-color: #888cfa;
  box-shadow: 0 0 0 2px #e7e8ff, 0 12px 35px #26335a10
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .22s
}

.image-tile {
  aspect-ratio: 3/4;
  min-width: 0;
  background: #f9faff;
  border: 1px solid #eceef5;
  border-radius: 13px;
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center
}

.image-tile:has(.card-image) {
  background: #fff
}

.image-tile button.image-trigger {
  display: block;
  height: 100%;
  width: 100%;
  cursor: zoom-in;
  overflow: hidden
}

.image-tile button.image-trigger:hover .card-image {
  transform: scale(1.04)
}

.image-tile button.image-trigger:after {
  content: '⤢';
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: #ffffffef;
  color: #5559e5;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(4px);
  transition: .2s;
  box-shadow: 0 3px 12px #00000012;
  font-weight: 700
}

.image-tile button.image-trigger:hover:after,
.image-tile button.image-trigger:focus-visible:after {
  opacity: 1;
  transform: none
}

.status-pill {
  border-radius: 99px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap
}

.status-pill.done {
  background: #e8f9f1;
  color: #16996b
}

.status-pill.running,
.status-pill.queued {
  background: #fff5e6;
  color: #bb7a1b
}

.status-pill.error {
  background: #fff0f2;
  color: #d84666
}

.status-pill.idle {
  background: #f2f4f9;
  color: #8590a4
}

.status-dot {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: currentColor
}

.selection-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: linear-gradient(100deg, #f0f1ff, #f8f7ff);
  border: 1px solid #dee0ff;
  padding: 12px 15px;
  border-radius: 16px;
  color: #4044ad
}

.custom-check {
  appearance: none;
  width: 19px;
  height: 19px;
  border: 1.5px solid #cdd3e0;
  border-radius: 6px;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  transition: .12s
}

.custom-check:checked {
  background: #5559ed;
  border-color: #5559ed
}

.custom-check:checked:after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg)
}

.custom-check:disabled {
  opacity: .35;
  cursor: not-allowed
}

.placeholder-icon {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: #f0f1ff;
  color: #7f84de;
  display: grid;
  place-items: center;
  margin: auto auto 10px
}

.placeholder-icon svg {
  height: 19px;
  width: 19px
}

.skeleton {
  background: linear-gradient(90deg, #eef1fa 10%, #f9faff 35%, #eef1fa 60%);
  background-size: 240% 100%;
  animation: shimmer 1.4s infinite
}

@keyframes shimmer {
  to {
    background-position-x: -240%
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.spin {
  animation: spin 1.05s linear infinite
}

.modal-card {
  position: fixed;
  inset: 0;
  margin: auto;
  border: 1px solid #e6eaf3;
  background: #fff;
  border-radius: 24px;
  padding: 0;
  max-height: min(92vh, 900px);
  overflow-y: auto;
  box-shadow: 0 35px 110px #242a4b33;
  color: #222a43
}

.modal-card::backdrop {
  background: #222d4d66;
  backdrop-filter: blur(3px)
}

.modal-icon {
  height: 43px;
  width: 43px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eeeefe;
  color: #5357dc
}

.modal-icon svg {
  width: 21px;
  height: 21px
}

.field-label {
  font-weight: 800;
  color: #323951;
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px
}

.field-input {
  width: 100%;
  display: block;
  border: 1px solid #e1e5ee;
  background: #fbfcff;
  border-radius: 12px;
  padding: 12px 13px;
  font-size: 12px;
  color: #273149;
  outline: none;
  transition: border-color .15s, box-shadow .15s
}

.field-input:focus {
  border-color: #989dff;
  box-shadow: 0 0 0 3px #e5e7ff
}

.field-help {
  margin-top: 7px;
  font-size: 11px;
  color: #9ba4b5;
  line-height: 1.6
}

.viewer-nav {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e5ef;
  box-shadow: 0 6px 20px #26335a19;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #485170
}

.viewer-nav:hover {
  color: #5559ed
}

.viewer-nav:disabled {
  opacity: .25
}

.viewer-image {
  will-change: transform;
  transition: transform .12s
}

.pulse-dot {
  height: 7px;
  width: 7px;
  background: #f6ad50;
  border-radius: 50%;
  box-shadow: 0 0 0 4px #f6ad501f;
  animation: dotpulse 1.5s infinite
}

@keyframes dotpulse {
  50% {
    box-shadow: 0 0 0 8px #f6ad500d
  }
}

.toast-item {
  pointer-events: auto;
  max-width: 390px;
  border: 1px solid #e1e5f0;
  background: white;
  box-shadow: 0 15px 40px #25315920;
  border-radius: 15px;
  padding: 13px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #354059;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.6;
  animation: inToast .22s ease
}

.toast-item svg {
  color: #5a5eec;
  flex: none;
  margin-top: 1px;
  width: 17px;
  height: 17px
}

@keyframes inToast {
  from {
    opacity: 0;
    transform: translateY(12px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

@media(max-width:640px) {
  .app-btn {
    padding: 10px 12px
  }

  .btn-sm {
    padding: 8px 10px
  }

  .view-tab {
    padding: 0 9px;
    font-size: 10px;
    gap: 5px
  }

  .page-card:hover {
    transform: none
  }

  .image-tile button.image-trigger:after {
    opacity: 1;
    transform: none
  }
}

@media(prefers-reduced-motion:reduce) {

  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important
  }
}


/* V5: dense, purposeful workspace instead of a giant hero (light mode only). */
body {
  background: #f7f8fc;
}

.brand-mark {
  height: 37px;
  width: 37px;
  border-radius: 11px;
  font-size: 20px
}

.document-bar {
  top: 58px;
  padding: 7px 0 8px;
  box-shadow: 0 3px 16px #10174a06
}

.document-tabs-scroll {
  padding: 1px 1px 3px;
  gap: 7px
}

.document-tab {
  padding: 2px 4px 2px 5px;
  border-radius: 12px;
  min-width: 150px;
  max-width: 240px
}

.document-tab-main {
  padding: 3px 2px 3px 4px;
  gap: 7px
}

.document-tab-icon {
  height: 30px;
  width: 30px;
  border-radius: 9px
}

.document-tab-name {
  font-size: 11px
}

.document-tab-sub {
  font-size: 9px;
  margin-top: 0
}

.document-add {
  height: 38px;
  border-radius: 11px;
  padding: 0 11px;
  box-shadow: 0 3px 10px #5559ed20
}

.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 11px
}

.workspace-title {
  font-size: clamp(18px, 1.55vw, 24px);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -.045em;
  color: #1c2542;
  max-width: 100%;
  overflow-wrap: anywhere
}

.workspace-subtitle {
  font-size: 11px;
  color: #8490a7;
  margin-top: 3px;
  font-weight: 600;
  line-height: 1.5
}

.workspace-tabs-bar {
  border: 1px solid #e8ebf5;
  background: white;
  box-shadow: 0 3px 19px #26335a07;
  border-radius: 15px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 47px
}

.view-tab {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 9px
}

.page-card {
  border-radius: 17px;
  box-shadow: 0 5px 24px #26335a07
}

.page-card:hover {
  box-shadow: 0 10px 28px #26335a14
}

.provider-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

.welcome-drop {
  padding: 22px;
  border-radius: 20px;
  background: white;
  border: 1px dashed #cbd3ed;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  box-shadow: 0 5px 22px #26335a06;
  text-align: center
}

.welcome-drop h2 {
  font-weight: 800;
  font-size: 17px;
  color: #1f2947;
  letter-spacing: -.03em
}

.welcome-drop p {
  color: #8b96ad;
  font-size: 11px;
  margin: 4px 0 12px
}

.welcome-symbol {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #f0f1ff;
  color: #575beb;
  margin: 0 auto 8px
}

@media(max-width:640px) {
  .document-bar {
    padding: 6px 0;
    top: 58px
  }

  .document-add {
    height: 37px
  }

  .workspace-heading {
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 9px
  }

  .workspace-title {
    font-size: 17px
  }

  .workspace-subtitle {
    font-size: 10px;
    max-width: 270px
  }

  .workspace-heading .app-btn {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 10px;
    white-space: normal;
    text-align: center;
    max-width: 125px
  }

  .workspace-tabs-bar {
    padding: 5px;
    gap: 4px;
    flex-wrap: wrap
  }

  .workspace-tabs-bar #sectionHint {
    font-size: 10px
  }

  .view-tab {
    font-size: 10px;
    min-height: 31px
  }

  .provider-fields {
    grid-template-columns: 1fr;
    gap: 14px
  }
}

/* ========== V6: one unified workspace header ========== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid #e8ebf4;
  box-shadow: 0 3px 18px rgba(35, 47, 91, .045);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-shell {
  max-width: 1840px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 10px clamp(16px, 2.5vw, 38px);
  min-height: 68px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: clamp(14px, 2vw, 27px);
}

.header-brand {
  display: flex;
  align-items: center;
  flex: none;
  gap: 10px;
  white-space: nowrap
}

.header-brand .brand-mark {
  height: 40px;
  width: 40px;
  font-size: 22px;
  border-radius: 12px
}

.brand-name {
  color: #17223f;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -.07em;
  line-height: 1.05
}

.brand-subtitle {
  font-size: 8.5px;
  font-weight: 800;
  color: #94a2bd;
  letter-spacing: .17em;
  margin-top: 4px
}

.header-workspace {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%
}

.header-pdfs {
  flex: 1 1 240px;
  min-width: 130px;
  min-height: 43px;
  max-width: none;
  padding: 1px 1px 3px;
  gap: 7px
}

.header-pdfs .document-tab {
  min-width: 145px;
  max-width: 215px;
  min-height: 39px;
  padding: 2px 3px 2px 5px
}

.header-pdfs .document-tab-icon {
  height: 29px;
  width: 29px
}

.header-pdfs .document-tab-name {
  max-width: 130px
}

.header-pdfs .document-tab-copy {
  max-width: 140px
}

.header-pdfs .document-tab-delete {
  width: 24px;
  height: 28px
}

.header-upload {
  height: 40px;
  border-radius: 11px;
  padding: 0 10px;
  box-shadow: none;
  flex: none
}

.header-views {
  display: flex;
  align-items: center;
  flex: none;
  min-width: 0;
  margin-left: 2px
}

.header-views:not(.hidden) {
  display: flex
}

.view-tab-group {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 1px;
  padding: 3px;
  background: #f3f4fa;
  border: 1px solid #edf0f7;
  border-radius: 12px
}

.header-views .view-tab {
  min-height: 32px;
  padding: 0 9px;
  font-size: 10.5px;
  gap: 5px
}

.view-label-small,
.generate-small,
.generate-tiny {
  display: none
}

.header-generate {
  flex: none
}

.header-generate-btn {
  min-height: 39px;
  border-radius: 11px;
  padding: 8px 11px;
  font-size: 11px;
  gap: 6px
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: none
}

.header-settings {
  height: 40px;
  min-height: 40px;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 11px
}

.header-jobs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  color: #8190a8;
  white-space: nowrap
}

.header-jobs:empty {
  display: none
}

.workspace-body {
  max-width: 1840px;
  margin: 0 auto;
  padding: 14px clamp(16px, 2.5vw, 38px) 30px
}

.workspace-body #selectionBar:not(:empty) {
  margin-bottom: 12px
}

.workspace-body #content {
  margin-top: 0
}

.workspace-body .welcome-drop {
  min-height: 170px
}

/* Medium screens: keep same header, but let the navigation occupy row two. */
@media(max-width:1190px) {
  .header-shell {
    grid-template-columns: minmax(0, 1fr) max-content;
    row-gap: 7px;
    column-gap: 12px;
    min-height: 0;
    padding-top: 9px;
    padding-bottom: 8px
  }

  .header-brand {
    grid-row: 1;
    grid-column: 1
  }

  .header-tools {
    grid-row: 1;
    grid-column: 2;
    justify-self: end
  }

  .header-workspace {
    grid-row: 2;
    grid-column: 1 / -1
  }

  .header-pdfs {
    min-width: 120px;
    max-width: none
  }

  .workspace-body {
    padding-top: 12px
  }
}

@media(max-width:640px) {
  .header-shell {
    padding: 8px 13px 7px;
    row-gap: 7px
  }

  .header-brand {
    gap: 8px
  }

  .header-brand .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 18px
  }

  .brand-name {
    font-size: 19px
  }

  .brand-subtitle {
    font-size: 7px;
    letter-spacing: .105em;
    margin-top: 3px
  }

  .header-jobs {
    display: none
  }

  .header-settings {
    min-height: 35px;
    height: 35px;
    padding: 0 10px;
    gap: 6px
  }

  .header-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-areas: 'pdfs add' 'views generate';
    gap: 6px 8px;
    align-items: center
  }

  .header-pdfs {
    grid-area: pdfs;
    min-height: 39px;
    max-width: 100%;
    width: 100%;
    padding-bottom: 0
  }

  .header-upload {
    grid-area: add;
    height: 38px;
    padding: 0 11px
  }

  .header-views {
    grid-area: views;
    min-width: 0;
    margin-left: 0
  }

  .header-generate {
    grid-area: generate;
    justify-self: end
  }

  .view-tab-group {
    max-width: 100%;
    border-radius: 10px;
    padding: 2px
  }

  .header-views .view-tab {
    min-height: 31px;
    font-size: 10px;
    padding: 0 8px;
    gap: 4px
  }

  .view-label-full {
    display: none
  }

  .view-label-small {
    display: inline
  }

  .generate-long {
    display: none
  }

  .generate-small {
    display: inline
  }

  .header-generate-btn {
    min-height: 35px;
    padding: 6px 9px;
    font-size: 10px;
    border-radius: 10px;
    gap: 5px
  }

  .workspace-body {
    padding: 10px 13px 25px
  }
}

@media(max-width:380px) {
  .header-views .view-tab {
    padding: 0 6px;
    font-size: 9.5px
  }

  .header-views .view-tab svg {
    width: 13px;
    height: 13px
  }

  .tab-count {
    padding: 2px 4px
  }

  .generate-small {
    display: none
  }

  .generate-tiny {
    display: inline
  }

  .header-generate-btn {
    padding: 6px 8px
  }

  .settings-label {
    display: none
  }

  .header-settings {
    width: 36px;
    padding: 0;
    justify-content: center
  }
}

.header-views.hidden,
.header-generate.hidden {
  display: none
}

/* On a wide display the whole control group sits together in the header's center,
   rather than stretching a single PDF tab across an empty navigation track. */
@media(min-width:1191px) {
  .header-workspace {
    justify-content: center
  }

  .header-pdfs {
    flex: 0 1 auto;
    width: max-content;
    min-width: 155px;
    max-width: min(38vw, 450px)
  }
}

@media(max-width:449px) {
  .document-add-label {
    display: inline
  }
}

#selectionBar:not(:empty) {
  position: sticky;
  top: calc(var(--workspace-header-height, 160px) + 8px);
  z-index: 30;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px #27324a12;
  border-radius: 16px
}

.delete-ai-image {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 7px 4px;
  margin-top: 8px;
  border: 1px solid #f3d8de;
  border-radius: 8px;
  background: #fff7f8;
  color: #c34c63;
  font-size: 10px;
  font-weight: 700
}

.delete-ai-image:hover {
  background: #ffeef1
}

.delete-ai-image svg {
  width: 12px;
  height: 12px
}

/* Combined preview matches normal page preview height. */
.combined-card {
  min-width: 0;
  align-self: start;
}

.combined-card .image-tile {
  aspect-ratio: 3 / 2;
  width: 100%;
  min-width: 0;
}

.combined-card .card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}