.arrange-app {
  --ink: #202722;
  --muted: #586159;
  --border: #c8cdc2;
  --green: #285443;
  max-width: 1328px;
  margin: 0 auto;
  padding: 32px 24px 0;
  color: var(--ink);
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.arrange-app * {
  box-sizing: border-box;
}

.arrange-app [hidden] {
  display: none !important;
}

.arrange-app button,.arrange-app input,.arrange-app select {
  font: inherit;
}

.workspace-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.workspace-intro .eyebrow {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 650;
}

.workspace-intro h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem,3.3vw,2.65rem);
  font-weight: 650;
  letter-spacing: -.05em;
  line-height: 1.12;
}

.workspace-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.intro-stamp {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 12px 24px;
  border-left: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.6;
}

.intro-stamp>span:first-child {
  font-size: 43px;
  font-weight: 350;
  color: var(--green);
  line-height: 1;
}

.workspace-shell {
  border: 1px solid #aab2a6;
  background: #fff;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 3px 0 #20272206;
}

.workspace-tabs {
  display: flex;
  background: #edeee8;
  border-bottom: 1px solid #aab2a6;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tool-tab {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
  padding: 14px 22px;
  min-height: 61px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  border-top: 3px solid transparent;
}

.tool-tab:last-child {
  border-right: 0;
}

.tool-tab[aria-current] {
  color: var(--ink);
  background: #fff;
  border-top-color: var(--green);
}

.tool-tab:hover {
  background: #e3e6dc;
  color: var(--ink);
}

.tool-tab[aria-current]:hover {
  background: #fff;
}

.tool-tab:active {
  background: #d3dacd;
}

.tool-tab:focus-visible {
  outline-offset: -5px;
}

.tool-tab[aria-disabled=true] {
  opacity: .6;
  cursor: wait;
}

.tab-icon {
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.tab-number {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
}

.workbench {
  display: grid;
  grid-template-columns: 322px minmax(0,1fr);
  min-height: 616px;
}

.control-panel {
  padding: 25px 24px 22px;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.step-label {
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--muted);
  margin: 0 0 10px;
}

.control-heading h2 {
  font-size: 21px;
  letter-spacing: -.035em;
  margin: 0 0 8px;
  font-weight: 650;
}

.control-heading>p:last-child {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 22px;
  line-height: 1.65;
}

.file-drop {
  border: 1px dashed #96a18f;
  background: #f8f9f5;
  border-radius: 3px;
  padding: 19px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
  transition: background .15s,border-color .15s;
  min-width: 0;
}

.file-drop svg {
  color: var(--green);
  margin-bottom: 3px;
}

.file-drop strong {
  font-size: 13px;
  font-weight: 600;
}

.file-drop>span {
  font-size: 11px;
  color: var(--muted);
}

.file-drop small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}

.file-drop.drag-over {
  background: #f8e8b6;
  border: 2px solid #285443;
  padding: 18px 11px 13px;
}

.arrange-app .button {
  border: 1px solid transparent;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  line-height: 1.4;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s,color .15s,border-color .15s;
}

.button-primary {
  background: var(--green);
  color: white;
}

.button-primary:hover {
  background: #193e2f;
}

.button-primary:active {
  background: #102c20;
}

.file-picker {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 4px;
}

.file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-picker:focus-within {
  outline: 3px solid var(--green);
  outline-offset: 4px;
}

.file-picker:has(input:disabled) {
  opacity: .5;
  cursor: wait;
}

.arrange-app input:disabled {
  cursor: not-allowed;
}

.arrange-app button:disabled {
  color: #70766d;
  cursor: not-allowed;
  background: #e8ebe3;
  border-color: #d6dacf;
  box-shadow: none;
}

.arrange-app .text-button:disabled {
  background: transparent;
  color: #73796f;
  border-color: transparent;
  opacity: .7;
}

.arrange-app :focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

.text-button {
  appearance: none;
  background: none;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  color: var(--green);
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
  line-height: 1.4;
  text-underline-offset: 3px;
}

.text-button:hover {
  text-decoration: underline;
  color: #173b2b;
}

.text-button:active {
  color: #0d261b;
}

.example-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  font-size: 11px;
}

.example-button>span {
  font-size: 17px;
}

