:root {
  --bg: #f5f5f5;
  --panel: #ffffff;
  --border: #d0d0d0;
  --accent: #1f6feb;
  --text: #202020;
  --muted: #606060;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  height: 100vh;
  padding: 8px;
}

.pane {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pane-main {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.pane-main {
  position: relative;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pane-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.pane h2 {
  margin: 10px;
  font-size: 13px;
}

.upload-zone {
  border: 2px dashed #9fb7ef;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  color: var(--muted);
  cursor: pointer;
}

.upload-zone-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2f3b55;
  font-size: 13px;
  font-weight: 600;
}

.upload-zone-head-icon {
  width: 36px;
  height: 36px;
  display: block;
  object-fit: contain;
}

.upload-zone.drag-over {
  border-color: var(--accent);
  background: #eaf1ff;
}

.upload-zone.upload-busy {
  border-color: #7aa0e8;
  background: #f4f8ff;
  cursor: progress;
}

.upload-zone.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.upload-zone-progress {
  font-size: 12px;
  color: #4f628a;
  font-variant-numeric: tabular-nums;
}

.upload-zone-main {
  margin: 10px;
  min-height: 260px;
  font-size: 16px;
  background: #fff;
}

.upload-zone-main.full-height {
  flex: 1 1 auto;
  min-height: 260px;
  margin: 10px;
}

.dropzone-footer {
  margin: 0 10px 10px;
  padding: 8px 0 0;
  border-top: 1px solid #d9dde6;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1.35;
  color: #6f7686;
  text-align: center;
}

.dropzone-footer-brand {
  white-space: nowrap;
}

.dropzone-footer-subline {
  font-size: 10px;
  color: #848b9a;
  text-align: center;
}

.hidden-file-input {
  display: none;
}

.global-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 245, 245, 0.86);
  border: 2px dashed #9fb7ef;
  border-radius: 8px;
}

.global-drop-overlay-card {
  min-width: 220px;
  max-width: 90%;
  background: #fff;
  border: 1px solid #cfd6e4;
  border-radius: 10px;
  padding: 14px 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #2f3b55;
  font-size: 13px;
  font-weight: 600;
}

.global-drop-icon {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.list-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  cursor: pointer;
}

.list-item.active {
  border-color: var(--accent);
  background: #edf4ff;
}

.list-meta {
  color: var(--muted);
  margin-top: 4px;
}

.preview-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 8px;
  min-height: 46px;
}

.license-banner {
  margin: 6px 8px 0;
  border: 1px solid #d7dce8;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.license-banner.grace {
  border-color: #eedb94;
  background: #fff8e1;
}

.license-banner.inactive {
  border-color: #e8b6b6;
  background: #fdecec;
}

.license-banner-text {
  font-size: 12px;
  color: #2f3b55;
}

.license-key-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.license-key-row input {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  border: 1px solid #c4cad6;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12px;
}

.license-key-row button {
  height: 30px;
  border: 1px solid #c4cad6;
  border-radius: 6px;
  background: #fff;
  color: #2f3b55;
  font-size: 12px;
  padding: 0 10px;
  cursor: pointer;
}

.toolbar-left-anchor,
.toolbar-center-group,
.toolbar-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.toolbar-left-anchor,
.toolbar-center-group > *,
.toolbar-right-group > * {
  flex: 0 0 auto;
}

