/* Editor + lightbox + progress + result */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 850;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: min(1000px, 100%);
  max-height: calc(100vh - 56px);
  background: var(--card-bg);
  border-radius: 24px;
  padding: 14px;
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: 14px;
  background: #0f1012;
  margin: 0 auto;
}

.lightbox img.is-rot90,
.lightbox img.is-rot270 {
  max-width: calc(100vh - 200px);
  max-height: calc(100vw - 80px);
}

.lightbox img.is-rot90 { transform: rotate(90deg); }
.lightbox img.is-rot180 { transform: rotate(180deg); }
.lightbox img.is-rot270 { transform: rotate(270deg); }

.lightbox-cap {
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: center;
  padding: 2px 6px 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 26px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: var(--card-bg);
  color: var(--text-main);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  transition: all 0.25s var(--ease-color);
}

.lightbox-close:hover { background: var(--accent-orange); border-color: var(--accent-orange); color: #fff; }

.lightbox-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 6px 2px;
}

.lightbox-tool {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-mid);
  background: var(--card-bg);
  color: var(--text-main);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s var(--ease-color), color 0.2s var(--ease-color), border-color 0.2s var(--ease-color), opacity 0.2s var(--ease-color);
}

.lightbox-tool:hover:not(:disabled) { background: var(--text-main); color: var(--card-bg); border-color: var(--text-main); }
.lightbox-tool:disabled { opacity: 0.35; cursor: not-allowed; }
.lightbox-tool.lightbox-danger:hover:not(:disabled) { background: var(--accent-orange); border-color: var(--accent-orange); color: #fff; }

.lightbox-count {
  min-width: 76px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--card-sub-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-main);
}

.lightbox-count b { font-weight: 400; color: var(--text-main); }
.lightbox-count span { color: var(--text-faint); }

@media (max-width: 640px) {
  .lightbox-tool { width: 36px; height: 36px; }
  .lightbox-count { height: 36px; min-width: 66px; }
}

.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 24px;
}

.success-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.success-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: clamp(32px, 5vw, 52px);
  box-shadow: var(--shadow-float);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: thanksPop 0.35s var(--ease-out);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

@keyframes thanksPop {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.success-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: var(--card-bg);
  color: var(--text-main);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  transition: all 0.25s var(--ease-color);
}

.success-close:hover { background: var(--accent-orange); border-color: var(--accent-orange); color: #fff; }

.success-icon {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(255, 56, 17, 0.12);
  color: var(--accent-orange);
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.success-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 44px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.1;
}

.success-title .accent { color: var(--accent-orange); }

.success-sub {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 400px;
}

.success-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.success-actions .btn { min-width: 0; }
.success-note { font-size: 12px; color: var(--text-faint); letter-spacing: 0.02em; }

.editor-shell {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  overflow: hidden;
  animation: editorIn 0.35s var(--ease-out);
}

.editor-shell[hidden] { display: none; }

@keyframes editorIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.editor-header {
  flex: none;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 clamp(12px, 2vw, 24px);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  z-index: 3;
}

.editor-header-left,
.editor-header-right { display: flex; align-items: center; gap: 10px; min-width: 0; }

.editor-exit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: var(--card-bg);
  color: var(--text-main);
  cursor: pointer;
  flex: none;
  transition: background 0.25s var(--ease-color), color 0.25s var(--ease-color), border-color 0.25s var(--ease-color);
}

.editor-exit:hover:not(:disabled) { background: var(--text-main); color: var(--card-bg); border-color: var(--text-main); }
.editor-exit:disabled { opacity: 0.45; cursor: not-allowed; }

.editor-logo { font-size: 18px; flex: none; }
.editor-logo .logo-mark { width: 30px; height: 30px; }
.editor-logo .logo-mark::after { width: 10px; height: 10px; }

.editor-crumb {
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-left: 12px;
  border-left: 1px solid var(--border-light);
  white-space: nowrap;
}

.editor-file-count {
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
}

.editor-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  overflow: hidden;
}

.editor-workspace[hidden] { display: none; }

