/* Alpine cloak */
[x-cloak] { display: none !important; }

:root {
  --color-bg: #FFFFFF;
  --color-surface: #F8F8F8;
  --color-border: #E0E0E0;
  --color-text-primary: #1A1A1A;
  --color-text-secondary: #757575;
  --color-text-muted: #AAAAAA;
  --color-accent: #000000;
  --color-accent-text: #FFFFFF;
  --color-danger: #C62828;
}

/* ── Reset & base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: var(--color-bg);
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ──────────────────────────────────────────── */
.header {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  background: var(--color-bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo {
  height: 28px;
  width: auto;
  display: block;
}

.app-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.nav {
  display: flex;
  gap: 24px;
}

.nav a {
  text-decoration: none;
  font-size: 13px;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

.nav a.active {
  color: var(--color-text-primary);
  font-weight: 500;
  border-bottom-color: #000;
}

/* ── State 1: Upload ─────────────────────────────────── */
.state-upload {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.upload__dropzone {
  width: 600px;
  max-width: calc(100vw - 48px);
  height: 260px;
  border: 2px dashed var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}

.upload__dropzone:hover {
  border-color: #aaa;
  background: #f0f0f0;
}

.upload__icon {
  color: var(--color-text-muted);
}

.upload__title {
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin: 16px 0 0;
}

.upload__sub {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 8px 0 0;
}

.upload__note {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 16px;
}

/* ── Breadcrumb bar ──────────────────────────────────── */
.breadcrumb {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  gap: 6px;
  font-size: 13px;
}

.breadcrumb__sep {
  color: var(--color-text-muted);
}

.breadcrumb__link {
  color: var(--color-text-secondary);
}

.breadcrumb__current {
  color: var(--color-text-primary);
  font-weight: 500;
}

.breadcrumb__spacer { flex: 1; }

.breadcrumb__reset {
  font-size: 12px;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.breadcrumb__reset:hover { color: var(--color-text-primary); }

/* ── Two-column layout (States 2 & 3) ───────────────── */
.state-files,
.state-customize {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Left sidebar ────────────────────────────────────── */
.sidebar {
  flex-shrink: 0;
  background: #F5F5F5;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 20px 16px 24px;
}

.sidebar::-webkit-scrollbar { display: none; }

.sidebar-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9E9E9E;
  margin-bottom: 12px;
}

.sidebar-divider {
  height: 1px;
  background: #E8E8E8;
  margin: 16px 0;
}

.sidebar-spacer { flex: 1; }

/* File cards (State 2) */
.file-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.file-card:active { cursor: grabbing; }

.file-card__drag {
  color: var(--color-text-muted);
  font-size: 14px;
  cursor: grab;
  flex-shrink: 0;
  letter-spacing: -1px;
}

.file-card__info {
  flex: 1;
  min-width: 0;
}

.file-card__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card__meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.file-card__delete {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  font-family: inherit;
}

.file-card__delete:hover { color: var(--color-danger); }

.sidebar-add-more {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-primary);
  cursor: pointer;
  margin-top: 4px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.sidebar-add-more:hover { text-decoration: underline; }

/* Primary / secondary buttons */
.btn-primary {
  width: 100%;
  height: 44px;
  background: #1A1A1A;
  color: #FFFFFF;
  border: none;
  border-radius: 100px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-primary:hover { background: #333; }

.btn-secondary {
  width: 100%;
  height: 44px;
  background: #FFFFFF;
  color: #1A1A1A;
  border: 1.5px solid #E0E0E0;
  border-radius: 100px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  cursor: pointer;
  margin-top: 8px;
}

.btn-secondary:hover { background: #F5F5F5; }

.btn-secondary-note {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
  margin: 4px 0 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-primary);
  margin-top: 10px;
  cursor: pointer;
}

.compress-result-inline {
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  margin-top: 4px;
  display: block;
}

/* ── Sidebar resize handle ───────────────────────────── */
#sidebar-resizer:hover,
#sidebar-resizer:active {
  background: #CCCCCC !important;
  width: 4px;
}

#sidebar-resizer::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 40px;
  background: #AAAAAA;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 120ms ease;
}

#sidebar-resizer:hover::after {
  opacity: 1;
}

/* ── Right panel ─────────────────────────────────────── */
.right-panel {
  flex: 1;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.right-panel--scroll {
  flex: 1;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-empty {
  font-size: 14px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Ops queue (customize sidebar) ──────────────────── */
.ops-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.ops-item {
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}


.ops-item__icon {
  font-size: 16px;
  color: #757575;
  flex-shrink: 0;
  line-height: 1;
}

.ops-item__label {
  flex: 1;
  font-size: 13px;
  color: #1A1A1A;
}

.ops-item__undo {
  background: none;
  border: none;
  font-size: 13px;
  color: #BDBDBD;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  font-family: inherit;
}

.ops-item__undo:hover { color: #C62828; }

.ops-add-more {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9E9E9E;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  margin-top: 8px;
}

.ops-add-more:hover { color: #1A1A1A; }

.queue-empty {
  font-size: 12px;
  color: #BDBDBD;
  text-align: center;
  padding: 16px 0;
  margin: 0;
}

.ops-hint {
  font-size: 11px;
  color: #9E9E9E;
  margin: 6px 0 0;
}

/* Tool picker — strict 2×2 grid, pill shape */
.tool-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tool-btn {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  height: 40px;
  background: #FFFFFF;
  border: 1px solid #E0E0E0;
  border-radius: 100px;
  cursor: pointer;
  color: #1A1A1A;
  text-align: center;
  width: 100%;
}

.tool-btn:hover { background: #F5F5F5; }

.tool-btn.active {
  background: #1A1A1A;
  color: #FFFFFF;
  border-color: #1A1A1A;
}

/* Tool form card */
.tool-form {
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  border-radius: 16px;
  padding: 18px;
  margin-top: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.tool-form__titlerow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tool-form__title {
  font-size: 15px;
  font-weight: 600;
  color: #1A1A1A;
}

.tool-form__close {
  background: none;
  border: none;
  font-size: 16px;
  color: #AAAAAA;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-family: inherit;
}

.tool-form__close:hover { color: #1A1A1A; }

.tool-form__divider {
  height: 1px;
  background: #F0F0F0;
  margin: 0 0 16px;
}

.tool-form__actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-row:last-of-type { margin-bottom: 0; }

.form-row label {
  font-size: 11px;
  color: #9E9E9E;
}

.form-row input,
.form-row select,
.form-row textarea {
  border: 1.5px solid #E0E0E0;
  border-radius: 8px;
  padding: 0 12px;
  height: 40px;
  font-size: 13px;
  font-family: 'DM Sans', system-ui, sans-serif;
  width: 100%;
  background: #FFFFFF;
  color: #1A1A1A;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: #1A1A1A;
}

/* Global range input reset — black thumb, no browser default blue */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #E0E0E0;
  outline: none;
  width: 100%;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1A1A1A;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1A1A1A;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Custom range slider — black thumb with white border + shadow */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  cursor: pointer;
  outline: none;
  border: none;
  margin-top: 4px;
  display: block;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1A1A1A;
  cursor: pointer;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.range-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1A1A1A;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
}

/* Form buttons — pill shape, flex fill */
.btn-form {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  height: 44px;
  flex: 1;
  border-radius: 100px;
  cursor: pointer;
  border: 1.5px solid #E0E0E0;
  background: #FFFFFF;
  color: #1A1A1A;
}

.btn-form--primary {
  background: #1A1A1A;
  color: #FFFFFF;
  border-color: #1A1A1A;
}

.btn-form--primary:hover { background: #333; border-color: #333; }
.btn-form:not(.btn-form--primary):hover { background: #F5F5F5; }

.btn-form--error {
  background: #FFFFFF;
  color: #C62828;
  border: 1.5px solid #C62828;
}

/* Error message row below form buttons */
.tool-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  font-size: 11px;
  color: #C62828;
  line-height: 1.4;
}

/* Amber warning row (password form) */
.pwd-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  background: #FFF8E1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  color: #795548;
  line-height: 1.4;
}

/* Save button — success state (3s after download) */
.btn-primary--success {
  width: 100%;
  height: 44px;
  background: #FFFFFF;
  color: #2E7D32;
  border: 2px solid #2E7D32;
  border-radius: 100px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Filename input */
.filename-input {
  width: 100%;
  height: 40px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  padding: 0 12px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  color: #1A1A1A;
  background: #FFFFFF;
}

.filename-input:focus {
  outline: none;
  border-color: #1A1A1A;
}

/* ── Thumbnail toolbar strip ─────────────────────────── */
.thumb-toolbar {
  height: 40px;
  border-bottom: 1px solid var(--color-border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg);
  flex-shrink: 0;
}

.thumb-toolbar__count {
  font-size: 13px;
  color: var(--color-text-muted);
}

.thumb-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.thumb-toolbar__btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #757575;
  font-size: 13px;
  font-family: 'DM Sans', system-ui, sans-serif;
}

.thumb-toolbar__btn:hover { color: #1A1A1A; }

/* ── Thumbnail grid ──────────────────────────────────── */
.thumb-scroll {
  flex: 1;
  overflow-y: auto;
}

.thumb-scroll::-webkit-scrollbar { width: 6px; }
.thumb-scroll::-webkit-scrollbar-track { background: var(--color-surface); }
.thumb-scroll::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

.customize__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 24px;
  counter-reset: thumb-counter;
}

/* Card wrapper — no border/overflow here so ::after label renders below */
.page-thumb {
  position: relative;
  cursor: grab;
  display: flex;
  flex-direction: column;
  counter-increment: thumb-counter;
}

.page-thumb.dragging { opacity: 0.4; }

/* Page number badge — flush top-left corner of canvas */
.page-thumb::before {
  content: counter(thumb-counter);
  position: absolute;
  top: 0;
  left: 0;
  background: #1A1A1A;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 0 0 4px 0;
  z-index: 3;
  pointer-events: none;
  font-family: 'DM Sans', system-ui, sans-serif;
  line-height: 1.4;
}

/* "Page N" label — sits below the card in normal flow */
.page-thumb::after {
  content: "Page " counter(thumb-counter);
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #AAAAAA;
  text-align: center;
  margin-top: 6px;
  font-family: 'DM Sans', system-ui, sans-serif;
  pointer-events: none;
}

/* Canvas carries the card border/shape */
.page-thumb canvas {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  border: 1px solid #E0E0E0;
  border-radius: 4px;
}

/* Dark hover overlay — covers exactly the canvas area (not the label below) */
.page-thumb__actions {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  aspect-ratio: 1 / 1.414;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  transition: opacity 120ms;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 4px;
  z-index: 2;
}

/* Pill container behind the icon buttons */
.page-thumb__actions::before {
  content: '';
  position: absolute;
  background: rgba(20, 20, 20, 0.88);
  border-radius: 12px;
  width: 188px;
  height: 52px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.page-thumb:hover .page-thumb__actions { opacity: 1; }

/* Icon buttons — sit above the pill */
.page-thumb__icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  color: #fff;
  opacity: 1;
  transition: opacity 100ms;
}

.page-thumb__icon:hover { opacity: 0.65; }
.page-thumb__icon svg { display: block; }

/* Signed badge */
.page-thumb__signed {
  position: absolute;
  top: 32px;
  right: 6px;
  background: var(--color-text-primary);
  color: var(--color-bg);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 4;
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* Checkbox (hidden — selectAll/clearAll still work via JS) */
.page-thumb__checkbox {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 14px;
  height: 14px;
  cursor: pointer;
  z-index: 5;
  display: none;
}

/* Drop indicator */
.drop-line {
  width: 3px;
  background: var(--color-accent);
  height: calc(100% - 24px); /* stop before the label */
  position: absolute;
  left: -2px;
  top: 0;
  pointer-events: none;
  display: none;
}

.drop-line.drop-line--active { display: block; }

/* ── Error & notifications ───────────────────────────── */
.error-msg {
  font-size: 12px;
  color: var(--color-danger);
  margin-top: 6px;
}

.notification-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text-primary);
  color: var(--color-accent-text);
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 4px;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  white-space: nowrap;
}

/* ── Modal ───────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
}

.modal[x-show] { display: flex; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.modal__dialog {
  position: relative;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 28px;
  width: 340px;
  z-index: 1;
  pointer-events: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.modal__dialog--wide {
  width: min(600px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
}

.modal__dialog--annotation {
  width: min(860px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.ann-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.ann-modal__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.ann-modal__canvas-area {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  background: var(--color-bg-secondary, #F5F5F5);
}

.ann-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.modal__title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}

.modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}

.modal__field input {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
}

.modal__field input:focus {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 2px;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--color-text-secondary);
  line-height: 1;
  padding: 0;
  font-family: inherit;
}

.modal__close:hover { color: var(--color-text-primary); }

/* ── Design system: Buttons ──────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 120ms ease, background 120ms ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn--primary {
  background: #1A1A1A;
  color: white;
}

.btn--primary:hover:not(:disabled) {
  background: #333333;
}

.btn--secondary {
  background: white;
  color: #1A1A1A;
  border: 1px solid #E0E0E0;
}

.btn--secondary:hover:not(:disabled) {
  background: #F5F5F5;
}

.btn--full {
  width: 100%;
}

.btn--sm {
  height: 32px;
  font-size: 13px;
  padding: 0 12px;
}

/* ── Design system: Toggle group ─────────────────────── */
.toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  border: 1px solid #E0E0E0;
  background: white;
  color: #1A1A1A;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.toggle-btn--active {
  background: #1A1A1A;
  color: white;
  border-color: #1A1A1A;
}

/* ── Design system: Form elements ────────────────────── */
.form-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: #9E9E9E;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 36px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  padding: 0 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #1A1A1A;
  background: white;
  box-sizing: border-box;
  outline: none;
  transition: border-color 120ms ease;
}

.form-input:focus {
  border-color: #1A1A1A;
}

.form-select {
  width: 100%;
  height: 36px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  padding: 0 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #1A1A1A;
  background: white;
  box-sizing: border-box;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.form-select:focus {
  border-color: #1A1A1A;
}

.form-textarea {
  width: 100%;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #1A1A1A;
  background: white;
  box-sizing: border-box;
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color 120ms ease;
}

.form-textarea:focus {
  border-color: #1A1A1A;
}

.form-group {
  margin-bottom: 12px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ── Zoom modal ──────────────────────────────────────── */
.zoom__canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

/* ── Converter page ──────────────────────────────────── */
.json-mode-btn {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: inherit;
}
.json-mode-btn--active {
  background: #16a34a;
  color: #fff;
  border: none;
}
.json-mode-btn--inactive {
  background: #fff;
  border: 1px solid #e5e5e4;
  color: #78716c;
}
.json-mode-btn--inactive:hover { background: #f5f5f4; }


/* Misc shared */
.section-block {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
}
