/* Edit Text in Image — Swiss Pocket Tool Workbench */
.eti-app {
  color: var(--text, #0f172a);
  font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
}

.eti-dropzone {
  border: 2px dashed var(--border, #cbd5e1);
  border-radius: var(--radius, 12px);
  background: var(--surface, #ffffff);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.eti-dropzone:hover,
.eti-dropzone.is-drag {
  border-color: var(--primary, #1d4ed8);
  background: var(--primary-soft, rgb(29 78 216 / 0.06));
}

.eti-drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--primary-soft, rgb(29 78 216 / 0.08));
  color: var(--primary, #1d4ed8);
  margin-bottom: 14px;
}

.eti-drop-title {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.eti-drop-sub {
  font-size: 0.9rem;
  color: var(--muted, #4a5568);
  margin-bottom: 18px;
}

.eti-drop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* Buttons & Controls */
.eti-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border, #dce3ee);
  background: var(--surface, #ffffff);
  color: var(--text, #0f172a);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.eti-btn:hover:not(:disabled) {
  border-color: var(--primary, #1d4ed8);
  color: var(--primary, #1d4ed8);
}

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

.eti-btn-primary {
  background: var(--primary, #1d4ed8);
  border-color: var(--primary, #1d4ed8);
  color: #ffffff;
}

.eti-btn-primary:hover:not(:disabled) {
  background: var(--primary-hover, #1e40af);
  border-color: var(--primary-hover, #1e40af);
  color: #ffffff;
}

.eti-btn-accent {
  background: var(--accent, #0f766e);
  border-color: var(--accent, #0f766e);
  color: #ffffff;
}

.eti-btn-accent:hover:not(:disabled) {
  filter: brightness(0.92);
  color: #ffffff;
}

.eti-btn-ghost {
  background: transparent;
}

.eti-btn-danger {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.28);
}

.eti-btn-danger:hover:not(:disabled) {
  background: rgba(185, 28, 28, 0.08);
  border-color: #b91c1c;
  color: #b91c1c;
}

.eti-btn[aria-pressed="true"] {
  background: var(--primary-soft, rgb(29 78 216 / 0.12));
  border-color: var(--primary, #1d4ed8);
  color: var(--primary, #1d4ed8);
}

.eti-btn-sm {
  padding: 6px 11px;
  font-size: 0.84rem;
}

.eti-btn-xs {
  padding: 4px 9px;
  font-size: 0.78rem;
}

.eti-btn-icon {
  padding: 5px 10px;
  font-size: 1rem;
  line-height: 1.1;
}

.eti-select {
  padding: 6px 10px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border, #dce3ee);
  background: var(--surface, #ffffff);
  color: var(--text, #0f172a);
  font-size: 0.84rem;
  font-weight: 500;
}

/* Toolbar */
.eti-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #dce3ee);
  border-radius: var(--radius, 12px);
  margin-bottom: 12px;
}

.eti-tb-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.eti-zoom-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted, #4a5568);
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bg, #f6f8fb);
  border: 1px solid var(--border, #dce3ee);
}

/* Status / Progress */
.eti-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm, 8px);
  background: var(--primary-soft, rgb(29 78 216 / 0.08));
  border: 1px solid var(--border, #dce3ee);
  font-size: 0.84rem;
}

.eti-status-bar {
  flex: 0 0 140px;
  height: 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.eti-status-fill {
  height: 100%;
  width: 0%;
  background: var(--primary, #1d4ed8);
  transition: width 0.2s ease;
}

.eti-status-text {
  color: var(--text, #0f172a);
  font-weight: 500;
}

/* Main Split Workspace */
.eti-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 14px;
  align-items: start;
}

.eti-stage-wrap {
  background: var(--bg, #f6f8fb);
  border: 1px solid var(--border, #dce3ee);
  border-radius: var(--radius, 12px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 440px;
  overflow: auto;
}

.eti-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.12);
  border-radius: 4px;
  user-select: none;
  touch-action: none;
}

.eti-stage.is-drawing {
  cursor: crosshair;
}

.eti-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.eti-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.eti-box {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px dashed rgba(29, 78, 216, 0.65);
  background: rgba(29, 78, 216, 0.06);
  border-radius: 3px;
  pointer-events: auto;
  cursor: move;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.eti-box:hover {
  border-style: solid;
  border-color: var(--primary, #1d4ed8);
  background: rgba(29, 78, 216, 0.12);
}

.eti-box.is-edited {
  border-color: rgba(15, 118, 110, 0.78);
  background: rgba(15, 118, 110, 0.05);
}

.eti-box.is-selected {
  border: 2px solid var(--primary, #1d4ed8);
  background: rgba(29, 78, 216, 0.09);
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.18);
  z-index: 3;
}

.eti-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--primary, #1d4ed8);
  cursor: nwse-resize;
}

.eti-draft-box {
  position: absolute;
  border: 2px dashed var(--accent, #0f766e);
  background: rgba(15, 118, 110, 0.12);
  pointer-events: none;
  z-index: 5;
}

.eti-stage-hint {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted, #4a5568);
  text-align: center;
}

/* Right Inspector Panel */
.eti-panel {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #dce3ee);
  border-radius: var(--radius, 12px);
  padding: 14px;
}

.eti-panel .eti-panel-title {
  margin: 0 0 10px;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.eti-steps {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted, #4a5568);
}

.eti-steps li + li {
  margin-top: 6px;
}

.eti-shortcuts {
  font-size: 0.78rem;
  color: var(--muted, #4a5568);
  background: var(--bg, #f6f8fb);
  border: 1px solid var(--border, #dce3ee);
  border-radius: var(--radius-sm, 8px);
  padding: 10px;
  display: grid;
  gap: 5px;
}

.eti-box-count {
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent, #0f766e);
}

.eti-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.eti-panel-head .eti-panel-title {
  margin: 0;
}

.eti-panel-head-btns {
  display: flex;
  gap: 6px;
}

.eti-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted, #4a5568);
}

.eti-field textarea,
.eti-field input[type="number"],
.eti-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 9px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border, #dce3ee);
  background: var(--bg, #f6f8fb);
  color: var(--text, #0f172a);
  font-size: 0.86rem;
  font-family: inherit;
}

.eti-field textarea {
  resize: vertical;
  min-height: 68px;
  line-height: 1.4;
}

.eti-field input[type="number"],
.eti-field select {
  height: 36px;
  white-space: nowrap;
}

.eti-field input[type="color"] {
  width: 100%;
  height: 36px;
  padding: 2px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border, #dce3ee);
  background: var(--surface, #ffffff);
  cursor: pointer;
}

.eti-field input[type="range"] {
  width: 100%;
  accent-color: var(--primary, #1d4ed8);
}

.eti-range-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eti-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.eti-row-3 {
  display: grid;
  grid-template-columns: 72px 84px 1fr;
  gap: 8px;
}

.eti-toggle-row {
  display: flex;
  gap: 4px;
}

.eti-chip-btn {
  flex: 1;
  height: 34px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border, #dce3ee);
  background: var(--bg, #f6f8fb);
  color: var(--text, #0f172a);
  cursor: pointer;
  font-size: 0.86rem;
}

.eti-chip-btn[aria-pressed="true"] {
  background: var(--primary, #1d4ed8);
  border-color: var(--primary, #1d4ed8);
  color: #ffffff;
}

.eti-divider {
  height: 1px;
  background: var(--border, #dce3ee);
  margin: 12px 0 10px;
}

.eti-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #4a5568);
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .eti-workspace {
    grid-template-columns: 1fr;
  }
  .eti-stage-wrap {
    min-height: 300px;
  }
}