.editor-main {
  min-width: 0;
  overflow-y: auto;
  padding: clamp(22px, 2.6vw, 34px) clamp(18px, 2.6vw, 34px) 70px;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.editor-view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--card-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.editor-view-toggle button {
  width: 34px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s var(--ease-color), color 0.2s var(--ease-color);
}

.editor-view-toggle button:hover { color: var(--text-main); }

.editor-view-toggle button[aria-pressed="true"] {
  background: var(--text-main);
  color: var(--card-bg);
}

.editor-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.editor-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s var(--ease-color), color 0.2s var(--ease-color), border-color 0.2s var(--ease-color);
}

.editor-tool:hover {
  background: var(--text-main);
  border-color: var(--text-main);
  color: var(--card-bg);
}

.editor-tool:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.editor-tool[aria-pressed="true"] {
  background: var(--text-main);
  border-color: var(--text-main);
  color: var(--card-bg);
}

.editor-card.is-selected {
  border-color: var(--text-main);
  box-shadow: 0 0 0 2px var(--text-main), 0 12px 26px rgba(0, 0, 0, 0.12);
}

.editor-select-box {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border-mid);
  background: var(--card-bg);
  color: var(--card-bg);
  display: none;
  place-items: center;
  pointer-events: none;
}

.editor-grid.is-selecting .editor-select-box { display: grid; }

.editor-card.is-selected .editor-select-box {
  background: var(--text-main);
  border-color: var(--text-main);
}

.editor-select-box svg { opacity: 0; }
.editor-card.is-selected .editor-select-box svg { opacity: 1; }

.editor-grid.is-selecting .editor-hover-actions { opacity: 0; pointer-events: none; }
.editor-grid.is-selecting .editor-thumb { cursor: pointer; }

.editor-upload-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #0a0a0a;
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.editor-tool-wide {
  width: 100%;
  height: 44px;
  justify-content: center;
}

.editor-grid-wrap { position: relative; }

.editor-grid {
  display: grid;
  grid-template-columns: repeat(var(--editor-cols, 5), minmax(0, 1fr));
  gap: 10px;
  padding-top: 0;
}

.editor-add-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
  border: 2px dashed rgba(10, 10, 10, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-muted);
  cursor: pointer;
  padding: 14px;
  transition: border-color 0.2s var(--ease-color), color 0.2s var(--ease-color), background 0.2s var(--ease-color);
}

.editor-add-card:hover {
  border-color: var(--accent-orange);
  color: var(--text-main);
  background: rgba(255, 56, 17, 0.06);
}

html[data-theme="dark"] .editor-add-card {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .editor-add-card:hover {
  border-color: var(--accent-orange);
  background: rgba(255, 56, 17, 0.12);
}

.editor-add-card .editor-add-ico {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid rgba(10, 10, 10, 0.16);
  display: grid;
  place-items: center;
  background: var(--card-bg);
}

html[data-theme="dark"] .editor-add-card .editor-add-ico {
  border-color: rgba(255, 255, 255, 0.2);
}

.editor-add-card .editor-add-label {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
  text-align: center;
}

.editor-add-card .editor-add-sub {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
}

.editor-grid.is-list .editor-add-card {
  min-height: 56px;
  flex-direction: row;
  gap: 12px;
  justify-content: flex-start;
  padding: 10px 16px;
}

.editor-grid.is-list .editor-add-card .editor-add-ico { width: 30px; height: 30px; }
.editor-grid.is-list .editor-add-card .editor-add-sub { display: none; }

.editor-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 12px 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 22px rgba(0, 0, 0, 0.07);
  transition: border-color 0.22s var(--ease-color), box-shadow 0.22s var(--ease-color), opacity 0.22s var(--ease-color);
}

.editor-card:hover {
  border-color: var(--text-main);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), 0 14px 30px rgba(0, 0, 0, 0.12);
}

.editor-card.is-drag { opacity: 0.4; }
.editor-card.is-dragging { display: none; }
.editor-card.is-over { border-color: var(--text-main); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12); }
.editor-card.is-loading .editor-hover-actions { opacity: 0; pointer-events: none; }
.editor-card.is-loading .editor-thumb { cursor: progress; }