.toolbar-center-group {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.toolbar-right-group {
  margin-left: auto;
  justify-content: flex-end;
  overflow: hidden;
}

.toolbar-title {
  font-size: 13px;
  font-weight: 600;
  color: #2f3b55;
}

.toolbar-insert-btn {
  height: 30px;
  border: 1px solid #c4cad6;
  border-radius: 6px;
  background: #fff;
  color: #2f3b55;
  font-size: 12px;
  padding: 0 10px;
  cursor: pointer;
}

.toolbar-insert-btn:hover {
  background: #eef3fb;
}

.toolbar-menu {
  position: absolute;
  right: 8px;
  top: 44px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: min(96vw, 540px);
  padding: 8px;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.toolbar-template-menu {
  left: 8px;
  right: 8px;
  width: auto;
  max-width: none;
  max-height: min(70vh, 420px);
  overflow: auto;
}

.toolbar-template-toggle {
  margin-left: 8px;
}

.toolbar-toggle {
  margin-left: 2px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #d7dce8;
  border-radius: 6px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2f3b55;
  font-size: 12px;
  white-space: nowrap;
}

.toolbar-toggle input[type="checkbox"] {
  margin: 0;
}

.toolbar-menu-danger-btn {
  height: 30px;
  border: 1px solid #d9c5c5;
  border-radius: 6px;
  background: #fff;
  color: #9e1b1b;
  font-size: 12px;
  padding: 0 10px;
  cursor: pointer;
}

.toolbar-menu-danger-btn:hover {
  background: #fff3f3;
}

.toolbar-menu-btn {
  height: 30px;
  border: 1px solid #c4cad6;
  border-radius: 6px;
  background: #fff;
  color: #2f3b55;
  font-size: 12px;
  padding: 0 10px;
  cursor: pointer;
}

.toolbar-menu-btn:hover {
  background: #eef3fb;
}

.template-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.template-field-group {
  width: 100%;
}

.template-field-label {
  font-size: 11px;
  line-height: 1.2;
  color: #61697a;
  margin: 0 0 4px 2px;
}

.template-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.template-row-select {
  width: 100%;
  position: relative;
}

.template-row-actions {
  width: 100%;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.template-row-action-buttons {
  width: 100%;
  margin-top: 6px;
  gap: 6px;
  justify-content: flex-end;
}

.template-row-action-buttons .toolbar-menu-btn {
  min-width: 96px;
}

.template-scope-radios {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  border: 1px solid #c4cad6;
  border-radius: 6px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}

.template-scope-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #2f3b55;
  white-space: nowrap;
}

.template-scope-option input[type="radio"] {
  margin: 0;
}

.template-select {
  height: 30px;
  width: 100%;
  min-width: 0;
  border: 1px solid #c4cad6;
  border-radius: 6px;
  background: #fff;
  color: #2f3b55;
  font-size: 12px;
  padding: 0 6px;
}

.template-select.is-placeholder {
  color: #8a8f9c;
  font-style: italic;
}

.template-select option {
  color: #2f3b55;
  font-style: normal;
}

.template-select option[value=""] {
  color: #8a8f9c;
  font-style: italic;
}

.template-row-actions .toolbar-menu-btn,
.template-row-actions .toolbar-menu-danger-btn {
  flex: 0 0 auto;
  min-width: 84px;
  max-width: 128px;
  padding: 0 8px;
}

.template-settings-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 6px;
}

.template-settings-menu {
  position: absolute;
  right: 0;
  top: 34px;
  z-index: 45;
  min-width: 140px;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (max-width: 360px) {
  .template-row-actions .toolbar-menu-btn,
  .template-row-actions .toolbar-menu-danger-btn {
    flex: 1 1 100%;
    min-width: 0;
  }
}

.toolbar-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.toolbar-search input {
  height: 30px;
  width: 140px;
  border: 1px solid #c4cad6;
  border-radius: 6px;
  padding: 0 8px 0 28px;
  font-size: 12px;
  outline: none;
  background: transparent;
  color: #2f3b55;
}

.search-icon {
  position: absolute;
  left: 9px;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.search-icon::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 9px;
  height: 9px;
  border: 1.6px solid #667089;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 6px;
  height: 1.6px;
  background: #667089;
  transform: rotate(45deg);
  transform-origin: center;
}

.collapsed-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 10px 0;
  flex: 0 0 auto;
  min-height: auto;
}

.collapsed-stack.has-open {
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
}

.collapsed-row {
  flex: 0 0 28px;
  width: 100%;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f7f9fc;
  color: #2f3b55;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0 4px 0 0;
}

.collapsed-row.active {
  border-color: #1f6feb;
  background: #edf4ff;
  border-radius: 6px 6px 0 0;
  margin-bottom: 0;
}

.collapsed-row.batch-selected {
  border-color: #7aa6eb;
  background: #f2f7ff;
}

.collapsed-row.is-pending {
  background: #f3f4f6;
  border-color: #d8dbe2;
}

.collapsed-row-main {
  height: 100%;
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #2f3b55;
  font-size: 12px;
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.collapsed-row-filename {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collapsed-row.is-pending .collapsed-row-main {
  color: #8a8f9c;
  cursor: not-allowed;
}

.collapsed-row-main.editing {
  cursor: text;
}

.collapsed-row-rename {
  width: 100%;
  height: 20px;
  border: 1px solid #b8c2d8;
  border-radius: 4px;
  font-size: 12px;
  padding: 0 6px;
}

.collapsed-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 2px;
}

.collapsed-row-status-badge {
  height: 18px;
  min-width: 24px;
  border: 1px solid transparent;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-size: 10px;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
}

.collapsed-row-status-badge:hover {
  filter: brightness(0.97);
}

.collapsed-row-status-badge:disabled {
  cursor: not-allowed;
}

.collapsed-row-status-menu {
  position: absolute;
  right: 28px;
  top: 26px;
  z-index: 31;
  min-width: 170px;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.collapsed-row-status-menu-btn {
  height: 28px;
  border: 1px solid #d7dce8;
  border-radius: 6px;
  background: #fff;
  color: #2f3b55;
  font-size: 12px;
  text-align: left;
  padding: 0 8px;
  cursor: pointer;
}

.collapsed-row-status-menu-btn:hover:not(:disabled) {
  background: #eef3fb;
}

.collapsed-row-status-menu-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.collapsed-row-status-blue {
  color: #0f4a95;
  background: #e8f1ff;
  border-color: #b8cffa;
}

.collapsed-row-status-yellow {
  color: #7d5d00;
  background: #fff8e1;
  border-color: #eedb94;
}

.collapsed-row-status-red {
  color: #8f1f1f;
  background: #fdecec;
  border-color: #e8b6b6;
}

.collapsed-row-arrow {
  width: 14px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #56627a;
  font-size: 12px;
  line-height: 1;
  user-select: none;
}

.collapsed-row-pending-text {
  font-size: 11px;
  color: #8a8f9c;
  padding-right: 6px;
  font-variant-numeric: tabular-nums;
}

.collapsed-row-icon {
  width: 20px;
  height: 20px;
  border: 1px solid #c4cad6;
  border-radius: 4px;
  background: #fff;
  color: #56627a;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.collapsed-row-icon:hover {
  background: #eef3fb;
}

.collapsed-row-settings {
  width: auto;
  min-width: 0;
  height: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
}

.collapsed-row-settings:hover {
  background: transparent;
  color: #2f3b55;
}

.collapsed-row-menu {
  position: absolute;
  right: 2px;
  top: 26px;
  z-index: 30;
  min-width: 150px;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.collapsed-row-menu-btn {
  height: 28px;
  border: 1px solid #d7dce8;
  border-radius: 6px;
  background: #fff;
  color: #2f3b55;
  font-size: 12px;
  text-align: left;
  padding: 0 8px;
  cursor: pointer;
}

.collapsed-row-menu-btn:hover {
  background: #eef3fb;
}

.collapsed-row-menu-btn.danger {
  color: #9e1b1b;
}

.preview-subcontainer {
  width: 100%;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 0 0 6px 6px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.preview-subcontainer.collapsed-framed {
  margin: 0;
}

.collapsed-stack.has-open .preview-subcontainer {
  flex: 1 1 auto;
}

.collapsed-stack.has-open .collapsed-row:not(.active) {
  display: none;
}

.preview-container.collapsed-framed {
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 0;
  margin: 0;
  border-radius: 0;
  background: #fff;
}

.status-bar.collapsed-framed {
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 0 0 6px 6px;
  margin: 0;
}

.toolbar-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #c4cad6;
  border-radius: 6px;
  background: #fff;
  color: #2f3b55;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn:hover {
  background: #eef3fb;
}

.toolbar-btn.active {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #fff;
}

.toolbar-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-indicator {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid #c4cad6;
  border-radius: 6px;
  background: #fff;
  height: 30px;
  padding: 0 6px;
  font-size: 12px;
  color: #2f3b55;
  line-height: 18px;
}

.page-indicator.disabled {
  opacity: 0.45;
}

#page-input,
#page-total {
  width: 34px;
  height: 18px;
  display: inline-block;
  line-height: 18px;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  border: 0;
  outline: none;
  text-align: right;
  font: 400 12px/18px "Segoe UI", Tahoma, sans-serif;
  color: #2f3b55;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

#page-input:disabled,
#page-total:disabled {
  color: #8f96a6;
}

#page-total {
  width: 28px;
  min-width: 28px;
  text-align: left;
  color: #2f3b55;
  pointer-events: none;
}

.zoom-level {
  min-width: 44px;
  text-align: center;
  font-size: 12px;
  color: #2f3b55;
}

.preview-scroll-host {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  border-bottom: 1px solid var(--border);
}

.preview-container {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: visible;
  padding: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.preview-container.image-mode {
  justify-content: flex-start;
  align-items: flex-start;
}

.preview-container.scroll-mode {
  display: block;
  overflow: visible;
}

.preview-container.hidden {
  display: none;
}

.preview-loading {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  background: rgba(255, 255, 255, 0.7);
}

.preview-loading-card {
  min-width: 180px;
  max-width: 320px;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.preview-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d0d7e8;
  border-top-color: #1f6feb;
  border-radius: 50%;
  animation: auditlayer-spin 0.8s linear infinite;
}

.preview-loading-text {
  font-size: 12px;
  color: #2f3b55;
  white-space: nowrap;
}

.preview-container.scroll-mode .preview-surface {
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.preview-container img,
.preview-container canvas,
.preview-container table {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.unsupported-preview {
  min-width: 260px;
  max-width: 100%;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.unsupported-preview-title {
  font-size: 13px;
  font-weight: 600;
  color: #2f3b55;
  margin-bottom: 6px;
}

.unsupported-preview-meta {
  font-size: 12px;
  color: #667089;
  word-break: break-word;
}

.preview-container.is-panning,
.preview-interactive.is-panning {
  cursor: grabbing !important;
}

.preview-surface {
  position: relative;
  user-select: none;
  margin-bottom: 14px;
  display: inline-block;
}

.pdf-text-layer {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  line-height: 1;
  opacity: 0.2;
}

.pdf-text-layer > span {
  position: absolute;
  white-space: pre;
  transform-origin: 0% 0%;
  color: transparent;
  cursor: text;
}

.pdf-text-layer > span::selection {
  background: rgba(0, 120, 215, 0.35);
}

.pdf-text-layer > span.search-hit {
  background: rgba(255, 235, 59, 0.55);
}

.selection-box {
  position: absolute;
  border: 1px solid #1f6feb;
  background: rgba(31, 111, 235, 0.16);
  pointer-events: none;
}

.preview-marker-area {
  position: absolute;
  border: 1px solid #1f6feb;
  background: rgba(31, 111, 235, 0.1);
  cursor: pointer;
  border-radius: 2px;
  padding: 0;
}

.preview-marker-label {
  position: absolute;
  height: 18px;
  border: 1px solid #1f6feb;
  background: #fff;
  color: #1f6feb;
  border-radius: 4px 4px 0 0;
  padding: 0 6px;
  font-size: 10px;
  line-height: 16px;
  cursor: pointer;
  white-space: nowrap;
  transform: translate(-100%, -100%);
}

.preview-marker-area.is-dragging,
.preview-marker-label.is-dragging {
  cursor: move;
}

.preview-marker-area.preview-marker-needs-review {
  border-color: #c99200;
  background: rgba(255, 196, 0, 0.16);
}

.preview-marker-label.preview-marker-needs-review {
  border-color: #c99200;
  color: #7a5a00;
  background: #fff8dc;
}

.preview-marker-menu {
  position: absolute;
  display: inline-flex;
  gap: 6px;
  background: #fff;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  padding: 6px;
  z-index: 15;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.preview-marker-menu button {
  height: 24px;
  border: 1px solid #c4cad6;
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
  padding: 0 8px;
}

.preview-marker-menu-delete {
  color: #9e1b1b;
}

.preview-marker-menu-relink {
  color: #1f6feb;
}

.preview-marker-menu-jump {
  color: #1f6feb;
}

.preview-marker-menu-close {
  min-width: 24px;
  padding: 0;
}

.hidden {
  display: none;
}

@keyframes auditlayer-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.status-bar {
  border-top: 1px solid var(--border);
  background: #fff;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
}

#preview-status {
  font-size: 12px;
  color: #667089;
  text-align: center;
}

.status-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: #667089;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.status-sep {
  color: #98a0b3;
}

.status-toolbar-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 13px;
}

.icon-select {
  background: #4b5a76;
  border-color: #4b5a76;
  color: #fff;
}

.icon-select:hover {
  background: #556687;
}

.icon-prev::before {
  content: "◀";
}

.icon-plus::before {
  content: "+";
}

.icon-file-plus::before {
  content: "";
  width: 14px;
  height: 14px;
  display: block;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3.2 1.2h4.8l2.8 2.8v8a1 1 0 0 1-1 1H3.2a1 1 0 0 1-1-1V2.2a1 1 0 0 1 1-1z' fill='none' stroke='%2356627a' stroke-width='1.1'/%3E%3Cpath d='M8 1.2V4h2.8' fill='none' stroke='%2356627a' stroke-width='1.1'/%3E%3Cpath d='M6.2 6.4v3.2M4.6 8h3.2' stroke='%2356627a' stroke-width='1.1' stroke-linecap='round'/%3E%3C/svg%3E");
}

.icon-undo::before {
  content: "";
  width: 14px;
  height: 14px;
  display: block;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M4.8 4.1H2.2m0 0L3.9 2.4m-1.7 1.7L3.9 5.8M3 4.1h5.2a3.4 3.4 0 1 1 0 6.8H5.8' fill='none' stroke='%2356627a' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-redo::before {
  content: "";
  width: 14px;
  height: 14px;
  display: block;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M9.2 4.1h2.6m0 0L10.1 2.4m1.7 1.7L10.1 5.8M11 4.1H5.8a3.4 3.4 0 1 0 0 6.8h2.4' fill='none' stroke='%2356627a' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-next::before {
  content: "▶";
}

.icon-scroll::before {
  content: "↕";
}

.icon-page::before {
  content: "▭";
}

.icon-zoom-out::before {
  content: "−";
}

.icon-zoom-in::before {
  content: "+";
}

.icon-fit-view::before {
  content: "";
  width: 14px;
  height: 14px;
  display: block;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M1.8 5.2V1.8h3.4M12.2 5.2V1.8H8.8M1.8 8.8v3.4h3.4M12.2 8.8v3.4H8.8' fill='none' stroke='%2356627a' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-select::before {
  content: "▭";
  font-size: 14px;
}

.icon-marker::before {
  content: "⌖";
}

.icon-more::before {
  content: "⋯";
}

.app-error {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1000;
  background: #ffe9e9;
  border: 1px solid #d66;
  color: #7a1d1d;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

.label-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.label-modal.hidden {
  display: none;
}

.label-modal-card {
  width: 280px;
  background: #fff;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.label-modal-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2f3b55;
}

#label-modal-input {
  width: 100%;
  border: 1px solid #c4cad6;
  border-radius: 6px;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.confirm-modal-message {
  font-size: 12px;
  color: #2f3b55;
  line-height: 1.4;
  white-space: pre-line;
}

.label-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.label-modal-actions button {
  border: 1px solid #c4cad6;
  background: #fff;
  border-radius: 6px;
  min-width: 64px;
  height: 30px;
  font-size: 12px;
  cursor: pointer;
}

.csv-table {
  border-collapse: collapse;
  font-size: 12px;
}

.csv-table td,
.csv-table th {
  border: 1px solid var(--border);
  padding: 4px 6px;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: 100vh;
  }

  .pane {
    min-height: 0;
  }
}