.file-summary {
  margin-top: 9px;
  padding-top: 12px;
  border-top: 1px solid #dfe3d8;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.label-row h3 {
  font-size: 12px;
  margin: 0;
  font-weight: 600;
}

.label-row h3>span {
  font-weight: 400;
  color: var(--muted);
  margin-left: 5px;
}

.label-row .text-button {
  font-size: 10px;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 225px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.empty-file {
  color: #727b6e;
  font-size: 11px;
  padding: 0 0 14px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #e4e6df;
  padding: 7px 0;
}

.file-details {
  min-width: 0;
}

.file-name {
  font-size: 11px;
  font-weight: 550;
  display: block;
  overflow-wrap: anywhere;
}

.file-size {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.icon-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  min-width: 44px;
  min-height: 44px;
  font-size: 22px;
  cursor: pointer;
  border-radius: 3px;
}

.icon-button:hover {
  background: #fcece6;
  color: #852b1e;
  border-color: #dcb1a7;
}

.icon-button:active {
  background: #efd0c6;
}

.export-controls {
  border-top: 1px solid #dfe3d8;
  padding-top: 20px;
  margin-top: 12px;
}

.arrange-app label:not(.file-picker):not(.tile-select) {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 7px;
}

.arrange-app input[type=text],.arrange-app select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #aab2a6;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 1px 1px #20272203;
}

.arrange-app input[type=text]:hover,.arrange-app select:hover {
  border-color: #64765c;
}

.arrange-app input[aria-invalid=true] {
  border: 2px solid #a23824;
  padding: 9px 10px;
  background: #fff9f7;
}

.arrange-app input::placeholder {
  color: #687064;
  opacity: 1;
}

.field-help {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.65;
  margin: 7px 0 12px;
  display: block;
}

.export-controls .button-export {
  background: #efc34d;
  color: #202722;
  border-color: #d8ad37;
  width: 100%;
  margin-top: 10px;
  font-size: 12px;
  justify-content: space-between;
  min-height: 47px;
}

.button-export>span:last-child {
  font-size: 21px;
  line-height: 1;
}

.export-controls .button-export:hover {
  background: #e3b53c;
  border-color: #b68a1d;
}

.export-controls .button-export:active {
  background: #d5a52b;
}

.export-controls .button-export:disabled {
  background: #e8ebe3;
  color: #70766d;
  border-color: #d6dacf;
}

.export-note {
  font-size: 10px;
  margin: 9px 0 0;
  text-align: center;
  color: var(--muted);
}

.download-result {
  border-left: 3px solid var(--green);
  background: #eff4eb;
  margin-top: 14px;
  padding: 10px;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.download-result strong {
  display: block;
  font-weight: 600;
}

.download-result a {
  display: flex;
  min-height: 44px;
  align-items: center;
  line-height: 1.7;
  color: var(--green);
}

.page-desk {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f0f1eb;
}

.desk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 15px;
  border-bottom: 1px solid #d4d9cc;
  background: #f6f7f2;
}

.desk-toolbar h2 {
  font-size: 14px;
  letter-spacing: -.01em;
  font-weight: 650;
  margin: 0 0 4px;
}

.desk-toolbar p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.page-count {
  display: inline-block;
  font-size: 10px;
  font-weight: 400;
  margin-left: 9px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  color: var(--muted);
}

.view-switch {
  display: flex;
  border: 1px solid #aab2a6;
  border-radius: 3px;
  background: #f5f6f0;
  padding: 2px;
}

.view-switch button {
  font-size: 11px;
  min-height: 44px;
  padding: 6px 13px;
  background: transparent;
  border: 0;
  border-radius: 2px;
  color: var(--muted);
  cursor: pointer;
}

.view-switch button:hover {
  background: #dfe4d8;
  color: var(--ink);
}

.view-switch button[aria-pressed=true] {
  background: #fff;
  box-shadow: 0 1px 3px #20272216;
  color: var(--ink);
}

.view-switch button:disabled {
  background: transparent;
  border: 0;
  color: #777d73;
}

.status-line {
  min-height: 44px;
  font-size: 11px;
  color: var(--muted);
  padding: 13px 26px 8px;
  overflow-wrap: anywhere;
}