.editor-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.editor-spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2.5px solid rgba(10, 10, 10, 0.12);
  border-top-color: var(--accent-orange);
  animation: editorSpin 0.75s linear infinite;
}

@keyframes editorSpin {
  to { transform: rotate(360deg); }
}

.editor-placeholder {
  border-radius: 10px;
  border: 1.5px dashed var(--accent-orange);
  background: rgba(255, 56, 17, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 56, 17, 0.12);
  min-height: 120px;
  pointer-events: none;
}

.editor-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: zoom-in;
  display: grid;
  place-items: center;
  padding: 0;
}

.editor-thumb:focus-visible { outline: 2px solid var(--accent-orange); outline-offset: 3px; border-radius: 4px; }

.editor-page {
  position: relative;
  background: #ffffff;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18), 0 14px 32px rgba(0, 0, 0, 0.16);
  transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out);
}

.editor-page-inner {
  position: absolute;
  display: grid;
  place-items: center;
  transition: inset 0.25s var(--ease-out);
}

.editor-page-inner img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.25s var(--ease-out);
}

.editor-page-blank {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-transform: uppercase;
  text-align: center;
  padding: 4px;
}

html[data-theme="dark"] .editor-card {
  border-color: var(--border-light);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .editor-page { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); }

.editor-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 84px 20px;
  text-align: center;
  color: var(--text-muted);
}

.editor-empty b {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

.editor-empty span { font-size: 12.5px; }

.editor-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  min-width: 0;
}

.editor-card-name {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0;
}

.editor-card-index {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  line-height: 1;
}

.editor-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translate(-50%, 4px);
  z-index: 6;
  padding: 7px 10px;
  border-radius: 7px;
  background: var(--text-main);
  color: var(--card-bg);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s var(--ease-color), transform 0.18s var(--ease-out);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.editor-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-main);
}

.editor-card:hover .editor-tip,
.editor-card:has(:focus-visible) .editor-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.editor-hover-actions {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 3;
  display: flex;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease-color);
}

.editor-card:hover .editor-hover-actions,
.editor-card:has(:focus-visible) .editor-hover-actions {
  opacity: 1;
  pointer-events: auto;
}

.editor-hover-actions button {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: var(--card-bg);
  color: var(--text-main);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: background 0.2s var(--ease-color), color 0.2s var(--ease-color), border-color 0.2s var(--ease-color);
}

.editor-hover-actions button:hover { background: var(--text-main); color: var(--card-bg); border-color: var(--text-main); }
.editor-hover-actions .editor-remove:hover { background: var(--accent-orange); border-color: var(--accent-orange); color: #ffffff; }

.editor-grid.is-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 0;
}

.editor-grid.is-list .editor-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  grid-template-areas: "thumb name actions";
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 12px;
}

.editor-grid.is-list .editor-thumb {
  grid-area: thumb;
  width: 54px;
  height: 74px;
  aspect-ratio: auto;
}

.editor-grid.is-list .editor-page-inner img {
  transition: transform 0.25s var(--ease-out);
}

.editor-grid.is-list .editor-page-blank {
  font-size: 5px;
  letter-spacing: 0.06em;
  padding: 2px;
}

.editor-grid.is-list .editor-card-foot {
  grid-area: name;
  padding: 0;
}

.editor-grid.is-list .editor-card-name {
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 0;
  font-size: 12px;
}

.editor-grid.is-list .editor-hover-actions {
  grid-area: actions;
  position: static;
  opacity: 1;
  pointer-events: auto;
}

.editor-grid.is-list .editor-tip { display: none; }

.editor-add-fab {
  position: absolute;
  top: -12px;
  right: -10px;
  z-index: 4;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: var(--accent-orange);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(255, 56, 17, 0.35);
  transition: background 0.22s var(--ease-color), transform 0.22s var(--ease-out), opacity 0.22s var(--ease-color);
}

.editor-add-fab:hover:not(:disabled) { background: var(--accent-hover); transform: scale(1.05); }
.editor-add-fab:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.editor-fab-count {
  position: absolute;
  top: -5px;
  left: -5px;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--text-main);
  color: var(--card-bg);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.editor-sidebar {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-left: 1px solid var(--border-light);
  overflow: hidden;
}

