/* Same paper, ink, typography and quiet borders as the existing tool workbench. */
.local-page h1 {
  font-size: 30px;
  letter-spacing: -1px;
  word-break: keep-all;
}
.local-page .intro {
  margin-bottom: 24px;
}
.local-page .tool-nav {
  padding-bottom: 12px;
}
.local-page .workspace {
  min-height: 560px;
}
.local-page .local-workspace {
  overflow: clip;
}
.local-page .group-title {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 12px;
}
.local-page .check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}
.local-page .check input {
  width: 16px;
  height: 16px;
  flex: none;
  margin: 0;
}
.local-page output {
  float: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.local-page .stage {
  justify-content: flex-start;
}
.local-page .preview-area {
  min-height: 300px;
  flex: 0 1 auto;
  margin: auto 0;
  overflow: visible;
}
.local-page #preview {
  max-height: 580px;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}
.local-page .stage:has(#preview:not([hidden])) {
  position: sticky;
  top: 16px;
  align-self: start;
  min-height: 580px;
}
.position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 200px;
  margin-top: 10px;
}
.position-grid button {
  font-size: 18px;
  padding: 7px;
}
.position-grid button[aria-pressed="true"] {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue);
}
.photo-list {
  max-height: 220px;
}
.photo-list li {
  display: grid;
  grid-template-columns: 1fr 30px;
  gap: 4px;
  min-width: 0;
}
.photo-select {
  justify-content: flex-start;
  font-weight: 400;
  text-align: left;
  min-width: 0;
  font-size: 12px;
  padding: 6px;
}
.photo-select img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 3px;
  flex: none;
}
.photo-select span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-select[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.photo-remove {
  padding: 0;
  font-size: 16px;
  min-height: 32px;
  font-weight: 400;
}
.photo-input h3,
#crop-settings h3 {
  font-size: 13px;
  margin: 12px 0 8px;
}
.photo-input .file-picker {
  min-height: 60px;
  padding: 12px;
}
.photo-input .file-note {
  margin-bottom: 4px;
}
.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 14px;
}
#crop-settings {
  font-size: 13px;
  padding: 10px 0;
  border-bottom: 1px solid var(--soft-line);
}
#crop-settings summary {
  cursor: pointer;
  line-height: 1.8;
}
#split-controls {
  border-top: 1px solid var(--line);
  padding-top: 4px;
  margin-top: auto;
}
#split-controls .hint {
  margin-top: 4px;
}
.local-page[data-tool="before-after"] #preview.interactive {
  touch-action: none;
  cursor: ew-resize;
}
.local-page .ad-wrap {
  min-height: 128px;
  margin: 32px auto;
  position: static;
  max-width: 100%;
  overflow: hidden;
}
.local-page .learn {
  max-width: 900px;
}
.local-page .text-workspace {
  display: block;
  min-height: 0;
}
.text-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.text-pane {
  padding: 20px;
  min-width: 0;
}
.text-pane:first-child {
  border-right: 1px solid var(--line);
}
.text-pane-heading,
.text-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.text-pane-heading {
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 700;
}
.text-pane textarea {
  height: 275px;
  min-height: 160px;
  line-height: 1.8;
  font-size: 14px;
  resize: vertical;
  tab-size: 4;
}
.text-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.file-button {
  position: relative;
  cursor: pointer;
  font-size: 12px;
}
.file-button input {
  position: absolute;
  opacity: 0;
  width: 1px !important;
  height: 1px;
}
.file-button:focus-within {
  outline: 3px solid var(--focus);
}
.compare-settings {
  border-top: 1px solid var(--line);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.compare-settings > .row:first-child {
  gap: 20px;
}
.compare-settings .field {
  flex: 0 1 240px;
  margin: 0;
  flex-direction: row;
  align-items: center;
  white-space: nowrap;
  gap: 12px;
  min-width: 280px;
}
.compare-settings .hint {
  margin: 0;
}
.diff-output {
  border-top: 1px solid var(--line);
}
.diff-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  color: var(--secondary);
  font-size: 14px;
}
.diff-empty p {
  margin: 0;
}
.diff-toolbar {
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
#diff-summary {
  font-size: 15px;
  font-weight: 700;
  margin-right: auto;
  line-height: 1.7;
}
#diff-note {
  margin: 0 20px 16px;
}
.diff-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--secondary);
  padding: 0 20px 16px;
}
.diff-legend .removed {
  color: #9f3930;
}
.diff-legend .added {
  color: #246642;
}
.diff-column-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--desk);
  border-block: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}