.error-banner {
  font-size: 12px;
  padding: 14px 16px;
  margin: 0 26px 12px;
  background: #fff1e9;
  border: 1px solid #b26a52;
  border-left: 3px solid #94361e;
  color: #782a18;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.error-banner:before {
  content: 'Please check: ';
  font-weight: 650;
}

.desk-empty {
  min-height: 405px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.empty-stack {
  position: relative;
  width: 176px;
  height: 187px;
  margin: 4px auto 21px;
}

.empty-paper {
  width: 112px;
  height: 151px;
  background: #fff;
  border: 1px solid #b6bfb0;
  border-radius: 2px;
  position: absolute;
  left: 27px;
  top: 12px;
}

.back-paper {
  transform: rotate(-9deg);
  background: #e1e6db;
  left: 13px;
  top: 8px;
}

.front-paper {
  transform: rotate(4deg);
  padding: 22px 16px;
  text-align: left;
  box-shadow: 3px 3px 0 #20272208;
}

.paper-line {
  display: block;
  width: 100%;
  height: 3px;
  margin-bottom: 9px;
  background: #d2d9cb;
}

.paper-line.short {
  width: 54%;
  background: #9eae96;
  height: 4px;
  margin-bottom: 17px;
}

.front-paper b {
  display: block;
  font-size: 27px;
  font-weight: 450;
  color: #4d6550;
  letter-spacing: -1px;
  margin: 12px 0 1px;
  line-height: 1;
}

.paper-caption {
  font-size: 7px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.stack-arrow {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 58px;
  font-weight: 300;
  line-height: 1;
  transform: rotate(-15deg);
  color: var(--green);
}

.desk-empty h3 {
  font-size: 18px;
  letter-spacing: -.025em;
  font-weight: 550;
  margin: 0 0 10px;
}

.desk-empty p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
}

.empty-key {
  margin-top: 24px;
  display: flex;
  gap: 13px;
  font-size: 9px;
  color: var(--muted);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.empty-key>span {
  color: #7c8875;
}

.desk-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #d4d9cc;
  padding: 13px 26px;
  font-size: 10px;
  color: var(--muted);
  margin-top: auto;
  flex-wrap: wrap;
  background: #f6f7f2;
  min-height: 44px;
}

.desk-bottom>span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.privacy-dot {
  height: 5px;
  width: 5px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.workspace-footnotes {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 30px;
  padding: 25px 0 26px;
  border-bottom: 1px solid var(--border);
}

.workspace-footnotes>div {
  display: flex;
  gap: 12px;
  align-items: start;
}

.footnote-number {
  font-size: 10px;
  line-height: 1.8;
  color: var(--green);
  font-weight: 600;
  border-top: 2px solid var(--green);
  padding-top: 4px;
  min-width: 22px;
}

.workspace-footnotes p {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.75;
}

.workspace-footnotes strong {
  color: var(--ink);
  font-weight: 600;
}

.workspace-help {
  border-bottom: 1px solid var(--border);
  padding-block: 2px;
}

.workspace-help summary {
  cursor: pointer;
  min-height: 48px;
  padding-block: 14px;
  font-size: 12px;
  color: var(--green);
  font-weight: 550;
}

.workspace-help summary:hover {
  text-decoration: underline;
}

.workspace-help summary:active {
  color: #102c20;
}

.workspace-help>div {
  max-width: 76ch;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  padding-bottom: 16px;
}

.workspace-help code {
  font-size: 12px;
  background: #e5e9df;
  padding: 2px 4px;
}

.noscript-message {
  background: #fff1e9;
  border: 1px solid #b26a52;
  color: #782a18;
  padding: 20px;
  margin: 0;
}

.selection-toolbar {
  padding: 0 26px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}

.selection-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.selection-actions .text-button {
  min-height: 44px;
  padding: 8px 0;
  font-size: 10px;
}

.page-grid {
  padding: 0 26px 26px;
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(155px,1fr));
  gap: 16px;
  align-items: start;
}

.page-card {
  min-width: 0;
  border: 1px solid #bcc5b4;
  border-radius: 3px;
  background: #fff;
  overflow: hidden;
  transition: border-color .15s,box-shadow .15s;
}

.page-card.is-selected {
  border-color: #285443;
  box-shadow: 0 0 0 1px #285443;
}

.page-card.is-dragging {
  opacity: .4;
}

.page-card[draggable=true] {
  cursor: grab;
}

.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 4px 8px;
  background: #f7f8f3;
}