.editor-sidebar-head {
  flex: none;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-light);
  text-align: center;
}

.editor-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px clamp(18px, 2.2vw, 28px) 26px;
}

.editor-panel-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.3;
}

.editor-field { display: flex; flex-direction: column; gap: 10px; }

.editor-panel .name-field { height: 42px; border-radius: 9px; padding: 0 13px; }
.editor-panel .name-field input { font-size: 13px; }

.editor-label {
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-main);
}

.editor-choice-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

#orientationChoices { grid-template-columns: repeat(3, 1fr); }

.editor-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 64px;
  padding: 8px 6px;
  border: 1px solid var(--border-mid);
  border-radius: 9px;
  background: var(--card-bg);
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.22s var(--ease-color), color 0.22s var(--ease-color), border-color 0.22s var(--ease-color), transform 0.22s var(--ease-out);
}

.editor-choice:hover { border-color: var(--text-main); }

.editor-choice svg {
  width: 20px;
  height: 20px;
  color: var(--text-main);
}

.editor-choice span {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.editor-choice[aria-pressed="true"] {
  background: var(--card-sub-bg);
  border-color: var(--text-main);
  box-shadow: inset 0 0 0 1px var(--text-main);
}

.editor-select { position: relative; }

.editor-select select {
  width: 100%;
  height: 44px;
  appearance: none;
  -webkit-appearance: none;
  padding: 0 42px 0 14px;
  border: 1px solid var(--border-mid);
  border-radius: 9px;
  background: var(--card-bg);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.25s var(--ease-color);
}

.editor-select select:hover,
.editor-select select:focus { border-color: var(--accent-orange); }

.editor-select > svg {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
}

.editor-select-btn {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border-mid);
  border-radius: 9px;
  background: var(--card-bg);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.25s var(--ease-color);
}

.editor-select-btn:hover,
.editor-select-btn[aria-expanded="true"] { border-color: var(--accent-orange); }

.editor-select-btn svg { color: var(--text-muted); transition: transform 0.2s var(--ease-color); }
.editor-select-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.editor-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  max-height: 260px;
  overflow-y: auto;
}

.editor-select-menu li {
  padding: 9px 12px;
  border-radius: 7px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
}

.editor-select-menu li:hover { background: var(--card-sub-bg); }
.editor-select-menu li[aria-selected="true"] { background: var(--text-main); color: var(--card-bg); }

.editor-add-menu { position: relative; }
.editor-delete-menu { position: relative; }
.editor-cols-menu { position: relative; }

.editor-mobile-only,
.editor-mobile-break,
.editor-mobile-row1 { display: none; }

.editor-mobile-dd { position: relative; }

.editor-mobile-dd > .editor-tool { gap: 6px; padding: 0 10px; }

.editor-dd-caret { opacity: 0.55; flex: none; }

.editor-mobile-dd .editor-add-dropdown { min-width: 150px; }

.editor-mobile-dd .editor-add-dropdown .editor-choice {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
  height: auto;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.editor-mobile-dd .editor-add-dropdown .editor-choice:hover {
  border: 0;
  background: var(--card-sub-bg);
}

.editor-mobile-dd .editor-add-dropdown .editor-choice[aria-pressed="true"] {
  background: var(--text-main);
  border: 0;
  box-shadow: none;
  color: var(--card-bg);
}

.editor-mobile-dd .editor-add-dropdown .editor-choice svg { display: none; }

.editor-cols-dropdown {
  left: auto;
  right: 0;
  min-width: 150px;
}

.editor-cols-dropdown button[aria-selected="true"] {
  background: var(--text-main);
  color: var(--card-bg);
}

.editor-add-dropdown {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.editor-add-dropdown[hidden],
.editor-select-menu[hidden] { display: none; }

.editor-add-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s var(--ease-color);
}

.editor-add-dropdown button:hover { background: var(--card-sub-bg); }

.editor-merge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.editor-merge input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.editor-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border-mid);
  background: var(--card-bg);
  display: grid;
  place-items: center;
  flex: none;
  color: #ffffff;
  transition: background 0.2s var(--ease-color), border-color 0.2s var(--ease-color);
}

