.selected-file-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: center;
  margin-top: 17px;
  padding: 12px;
  border: 1px solid var(--ink);
  background: rgba(205, 206, 201, .68);
}

.selected-file-info { min-width: 0; }
.selected-file-info strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.selected-file-info > span { display: block; margin-top: 4px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 8px; }
.selected-file-card > button { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); background: transparent; font-family: "DM Mono", monospace; font-size: 17px; cursor: pointer; }
.selected-file-card > button:hover { border-color: var(--ink); background: var(--ink); color: var(--white); }

.preview-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 21px;
}

.preview-heading h2 { margin: 0; font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .08em; }
.preview-heading p { margin: 5px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.preview-heading > span { flex: 0 0 auto; color: var(--muted); font-family: "DM Mono", monospace; font-size: 8px; }

.preview-actions { display: grid; grid-template-columns: 1fr 1fr; margin-top: 10px; border: 1px solid var(--ink); }
.preview-actions button { min-height: 34px; border: 0; background: transparent; color: var(--muted); font-family: "DM Mono", monospace; font-size: 8px; cursor: pointer; }
.preview-actions button + button { border-left: 1px solid var(--ink); }
.preview-actions button:hover { background: var(--ink); color: var(--white); }

.page-preview { margin-top: 13px; padding: 10px; border: 1px solid var(--ink); background: rgba(17, 18, 16, .055); }
.page-row { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.page-row + .page-row { margin-top: 0; }
.page-tile { min-width: 0; margin: 0; }
.page-paper { position: relative; min-height: 105px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); background: #e3e3df; }
.page-paper canvas { display: block; max-width: 100%; height: auto; background: white; }
.page-loading { padding: 6px; color: #858681; font-family: "DM Mono", monospace; font-size: 6px; letter-spacing: .04em; text-align: center; }
.page-label { display: block; margin-top: 5px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 7px; text-align: center; }

.cut-control { position: relative; padding: 0; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.cut-control::before { content: ""; position: absolute; background: var(--line); }
.cut-control span { position: relative; z-index: 1; border: 1px solid var(--line); background: #c3c4bf; font-family: "DM Mono", monospace; font-size: 6px; letter-spacing: .02em; text-align: center; white-space: nowrap; }
.cut-control:hover span,
.cut-control.active span { border-color: var(--ink); background: var(--ink); color: var(--white); }
.cut-control.active span::before { content: "✓ "; }

.cut-control.vertical { position: absolute; top: 0; bottom: 17px; z-index: 2; width: 18px; transform: translateX(-50%); }
.cut-control.vertical.slot-1 { left: 33.333%; }
.cut-control.vertical.slot-2 { left: 66.666%; }
.cut-control.vertical::before { top: 0; bottom: 0; left: 50%; width: 1px; }
.cut-control.vertical:hover::before,
.cut-control.vertical.active::before { width: 2px; background: var(--ink); }
.cut-control.vertical span { padding: 6px 3px; writing-mode: vertical-rl; }

.cut-control.between-rows { width: 100%; height: 42px; margin: 2px 0; }
.cut-control.between-rows::before { left: 0; right: 0; height: 1px; }
.cut-control.between-rows:hover::before,
.cut-control.between-rows.active::before { height: 2px; background: var(--ink); }
.cut-control.between-rows span { padding: 5px 9px; }

.edge-boundary { position: relative; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-family: "DM Mono", monospace; font-size: 6px; letter-spacing: .08em; }
.edge-boundary::before { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--ink); }
.edge-boundary span { position: relative; padding: 3px 7px; background: #bfc0bb; }
.edge-boundary.start { margin-bottom: 9px; }
.edge-boundary.end { margin-top: 9px; }

.split-card .merge-status { margin-top: 19px; }

@media (min-width: 520px) {
  .page-preview { padding: 12px; }
  .page-row { gap: 22px; }
  .page-paper { min-height: 125px; }
}