.tile-select {
  display: flex !important;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  min-height: 44px;
  cursor: pointer;
  margin: 0 !important;
  font-weight: 550;
}

.tile-select input {
  width: 18px;
  height: 18px;
  accent-color: #285443;
  cursor: pointer;
  margin: 0;
}

.tile-select:has(input:focus-visible) {
  outline: 3px solid var(--green);
  outline-offset: -1px;
}

.rotation-badge {
  font-size: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.tile-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 173px;
  background: #e4e7dd;
  border: 0;
  border-block: 1px solid #d2d8c9;
  color: var(--ink);
  cursor: pointer;
  padding: 10px;
  overflow: hidden;
}

.tile-preview:hover {
  background: #d5deca;
}

.tile-preview:active {
  background: #c5d3b8;
}

.tile-paper {
  display: block;
  background: #fff;
  position: relative;
  width: 88px;
  height: 116px;
  padding: 11px 10px;
  transform: rotate(var(--page-turn));
  border: 1px solid #b8c0b0;
  box-shadow: 1px 2px 2px #2027220a;
  text-align: left;
}

.mini-file-label {
  display: block;
  font-size: 6px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--green);
}

.mini-lines {
  display: block;
  height: 21px;
  margin: 9px 0 10px;
  background: repeating-linear-gradient(to bottom,#d3dacd 0,#d3dacd 2px,transparent 2px,transparent 7px);
}

.mini-number {
  font-size: 26px;
  font-weight: 450;
  line-height: 1;
  display: block;
  letter-spacing: -1px;
}

.mini-page-word {
  font-size: 5px;
  letter-spacing: .6px;
  color: var(--muted);
  display: block;
  margin-top: 5px;
}

.preview-prompt {
  font-size: 8px;
  color: var(--green);
  margin-top: 3px;
}

.tile-meta {
  font-size: 9px;
  padding: 10px 10px 7px;
  color: var(--muted);
  line-height: 1.6;
}

.tile-file-name {
  display: block;
  color: var(--ink);
  font-size: 10px;
  font-weight: 550;
  overflow-wrap: anywhere;
  margin-bottom: 3px;
}

.tile-actions {
  display: flex;
  align-items: center;
  border-top: 1px solid #e2e6dc;
  padding: 0 3px;
  gap: 2px;
}

.tile-move {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 0;
  color: var(--green);
  font-size: 18px;
  cursor: pointer;
  border-radius: 2px;
}

.tile-move:hover {
  background: #e9efdf;
}

.tile-move:active {
  background: #d8e4c8;
}

.tile-position {
  margin-left: auto;
  padding-right: 5px;
  font-size: 8px;
  color: var(--muted);
}

.arrange-app fieldset {
  padding: 20px 0 0;
  margin: 18px 0 0;
  border: 0;
  border-top: 1px solid #dfe3d8;
  min-width: 0;
}

.arrange-app legend {
  padding: 0;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 650;
  letter-spacing: .1em;
  color: var(--muted);
  float: left;
  width: 100%;
  margin-bottom: 14px;
}

.arrange-app legend+* {
  clear: both;
}

.range-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.range-row input {
  flex: 1;
}

.range-row .button {
  flex-shrink: 0;
  padding: 8px 11px;
}

.button-secondary {
  background: #f6f7f2;
  border-color: #aab2a6 !important;
  color: var(--green);
}

.button-secondary:hover {
  background: #e5ecdc;
  border-color: #6e8463 !important;
}

.button-secondary:active {
  background: #d3dfc6;
}

.field-error {
  color: #94361e;
  font-size: 11px;
  line-height: 1.7;
  margin: 7px 0 12px;
  overflow-wrap: anywhere;
}

.field-error:before {
  content: 'Check the range: ';
  font-weight: 650;
}

.rotation-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.rotation-actions .button {
  flex: 1;
  white-space: nowrap;
  font-size: 11px;
}

.rotation-actions .button>span {
  font-size: 18px;
}

.preview-view {
  padding: 0 26px 18px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
}

.preview-toolbar>span {
  overflow-wrap: anywhere;
  max-width: 100%;
}

.preview-toolbar a {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
}

.native-preview {
  height: 500px;
  background: #dfe3d8;
  border: 1px solid #b8c2af;
  border-radius: 2px;
}

.native-preview object {
  width: 100%;
  height: 100%;
  display: block;
}

.native-preview object>p {
  padding: 20px;
  font-size: 13px;
}

.preview-help {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 0;
}

.is-busy .file-drop {
  opacity: .7;
}

.is-busy .status-line {
  color: #285443;
  font-weight: 600;
}

.is-busy .status-line:before {
  content: '◌ ';
  font-size: 14px;
}

@media (min-width:1440px) {
  .arrange-app {
    padding-top: 34px;
  }
  .workbench {
    grid-template-columns: 322px minmax(0,1fr);
  }
}

@media (max-width:1024px) {
  .workbench {
    grid-template-columns: 290px minmax(0,1fr);
  }
  .control-panel {
    padding: 24px 20px;
  }
  .desk-toolbar {
    padding-inline: 20px;
    align-items: start;
    flex-wrap: wrap;
  }
  .status-line,.desk-bottom {
    padding-inline: 20px;
  }
  .page-grid {
    padding-inline: 20px;
    grid-template-columns: repeat(auto-fill,minmax(145px,1fr));
    gap: 12px;
  }
  .selection-toolbar {
    padding-inline: 20px;
  }
  .intro-stamp {
    display: none;
  }
  .preview-view {
    padding-inline: 20px;
  }
}

@media (max-width:767px) {
  .arrange-app {
    padding: 25px 20px 0;
  }
  .workspace-intro {
    margin-bottom: 22px;
  }
  .workspace-intro h1 {
    font-size: clamp(1.7rem,6vw,2.4rem);
  }
  .workspace-intro>div>p:last-child {
    font-size: 13px;
    line-height: 1.65;
    max-width: 46ch;
  }
  .workspace-tabs {
    scrollbar-width: thin;
  }
  .tool-tab {
    flex: none;
    font-size: 12px;
    padding: 11px 14px;
    min-height: 54px;
    gap: 8px;
  }
  .tab-icon {
    font-size: 21px;
  }
  .tab-number {
    display: none;
  }
  .workbench {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .control-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 22px 20px;
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 0 22px;
  }
  .control-heading {
    grid-column: 1/-1;
  }
  .control-heading h2 {
    font-size: 21px;
  }
  .control-heading>p:last-child {
    margin-bottom: 16px;
  }
  .file-drop {
    grid-column: 1;
    grid-row: 2/5;
    min-height: 220px;
    padding: 15px 10px;
    justify-content: center;
  }
  .file-drop strong {
    font-size: 12px;
  }
  .file-drop>span {
    font-size: 10px;
  }
  .file-drop small {
    font-size: 9px;
  }
  .file-drop.drag-over {
    padding: 14px 9px;
  }
  .example-button {
    grid-column: 1;
    grid-row: 5;
    font-size: 10px;
    align-self: start;
  }
  .file-summary {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
  .export-controls {
    grid-column: 2;
    grid-row: 3/6;
    margin-top: 0;
    padding-top: 15px;
    align-self: start;
  }
  .split-options,.rotate-options {
    grid-column: 1/-1;
    grid-row: 6;
  }
  .desk-toolbar {
    padding: 20px 20px 14px;
    align-items: center;
  }
  .desk-empty {
    min-height: 350px;
  }
  .workspace-footnotes {
    gap: 16px;
    grid-template-columns: 1fr;
    padding-block: 22px;
  }
  .workspace-footnotes p {
    margin-top: 2px;
    font-size: 11px;
  }
  .footnote-number {
    padding-top: 1px;
  }
  .workspace-help summary {
    font-size: 12px;
  }
  .page-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .tile-preview {
    height: 165px;
  }
  .selection-actions {
    gap: 14px;
  }
  .native-preview {
    height: 450px;
  }
}

@media (max-width:480px) {
  .control-panel {
    display: block;
    padding: 20px;
  }
  .file-drop {
    min-height: 0;
    padding: 18px 14px;
  }
  .file-drop.drag-over {
    padding: 17px 13px;
  }
  .file-drop>span {
    font-size: 11px;
  }
  .file-drop small {
    font-size: 10px;
  }
  .example-button {
    font-size: 11px;
  }
  .file-summary {
    border-top: 1px solid #dfe3d8;
    padding-top: 10px;
    margin-top: 5px;
  }
  .export-controls {
    padding-top: 18px;
    margin-top: 12px;
  }
  .desk-toolbar {
    gap: 12px;
  }
  .desk-toolbar p {
    font-size: 10px;
  }
  .view-switch button {
    min-height: 44px;
    padding-inline: 11px;
    font-size: 10px;
  }
  .desk-empty {
    min-height: 350px;
    padding: 24px 16px;
  }
  .desk-empty h3 {
    font-size: 17px;
  }
  .page-grid {
    gap: 10px;
    padding: 0 14px 20px;
  }
  .tile-top {
    padding-inline: 6px;
  }
  .rotation-badge {
    display: none;
  }
  .tile-actions {
    gap: 0;
  }
  .tile-move {
    min-width: 44px;
  }
  .tile-position {
    font-size: 7px;
    padding-right: 3px;
  }
  .tile-meta {
    padding: 8px;
  }
  .tile-preview {
    height: 155px;
  }
  .desk-bottom {
    padding-inline: 16px;
  }
  .selection-toolbar {
    padding-inline: 16px;
  }
  .error-banner {
    margin-inline: 16px;
  }
  .preview-view {
    padding-inline: 16px;
  }
  .native-preview {
    height: 400px;
  }
}

@media (max-width:389px) {
  .arrange-app {
    padding: 22px 16px 0;
  }
  .workspace-intro h1 {
    font-size: 1.8rem;
    max-width: 15ch;
  }
  .workspace-intro .eyebrow {
    font-size: 9px;
  }
  .workspace-intro>div>p:last-child {
    font-size: 12px;
  }
  .tool-tab {
    padding: 10px 12px;
    gap: 7px;
    font-size: 11px;
  }
  .tool-tab .tab-icon {
    font-size: 18px;
  }
  .control-panel {
    padding: 19px 16px;
  }
  .desk-toolbar {
    padding: 18px 16px 12px;
  }
  .desk-toolbar h2 {
    font-size: 13px;
  }
  .desk-toolbar p {
    max-width: 30ch;
  }
  .view-switch {
    width: 100%;
  }
  .view-switch button {
    flex: 1;
    min-height: 44px;
  }
  .page-grid {
    grid-template-columns: 1fr;
    padding-inline: 24px;
  }
  .tile-preview {
    height: 180px;
  }
  .rotation-badge {
    display: block;
  }
  .tile-meta {
    padding: 10px;
  }
  .tile-file-name {
    font-size: 11px;
  }
  .tile-select {
    font-size: 11px;
  }
  .tile-position {
    font-size: 9px;
  }
  .selection-toolbar {
    display: block;
  }
  .selection-actions {
    gap: 18px;
  }
  .selection-toolbar>span {
    display: block;
    margin-top: 4px;
  }
  .selection-actions .text-button {
    font-size: 10px;
  }
  .desk-empty h3 {
    font-size: 16px;
  }
  .desk-empty p {
    font-size: 11px;
  }
  .empty-key {
    gap: 9px;
    font-size: 8px;
  }
  .desk-bottom {
    font-size: 9px;
    gap: 7px;
  }
  .empty-stack {
    transform: scale(.9);
    margin-bottom: 10px;
  }
  .desk-empty {
    min-height: 325px;
  }
  .native-preview {
    height: 360px;
  }
}

@media (prefers-reduced-motion:reduce) {
  .arrange-app * {
    transition: none !important;
    animation: none !important;
  }
}

/* Native browser PDF thumbnails; numbered tiles are retained as the fallback. */

.tile-visual {
  position: relative;
  overflow: hidden;
  background: #e4e7dd;
}

.native-thumbnail {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tile-preview.has-native-thumbnail {
  background: transparent;
}

.has-native-thumbnail .tile-paper {
  visibility: hidden;
}

.has-native-thumbnail .preview-prompt {
  background: #f7f8f3ed;
  padding: 3px 8px;
  border: 1px solid #bac5b1;
  border-radius: 2px;
}

.tile-preview.has-native-thumbnail:hover {
  background: #28544316;
}

.tile-preview.has-native-thumbnail:active {
  background: #2854432a;
}