.editor-check::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
}

.editor-merge input:checked + .editor-check {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
}

.editor-merge input:checked + .editor-check::after { opacity: 1; }

.editor-merge input:focus-visible + .editor-check { outline: 2px solid var(--accent-orange); outline-offset: 2px; }

.editor-build {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px clamp(18px, 2.2vw, 28px) 20px;
  border-top: 1px solid var(--border-light);
  background: var(--card-bg);
}

.convert-btn {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--accent-orange);
  color: #0a0a0a;
  font-family: var(--font-display);
  font-size: 13.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 14px 28px -10px rgba(255, 56, 17, 0.55);
  transition: background 0.25s var(--ease-color), transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-color), opacity 0.25s var(--ease-color);
}

.convert-btn:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-2px); }

.convert-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.convert-ico {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #0a0a0a;
  color: #ffffff;
  display: grid;
  place-items: center;
  flex: none;
}

.editor-build .build-meta { text-align: center; }

.editor-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 90px;
}

.editor-progress[hidden] { display: none; }

.convert-logo { font-size: 24px; margin-bottom: clamp(22px, 4vw, 36px); }
.convert-logo .logo-mark { width: 38px; height: 38px; }

.convert-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 38px);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.08;
  text-transform: uppercase;
}

.convert-sub {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 460px;
}

.convert-track {
  width: min(680px, 100%);
  height: 12px;
  margin-top: clamp(24px, 4vw, 38px);
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.convert-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-orange), #ff8a5c);
  transition: width 0.3s var(--ease-out);
}

.convert-percent {
  margin-top: clamp(18px, 2.5vw, 26px);
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text-main);
}

.convert-status {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

.editor-result {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(30px, 5vw, 62px) clamp(16px, 3vw, 40px) 80px;
}

.editor-result[hidden] { display: none; }

.result-inner {
  width: min(820px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.result-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 56, 17, 0.12);
  color: var(--accent-orange);
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.result-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 50px);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.34;
  text-transform: uppercase;
  max-width: 760px;
}

.result-title .accent { color: var(--accent-orange); }

.result-sub {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 520px;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.result-download { min-width: 300px; justify-content: center; gap: 10px; }
.result-download .ico { display: grid; place-items: center; }

.result-icon-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: var(--card-bg);
  color: var(--text-main);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.22s var(--ease-color), color 0.22s var(--ease-color), border-color 0.22s var(--ease-color), transform 0.22s var(--ease-out);
}

.result-icon-btn:hover { background: var(--text-main); color: var(--card-bg); border-color: var(--text-main); transform: translateY(-1px); }
.result-danger:hover { background: var(--accent-orange); border-color: var(--accent-orange); color: #ffffff; }

.result-continue {
  width: 100%;
  margin-top: 26px;
  padding: clamp(18px, 2.6vw, 26px);
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  text-align: left;
}

.result-continue h3,
.result-privacy h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.result-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.result-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--card-sub-bg);
  color: var(--text-main);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.22s var(--ease-color), background 0.22s var(--ease-color);
}

.result-link:hover { border-color: var(--accent-orange); }

.result-link-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--card-bg);
  color: var(--accent-orange);
  display: grid;
  place-items: center;
  flex: none;
}

.result-privacy {
  width: 100%;
  margin-top: 12px;
  padding: clamp(18px, 2.6vw, 26px);
  background: var(--card-sub-bg);
  border: 1px solid var(--border-light);
  border-radius: 22px;
  text-align: left;
}

.result-privacy p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 640px;
}

.result-privacy-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--text-main);
}

.result-privacy-tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-orange); }

/* ---------- delete confirmation modal ---------- */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.confirm-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 22px;
  padding: 26px 22px 18px;
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.confirm-ico {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 56, 17, 0.12);
  color: var(--accent-orange);
  display: grid;
  place-items: center;
}

.confirm-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.3;
  text-transform: uppercase;
}

.confirm-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 330px;
}

.confirm-timer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed var(--border-mid);
  background: var(--card-sub-bg);
}