.diff-column-head span {
  padding: 10px 20px;
}
.diff-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--soft-line);
}
.diff-cell {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  font-size: 13px;
  line-height: 1.85;
  min-width: 0;
}
.diff-cell:first-child {
  border-right: 1px solid var(--line);
}
.line-number {
  font:
    11px/2 ui-monospace,
    monospace;
  text-align: right;
  color: var(--muted);
  padding: 8px 6px;
  user-select: none;
  background: #f7f7f455;
}
.diff-text {
  padding: 8px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
  min-width: 0;
}
.diff-cell.deleted {
  background: #fff2f0;
}
.diff-cell.inserted {
  background: #eff8f2;
}
.diff-cell.blank {
  background: var(--desk);
}
.diff-text mark {
  color: inherit;
  background: #f3c6bf;
  border-radius: 2px;
  padding: 1px 0;
}
.inserted .diff-text mark {
  background: #bfe5cd;
}
.change-label {
  font-size: 10px;
  color: var(--secondary);
  display: block;
  line-height: 1.4;
  margin-bottom: 3px;
}
.diff-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 16px;
  font-size: 13px;
}
.no-changes {
  padding: 32px 20px;
  text-align: center;
  color: var(--secondary);
}
@media (max-width: 760px) {
  .local-page h1 {
    font-size: 25px;
  }
  .local-page .intro {
    gap: 14px;
  }
  .local-page .local-note {
    display: none;
  }
  .local-page .local-workspace {
    display: flex;
    flex-direction: column;
  }
  .local-workspace .settings {
    display: contents;
  }
  .local-workspace .settings > .group {
    order: 2;
    padding: 20px;
    margin: 0;
    border-bottom: 1px solid var(--line);
  }
  .local-workspace .settings > .input-group {
    order: 0;
  }
  .local-workspace .settings > .save-group {
    order: 3;
  }
  .local-page .local-workspace .stage,
  .local-page .stage:has(#preview:not([hidden])) {
    order: 1;
    position: static;
    align-self: stretch;
    min-height: 280px;
    border-bottom: 1px solid var(--line);
    padding: 16px;
  }
  .local-page .preview-area {
    min-height: 220px;
  }
  .local-page #preview {
    max-height: 390px;
  }
  .photo-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .photo-input .file-picker {
    font-size: 12px;
    min-height: 65px;
    padding: 10px;
  }
  .photo-input .file-note {
    font-size: 10px;
  }
  .photo-input {
    min-width: 0;
  }
  .photo-list {
    max-height: 150px;
  }
  .position-grid {
    max-width: 240px;
  }
  .text-pane {
    padding: 14px;
  }
  .text-pane textarea {
    height: 230px;
  }
  .text-pane-heading {
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
  }
  .text-meta {
    flex-wrap: wrap;
  }
  .compare-settings {
    padding: 16px;
  }
  .compare-settings > .row:first-child {
    gap: 12px;
  }
  .diff-toolbar {
    padding: 16px;
    gap: 12px;
  }
  .diff-legend {
    padding: 0 16px 12px;
    gap: 10px;
  }
  .diff-cell {
    grid-template-columns: 26px minmax(0, 1fr);
    font-size: 12px;
  }
  .line-number {
    font-size: 10px;
    padding: 8px 3px;
  }
  .diff-text {
    padding: 8px 6px;
  }
  .diff-column-head span {
    padding: 10px;
  }
  .diff-empty {
    padding: 20px 16px;
  }
  .diff-empty img {
    width: 56px;
    height: 56px;
  }
}
@media (max-width: 380px) {
  .text-inputs {
    grid-template-columns: 1fr;
  }
  .text-pane:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .text-pane-heading {
    flex-direction: row;
    align-items: center;
  }
  .text-pane textarea {
    height: 160px;
  }
  .local-page .tool-nav a {
    font-size: 12px;
    padding: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