.confirm-timer-label {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.confirm-timer-value {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--accent-orange);
}

.confirm-danger {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  background: var(--accent-orange);
  color: #0a0a0a;
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 14px 28px -12px rgba(255, 56, 17, 0.55);
  transition: background 0.22s var(--ease-color), transform 0.22s var(--ease-out);
}

.confirm-danger:hover { background: var(--accent-hover); transform: translateY(-1px); }

.confirm-cancel {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px;
  cursor: pointer;
  transition: color 0.22s var(--ease-color);
}

.confirm-cancel:hover { color: var(--text-main); }

@media (max-width: 1100px) {
  .editor-workspace { grid-template-columns: minmax(0, 1fr) 360px; }
  .editor-grid { --editor-cols: 5; }
}

@media (max-width: 900px) {
  .editor-workspace { display: block; overflow-y: auto; }
  .editor-main { overflow: visible; padding: 26px 18px 40px; }
  .editor-sidebar {
    height: auto;
    overflow: visible;
    border-left: 0;
    border-top: 1px solid var(--border-light);
  }
  .editor-sidebar-head { padding: 20px 18px; }
  .editor-panel { overflow: visible; padding: 22px 18px 24px; }
  .editor-build { position: static; box-shadow: none; }
}

@media (max-width: 760px) {
  .editor-grid { --editor-cols: 5; }
  .editor-grid.is-list { display: flex; }
}

@media (max-width: 640px) {
  .editor-header { min-height: 58px; gap: 8px; padding: 0 12px; }
  .editor-crumb { display: none; }
  .editor-file-count { display: inline-flex; font-size: 9.5px; letter-spacing: 0.06em; }
  .editor-exit { width: 36px; height: 36px; }
  .editor-logo { font-size: 16px; }
  .editor-logo .logo-mark { width: 27px; height: 27px; }
  .editor-logo .logo-mark::after { width: 9px; height: 9px; }
  .editor-grid { --editor-cols: 1; gap: 10px; justify-items: center; }
  .editor-add-card { min-height: 120px; width: 100%; max-width: 210px; }
  .editor-card { border-radius: 10px; padding: 5px 5px 7px; gap: 5px; width: 100%; max-width: 210px; }
  .editor-thumb { aspect-ratio: 210 / 297; }
  .editor-card-foot { padding: 0; gap: 5px; }
  .editor-card-name { font-size: 9.5px; }
  .editor-card-index { font-size: 8.5px; }
  .editor-tip { display: none; }
  .editor-hover-actions { opacity: 1; pointer-events: auto; top: 4px; right: 4px; gap: 4px; }
  .editor-hover-actions button { width: 30px; height: 30px; }
  .editor-hover-actions button svg { width: 17px; height: 17px; }
  .editor-toolbar { align-items: stretch; }
  .editor-toolbar-actions { flex: 1; }
  .editor-tool { flex: 1; justify-content: center; padding: 0 8px; }
  .editor-grid.is-list .editor-card { grid-template-columns: 46px minmax(0, 1fr) auto; padding: 8px 10px; gap: 10px; }
  .editor-grid.is-list .editor-thumb { width: 46px; height: 63px; }
  .editor-add-fab { width: 46px; height: 46px; top: -12px; right: -6px; }
  .editor-fab-count { min-width: 19px; height: 19px; font-size: 10px; }
  #orientationChoices .editor-choice { min-height: 64px; }
  .editor-sidebar-head { padding: 18px 16px; }
  .editor-panel { padding: 20px 16px 22px; gap: 20px; }
  .editor-build { padding: 14px 16px 16px; }
  .editor-panel-title { font-size: 17px; }
  .convert-percent { font-size: 38px; }
  .result-title { font-size: 26px; letter-spacing: 0; line-height: 1.32; }
  .result-actions { width: 100%; }
  .result-download { min-width: 0; width: 100%; order: 1; }
  .result-icon-btn { order: 2; }
  .result-danger { order: 3; }
  .result-links { grid-template-columns: 1fr; }
  .result-continue h3, .result-privacy h3 { font-size: 14px; }
}

/* Mobile-only editor layout (phones <= 640px) */
@media (max-width: 640px) {
  .editor-main { padding: 0 16px 28px; }
  .editor-sidebar-head,
  .editor-panel { display: none; }
  .editor-sidebar { border-top: 0; }

  .editor-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px 4px;
    margin: 10px 0 12px;
    padding: 0;
    background: transparent;
    border-bottom: 0;
  }

  .editor-toolbar-actions { display: contents; }
  .editor-toolbar-actions .editor-tool {
    flex: 0 0 auto;
    width: auto;
    height: 36px;
    padding: 0 10px;
    gap: 5px;
    font-size: 9.5px;
  }
  .editor-upload-tool > span:not(.editor-upload-count) { display: none; }
  #rotateBtn span,
  #deleteBtn span,
  #sortBtn span,
  #colsBtn span { display: none; }
  #rotateBtn, #deleteBtn, #sortBtn, #colsBtn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .editor-mobile-row1 {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    width: auto;
    margin: 0 -16px;
    padding: 8px 16px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .editor-mobile-row1::-webkit-scrollbar { display: none; }
  .editor-mobile-row1 > * { flex: 0 0 auto; position: relative; }
  .editor-mobile-row1 .editor-tool {
    height: 38px;
    padding: 0 10px;
    justify-content: center;
    border-radius: 10px;
    background: var(--card-sub-bg);
    border-color: transparent;
  }
  .editor-mobile-row1 #rotateBtn,
  .editor-mobile-row1 #deleteBtn {
    width: 38px;
    padding: 0;
  }
  .editor-mobile-row1 .editor-upload-count {
    min-width: 17px;
    height: 17px;
    font-size: 9px;
  }

  .editor-mobile-dd { display: inline-flex; }
  .editor-mobile-break {
    display: block;
    order: 7;
    flex: 0 0 100%;
    width: 100%;
    height: 0;
  }

  .editor-add-menu { order: 1; }
  #rotateBtn { order: 2; }
  .editor-delete-menu { order: 3; }
  .editor-mobile-size { order: 4; }
  .editor-mobile-orient { order: 5; }
  .editor-mobile-margin { order: 6; }
  #selectBtn { order: 8; }
  #selectAllBtn { order: 9; }
  .editor-view-toggle { display: none; }
  .editor-cols-menu { display: inline-flex; order: 10; margin-left: auto; }
  #sortBtn { order: 11; margin-left: 0; }

  .editor-mobile-margin .editor-add-dropdown {
    left: auto;
    right: 0;
  }

  .editor-toolbar.is-selecting .editor-add-menu,
  .editor-toolbar.is-selecting #sortBtn,
  .editor-toolbar.is-selecting .editor-view-toggle { display: none; }

  .editor-cols-menu .editor-add-dropdown {
    left: auto;
    right: 0;
  }
  .editor-delete-menu .editor-add-dropdown {
    left: auto;
    right: 0;
  }

  .editor-workspace { padding-bottom: 140px; }
  .editor-separate-toggle {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 8px;
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--text-main);
    cursor: pointer;
  }
  .editor-separate-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }
  .editor-separate-track {
    position: relative;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: var(--border-mid);
    transition: background 0.2s var(--ease-color);
  }
  .editor-separate-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s var(--ease-out);
  }
  .editor-separate-toggle input:checked + .editor-separate-track { background: var(--accent-orange); }
  .editor-separate-toggle input:checked + .editor-separate-track .editor-separate-knob { transform: translateX(16px); }
  .editor-separate-toggle input:focus-visible + .editor-separate-track { outline: 2px solid var(--accent-orange); outline-offset: 2px; }
  .editor-build {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.1);
  }
  .editor-build .convert-btn { min-height: 50px; }
  .editor-build .build-meta { font-size: 10px; }
  .editor-build .build-meta[hidden] { display: block; }
}

@media (max-width: 380px) {
  .editor-toolbar-actions .editor-tool {
    padding: 0 8px;
    font-size: 9px;
  }
  #rotateBtn, #deleteBtn, #sortBtn, #colsBtn {
    width: 34px;
    padding: 0;
  }
  .editor-view-toggle button { width: 28px; height: 28px; }
}
