:root {
  --bg: #0e1014;
  --panel: #161922;
  --panel-2: #1e2330;
  --line: #2a3141;
  --text: #f1f4f8;
  --muted: #9aa5b5;
  --accent: #f2b705;
  --accent-2: #00d0ff;
  --danger: #ff5c7a;
  --shadow: 0 18px 50px rgba(0,0,0,.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
button, input, select { font: inherit; }
button, .file-button {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #242a39, #171b25);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
}
button:hover, .file-button:hover { border-color: var(--accent); }
button:active { transform: translateY(1px); }

.install-banner {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; gap: 10px; align-items: center; padding: 10px 12px;
  background: rgba(20,23,33,.95); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.hidden { display: none !important; }

.app-shell { display: grid; grid-template-rows: 64px 1fr; height: 100vh; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(14,16,20,.9); backdrop-filter: blur(16px);
}
.brand { display: flex; gap: 10px; align-items: center; min-width: 210px; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-weight: 900; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 10px 26px rgba(242,183,5,.25); }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.top-actions button, .top-actions .file-button { padding: 8px 11px; }

.workspace { display: grid; grid-template-columns: 82px minmax(0, 1fr) 330px; min-height: 0; }
.toolrail { border-right: 1px solid var(--line); background: #11141b; padding: 10px 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.tool { width: 64px; min-height: 58px; padding: 6px 4px; display: grid; place-items: center; gap: 2px; font-weight: 800; }
.tool span { display: block; font-size: 10px; font-weight: 600; color: var(--muted); }
.tool.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(242,183,5,.55); background: linear-gradient(180deg, #352b66, #201a3d); }

.stage-wrap { display: grid; grid-template-rows: 52px minmax(0, 1fr) 36px; min-width: 0; background: radial-gradient(circle at top, rgba(242,183,5,.13), transparent 35%), #0d0f14; }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; gap: 10px; border-bottom: 1px solid var(--line); background: rgba(18,21,29,.8); }
.tool-options, .zoom-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tool-options label, .zoom-actions span { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.tool-options input[type="range"] { width: 120px; }
.tool-options input[type="number"] { width: 72px; }
.tool-options input[type="color"] { width: 34px; height: 28px; padding: 0; border: 0; background: transparent; }
select, input[type="text"], input[type="number"] {
  background: #0f1219; border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 7px 8px; min-width: 0;
}

.stage-scroller { position: relative; overflow: auto; display: grid; place-items: center; padding: 64px; }
#editorCanvas {
  display: block; background: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 22px 60px rgba(0,0,0,.55);
  image-rendering: auto; transform-origin: center center;
}
.statusbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; border-top: 1px solid var(--line); background: #11141b; color: var(--muted); font-size: 12px; }

.inspector { border-left: 1px solid var(--line); background: #11141b; padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: 0 8px 18px rgba(0,0,0,.12); }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.mini-actions { display: flex; gap: 6px; }
.mini-actions button { padding: 5px 8px; }
.panel label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; margin: 8px 0; }
.panel input[type="range"] { width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.layer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.layers-list { display: flex; flex-direction: column-reverse; gap: 6px; max-height: 240px; overflow-y: auto; }
.layer-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.layer-item.active { border-color: var(--accent); background: #2a2352; }
.layer-thumb { width: 28px; height: 28px; border-radius: 7px; background: repeating-conic-gradient(#727987 0% 25%, #4d5360 0% 50%) 50% / 10px 10px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); }
.layer-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.layer-kind { color: var(--muted); font-size: 10px; }
.vis-toggle { padding: 4px 7px; }
.compact-note p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }

.crop-rect, .draw-rect { pointer-events: none; position: absolute; border: 1px dashed #fff; background: rgba(242,183,5,.12); }

@media (max-width: 1040px) {
  .workspace { grid-template-columns: 64px 1fr; }
  .inspector { position: fixed; right: 10px; top: 74px; bottom: 46px; width: 300px; transform: translateX(calc(100% + 12px)); transition: transform .2s ease; z-index: 10; box-shadow: var(--shadow); }
  .inspector:hover, .inspector:focus-within { transform: translateX(0); }
  .toolrail { padding: 8px 4px; }
  .tool { width: 54px; }
  .brand small { display: none; }
}

@media (max-width: 760px) {
  html, body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; grid-template-rows: auto 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .workspace { min-height: 720px; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .toolrail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-wrap { grid-template-rows: auto minmax(400px, 1fr) 36px; }
  .stage-toolbar { align-items: flex-start; flex-direction: column; }
  .stage-scroller { padding: 30px; place-items: start; }
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
  border-color: var(--line);
}
button:disabled:hover { border-color: var(--line); }
.checkline { display: flex !important; grid-template-columns: none !important; flex-direction: row; align-items: center; gap: 8px !important; }
.checkline input { width: auto; }
.selection-actions button { min-height: 38px; }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.selection-pulse { color: var(--accent-2); }

#btnSelectSubject {
  width: 100%;
  min-height: 42px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(255,255,255,.18);
  color: #fff;
  box-shadow: 0 12px 28px rgba(0,208,255,.12);
}
#btnSelectSubject:disabled { filter: grayscale(.25); opacity: .7; }

.flower-mark { font-size: 25px; text-shadow: 0 2px 10px rgba(0,0,0,.25); }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.transform-actions button { min-height: 34px; padding: 6px 8px; }
.soft-sep { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.stage-wrap { grid-template-rows: auto minmax(0, 1fr) 36px; }
.stage-toolbar { min-height: 52px; }

.version-badge {
  position: absolute;
  top: 5px;
  right: 8px;
  color: rgba(241,244,248,.38);
  font-size: 10px;
  letter-spacing: .04em;
  user-select: none;
  pointer-events: none;
}
.topbar { position: relative; }
.layer-pro-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.layer-pro-actions button {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}
.layer-item.locked { opacity: .75; }
.layer-item.clipped { border-left: 3px solid var(--accent-2); }
.layer-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.layer-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 1px 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
  background: rgba(0,0,0,.18);
}
.layer-thumb.has-preview {
  background-size: cover;
  background-position: center;
}
.layer-thumb-wrap {
  position: relative;
  width: 28px;
  height: 28px;
}
.mask-mini {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 13px;
  height: 13px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.35);
}
@media (max-width: 760px) {
  .version-badge { top: 8px; right: 12px; }
}

.text-panel textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  background: #0f1219;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 9px;
  line-height: 1.35;
}
.text-panel input[type="color"] {
  width: 100%;
  min-height: 34px;
  padding: 2px;
  background: #0f1219;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.text-toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  align-items: center;
}
.text-toggle-row .checkline {
  margin: 4px 0;
  font-size: 11px;
}
.panel-tag {
  color: var(--muted);
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 6px;
}
#btnTextAutoBox { width: 100%; margin-top: 8px; }

.shape-panel input[type="color"] {
  width: 100%;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1219;
}
.shape-actions button { min-height: 34px; padding: 6px 7px; font-size: 12px; }
.panel-tag {
  color: var(--muted);
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(255,255,255,.04);
}

.filters-panel input[type=number] { width: 100%; }
.filters-panel .grid3 { gap: 6px; }
.layer-item .layer-kind { opacity: .78; }

.brush-panel input[type="number"], .brush-panel select { width: 100%; }
.brush-panel .text-toggle-row { grid-template-columns: 1fr 1fr 1fr; }
.brush-panel .selection-actions button { min-height: 36px; }
#cloneSourceLabel { color: var(--accent-2); }
#editorCanvas { touch-action: none; }


.performance-panel .grid2 { gap: 6px; }
.performance-panel input[type=number], .performance-panel select { width: 100%; }
.perf-stats {
  display: grid;
  gap: 6px;
  margin: 8px 0 10px;
}
.perf-stats div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 8px;
  background: rgba(255,255,255,.025);
}
.perf-stats span { color: var(--muted); font-size: 11px; }
.perf-stats strong { font-size: 11px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.version-badge { opacity: .68; }


/* Seção 12 — UI nível Photopea */
.topbar { gap: 10px; }
.menu-strip { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow: visible; }
.menu-group { position: relative; }
.menu-root { padding: 7px 9px; border-radius: 8px; background: transparent; border-color: transparent; color: var(--muted); }
.menu-root:hover, .menu-group:focus-within .menu-root { color: var(--text); border-color: var(--line); background: rgba(255,255,255,.045); }
.menu-popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 218px;
  display: none; padding: 6px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(22,25,34,.98); box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.menu-group:hover .menu-popover, .menu-group:focus-within .menu-popover { display: grid; gap: 3px; }
.menu-popover button { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; text-align: left; border-radius: 8px; padding: 8px 9px; background: transparent; border-color: transparent; }
kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-bottom-color: #111; border-radius: 5px; padding: 2px 5px; background: rgba(255,255,255,.04); }
.document-tabs {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18,21,29,.96), rgba(13,15,20,.96)); min-width: 0;
}
.doc-tab { display: flex; align-items: center; gap: 8px; min-width: 170px; max-width: 340px; padding: 7px 11px; border-radius: 10px 10px 8px 8px; background: #202638; border-color: rgba(242,183,5,.35); }
.doc-tab span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-tab small { color: var(--muted); font-size: 10px; margin-left: auto; }
.doc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px rgba(242,183,5,.65); flex: 0 0 auto; }
.tab-add { width: 34px; height: 34px; padding: 0; border-radius: 10px; }
.workspace-modes { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.workspace-modes button { padding: 6px 9px; color: var(--muted); background: rgba(255,255,255,.025); }
.workspace-modes button.active { color: #111318; background: var(--accent); border-color: transparent; font-weight: 800; }
.inspector-controlbar {
  position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 6px;
  padding: 0 0 8px; background: #11141b;
}
.inspector-controlbar input[type="search"], .command-search {
  background: #0f1219; border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 9px 10px; min-width: 0;
}
.inspector-controlbar button { padding: 7px 8px; font-size: 12px; }
.panel-title { cursor: default; }
.panel-collapse { padding: 3px 7px; border-radius: 7px; font-size: 12px; min-height: 24px; margin-left: auto; }
.panel.is-collapsed > :not(.panel-title) { display: none !important; }
.panel.hidden-by-search, .panel.hidden-by-mode { display: none !important; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding-top: 10vh; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); }
.modal-card { width: min(720px, calc(100vw - 24px)); max-height: min(76vh, 720px); overflow: auto; border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: rgba(22,25,34,.98); box-shadow: var(--shadow); }
.modal-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.modal-title button { padding: 4px 9px; border-radius: 8px; }
.shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.shortcut-grid div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
.shortcut-grid span { color: var(--muted); font-size: 13px; }
.command-card { width: min(680px, calc(100vw - 24px)); }
.command-search { width: 100%; margin-bottom: 10px; font-size: 15px; }
.command-results { display: grid; gap: 6px; }
.command-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); cursor: pointer; }
.command-item:hover, .command-item.active { border-color: var(--accent); background: rgba(242,183,5,.09); }
.command-item strong { display: block; font-size: 13px; }
.command-item small { color: var(--muted); }
.toolrail { scrollbar-width: thin; }
.inspector { scrollbar-width: thin; }
@media (max-width: 1180px) {
  .menu-strip { order: 3; width: 100%; overflow-x: auto; }
  .topbar { flex-wrap: wrap; min-height: 92px; }
  .app-shell { grid-template-rows: auto 1fr; }
}
@media (max-width: 760px) {
  .document-tabs { flex-wrap: wrap; }
  .workspace-modes { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .menu-popover { position: fixed; left: 8px; right: 8px; min-width: 0; }
}

/* v1.6.0 — interface compacta estilo editor profissional */
:root {
  --bg: #252525;
  --panel: #484848;
  --panel-2: #555;
  --line: #353535;
  --text: #e2e2e2;
  --muted: #bdbdbd;
  --accent: #f2b705;
  --accent-2: #75d5ff;
  --danger: #ff6b7a;
  --shadow: 0 10px 26px rgba(0,0,0,.34);
}
html, body { background: #252525; color: var(--text); }
button, .file-button,
select, input[type="text"], input[type="number"], input[type="search"], textarea {
  border-radius: 2px;
}
button, .file-button {
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid #555;
  background: #4a4a4a;
  color: #ddd;
  box-shadow: none;
}
button:hover, .file-button:hover { border-color: #777; background: #555; }
button:active { transform: none; }
.hidden { display: none !important; }
.install-banner {
  top: auto;
  bottom: 10px;
  right: 10px;
  left: auto;
  transform: none;
  padding: 5px 7px;
  gap: 6px;
  border-radius: 3px;
  background: #3d3d3d;
  box-shadow: 0 6px 20px rgba(0,0,0,.32);
  font-size: 12px;
}
.install-banner button { min-height: 22px; padding: 1px 6px; }
.app-shell {
  grid-template-rows: 29px 1fr;
  height: 100vh;
}
.topbar {
  position: relative;
  height: 29px;
  min-height: 29px;
  padding: 0 5px;
  gap: 4px;
  border-bottom: 1px solid #303030;
  background: #454545;
  backdrop-filter: none;
  flex-wrap: nowrap;
}
.version-badge {
  top: 1px;
  right: 5px;
  font-size: 9px;
  color: rgba(255,255,255,.32);
}
.brand {
  min-width: auto;
  gap: 5px;
  margin-right: 2px;
  flex: 0 0 auto;
}
.brand-mark {
  width: 19px;
  height: 19px;
  border-radius: 4px;
  font-size: 12px;
  box-shadow: none;
  background: linear-gradient(135deg, #f2b705, #36bd8c);
}
.brand strong { display: none; }
.brand small { display: none; }
.menu-strip {
  flex: 1 1 auto;
  gap: 0;
  height: 100%;
  overflow: hidden;
}
.menu-root {
  height: 28px;
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #d3d3d3;
  font-size: 13px;
  line-height: 28px;
}
.menu-root:hover,
.menu-group:focus-within .menu-root {
  background: #5a5a5a;
  color: #fff;
  border-color: transparent;
}
.menu-popover {
  top: 29px;
  left: 0;
  z-index: 90;
  min-width: 230px;
  padding: 4px;
  border-radius: 0;
  background: #484848;
  border: 1px solid #282828;
  box-shadow: 0 14px 28px rgba(0,0,0,.45);
  backdrop-filter: none;
}
.menu-popover button {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 0;
  color: #e2e2e2;
  font-size: 12px;
}
kbd {
  border-radius: 2px;
  border-color: #555;
  background: #333;
  color: #aaa;
  padding: 1px 4px;
}
.top-actions {
  flex: 0 0 auto;
  gap: 3px;
  flex-wrap: nowrap;
  padding-right: 34px;
}
.top-actions button,
.top-actions .file-button {
  height: 24px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 2px;
  font-size: 12px;
  background: #505050;
}
#btnCommandPalette,
#btnShortcuts,
#btnExportAVIF { display: none !important; }
.workspace {
  grid-template-columns: 34px minmax(0, 1fr) 310px;
  min-height: 0;
  background: #292929;
}
.toolrail {
  padding: 2px;
  gap: 1px;
  border-right: 1px solid #1e1e1e;
  background: #333;
  overflow: hidden;
  scrollbar-width: none;
}
.toolrail::-webkit-scrollbar { width: 0; height: 0; }
.tool {
  width: 29px;
  height: 27px;
  min-height: 27px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: #333;
  color: #d7d7d7;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
}
.tool:hover { background: #4c4c4c; border-color: transparent; }
.tool.active {
  background: #555;
  color: #fff;
  box-shadow: inset 2px 0 0 var(--accent);
  border-color: transparent;
}
.tool span { display: none !important; }
.stage-wrap {
  display: grid;
  grid-template-rows: 32px 27px minmax(0, 1fr) 22px;
  background: #272727;
  min-width: 0;
}
.stage-toolbar {
  grid-row: 1;
  height: 32px;
  min-height: 32px;
  padding: 2px 6px;
  gap: 8px;
  border-bottom: 1px solid #333;
  background: #444;
  overflow: hidden;
}
.tool-options,
.zoom-actions {
  gap: 7px;
  flex-wrap: nowrap;
  min-width: 0;
  white-space: nowrap;
}
.tool-options { overflow: hidden; }
.tool-options label,
.zoom-actions span {
  font-size: 12px;
  color: #d1d1d1;
  gap: 4px;
}
.tool-options input[type="range"] { width: 92px; }
.tool-options input[type="number"] { width: 55px; height: 24px; padding: 1px 5px; }
.tool-options input[type="color"] { width: 28px; height: 22px; }
.tool-options select,
.stage-toolbar select,
.stage-toolbar input[type="number"] {
  height: 24px;
  padding: 1px 6px;
  border-radius: 2px;
  background: #303030;
  border-color: #585858;
  color: #e0e0e0;
  font-size: 12px;
}
.checkline { gap: 4px !important; }
.zoom-actions button {
  height: 24px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 2px;
  background: #505050;
}
.document-tabs {
  grid-row: 2;
  height: 27px;
  min-height: 27px;
  padding: 0 4px;
  gap: 3px;
  border-bottom: 1px solid #1f1f1f;
  background: #2e2e2e;
}
.doc-tab {
  height: 25px;
  min-height: 25px;
  min-width: 150px;
  max-width: 260px;
  padding: 0 9px;
  gap: 6px;
  border-radius: 3px 3px 0 0;
  border-color: #555;
  background: #4b4b4b;
  font-size: 12px;
}
.doc-tab small { font-size: 10px; }
.doc-dot { width: 6px; height: 6px; box-shadow: none; }
.tab-add {
  width: 25px;
  height: 25px;
  min-height: 25px;
  border-radius: 0;
}
.workspace-modes { display: none !important; }
.stage-scroller {
  grid-row: 3;
  place-items: center;
  padding: 48px;
  background: radial-gradient(circle at center, #2d2d2d, #242424 75%);
  overflow: auto;
}
#editorCanvas {
  box-shadow: 0 18px 34px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.35);
}
.statusbar {
  grid-row: 4;
  height: 22px;
  min-height: 22px;
  padding: 0 8px;
  border-top: 1px solid #1f1f1f;
  background: #393939;
  color: #c8c8c8;
  font-size: 11px;
}
.inspector {
  border-left: 1px solid #1f1f1f;
  background: #3f3f3f;
  padding: 4px;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.inspector-controlbar { display: none !important; }
.panel {
  border-radius: 0;
  border: 1px solid #313131;
  background: #474747;
  padding: 0;
  box-shadow: none;
}
.panel-title {
  min-height: 24px;
  margin: 0;
  padding: 0 7px;
  gap: 4px;
  background: #383838;
  border-bottom: 1px solid #2e2e2e;
  color: #dcdcdc;
  font-size: 12px;
}
.panel-title strong { font-size: 12px; font-weight: 600; }
.panel-tag { display: none; }
.panel-collapse {
  height: 20px;
  min-height: 20px;
  padding: 0 5px;
  border-radius: 0;
  background: #4b4b4b;
}
.panel label {
  margin: 5px 7px;
  gap: 3px;
  font-size: 11px;
  color: #c6c6c6;
}
.panel input,
.panel select,
.panel textarea {
  background: #303030;
  border-color: #555;
  color: #e0e0e0;
  padding: 3px 5px;
  font-size: 12px;
}
.panel input[type="range"] { height: 18px; }
.panel input[type="color"] { min-height: 24px; height: 24px; }
.grid2, .grid3 { gap: 5px; padding: 0 6px; }
.layer-actions,
.layer-pro-actions,
.selection-actions,
.shape-actions,
.transform-actions {
  gap: 5px;
  padding: 0 6px 6px;
}
.layer-actions button,
.layer-pro-actions button,
.selection-actions button,
.shape-actions button,
.transform-actions button,
.mini-actions button {
  min-height: 24px;
  padding: 1px 6px;
  font-size: 11px;
  border-radius: 2px;
}
.layers-list {
  max-height: 250px;
  padding: 4px;
  gap: 1px;
  overflow-y: auto;
  background: #3f3f3f;
}
.layer-item {
  grid-template-columns: 27px minmax(0, 1fr) auto;
  gap: 6px;
  padding: 4px 5px;
  border-radius: 0;
  border: 1px solid transparent;
  background: #505050;
}
.layer-item:hover { background: #585858; }
.layer-item.active {
  border-color: #777;
  background: #666;
}
.layer-thumb,
.layer-thumb-wrap {
  width: 25px;
  height: 25px;
  border-radius: 0;
}
.layer-name { font-size: 12px; }
.layer-kind { font-size: 10px; color: #c8c8c8; }
.vis-toggle { padding: 1px 5px; min-height: 20px; }
.layer-badges { gap: 2px; margin-top: 1px; }
.layer-badge { border-radius: 2px; padding: 0 3px; font-size: 8px; }
.text-panel textarea { min-height: 64px; border-radius: 2px; }
.soft-sep { margin: 6px 0; border-top-color: #333; }
.hint,
.compact-note p {
  margin: 5px 7px;
  font-size: 11px;
  line-height: 1.25;
  color: #b8b8b8;
}
#btnSelectSubject {
  min-height: 28px;
  width: calc(100% - 14px);
  margin: 0 7px 5px;
  border-radius: 2px;
  box-shadow: none;
}
.perf-stats {
  margin: 5px 6px;
  gap: 3px;
}
.perf-stats div {
  grid-template-columns: 70px 1fr;
  padding: 3px 5px;
  border-radius: 0;
  background: #3f3f3f;
}
.perf-stats span,
.perf-stats strong { font-size: 10px; }
.modal-card { border-radius: 0; background: #444; }
.command-item,
.shortcut-grid div { border-radius: 0; background: #4b4b4b; }
@media (max-width: 1180px) {
  .topbar { flex-wrap: nowrap; min-height: 29px; }
  .menu-strip { order: initial; width: auto; }
  .workspace { grid-template-columns: 34px minmax(0, 1fr); }
  .inspector {
    position: fixed;
    right: 0;
    top: 29px;
    bottom: 22px;
    width: 310px;
    transform: translateX(calc(100% - 18px));
    transition: transform .16s ease;
    z-index: 30;
    box-shadow: -12px 0 24px rgba(0,0,0,.35);
  }
  .inspector:hover,
  .inspector:focus-within,
  .inspector.is-open { transform: translateX(0); }
}
@media (max-width: 760px) {
  html, body { overflow: hidden; }
  .app-shell { height: 100vh; min-height: 100vh; grid-template-rows: 29px 1fr; }
  .topbar { flex-direction: row; align-items: center; overflow-x: auto; }
  .top-actions { display: none; }
  .workspace { min-height: 0; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: 1fr; }
  .toolrail { flex-direction: column; overflow: hidden; border-right: 1px solid #1e1e1e; border-bottom: 0; }
  .stage-toolbar { overflow-x: auto; }
  .stage-scroller { padding: 28px; place-items: center; }
  .document-tabs { flex-wrap: nowrap; }
}


/* v2.0.0 — UI Pro compacta, mais próxima de Photopea/Photoshop */
:root {
  --bg: #262626;
  --panel: #454545;
  --panel-2: #505050;
  --line: #2b2b2b;
  --text: #dedede;
  --muted: #b7b7b7;
  --accent: #f2b705;
  --accent-2: #75d5ff;
  --toolbar: #474747;
  --rail: #343434;
  --work: #282828;
}
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}
button, .file-button, select, input, textarea {
  font-family: Arial, Helvetica, sans-serif;
}
button, .file-button {
  background: #4c4c4c;
  color: #ddd;
  border: 1px solid #5d5d5d;
  border-radius: 1px;
  min-height: 22px;
  padding: 1px 7px;
  box-shadow: none !important;
}
button:hover, .file-button:hover {
  background: #5b5b5b;
  border-color: #747474;
}
button:active { transform: none; }
.app-shell {
  grid-template-rows: 29px minmax(0, 1fr) !important;
  height: 100vh;
  background: #252525;
}
.topbar {
  height: 29px !important;
  min-height: 29px !important;
  padding: 0 5px !important;
  gap: 4px !important;
  border-bottom: 1px solid #282828 !important;
  background: #454545 !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
}
.brand {
  min-width: 0 !important;
  width: 23px !important;
  margin-right: 2px !important;
  flex: 0 0 23px !important;
  overflow: hidden !important;
}
.brand-mark {
  width: 19px !important;
  height: 19px !important;
  border-radius: 3px !important;
  font-size: 12px !important;
  box-shadow: none !important;
}
.brand strong, .brand small { display: none !important; }
.version-badge {
  top: 1px !important;
  right: 4px !important;
  font-size: 9px !important;
  color: rgba(255,255,255,.32) !important;
}
.menu-strip {
  flex: 1 1 auto !important;
  height: 29px !important;
  display: flex !important;
  align-items: stretch !important;
  gap: 0 !important;
  overflow: hidden !important;
  min-width: 0 !important;
}
.menu-root {
  height: 29px !important;
  min-height: 29px !important;
  padding: 0 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #d6d6d6 !important;
  font-size: 13px !important;
  line-height: 29px !important;
  font-weight: 400 !important;
}
.menu-root:hover,
.menu-group:focus-within .menu-root {
  background: #5b5b5b !important;
  color: #fff !important;
}
.menu-popover {
  top: 29px !important;
  border-radius: 0 !important;
  background: #464646 !important;
  border: 1px solid #262626 !important;
  padding: 3px !important;
  box-shadow: 0 16px 30px rgba(0,0,0,.46) !important;
}
.menu-popover button {
  border: 0 !important;
  min-height: 24px !important;
  background: transparent !important;
  text-align: left !important;
  border-radius: 0 !important;
  font-size: 12px !important;
  color: #e1e1e1 !important;
}
.menu-popover button:hover { background: #5d5d5d !important; }
.top-actions {
  flex: 0 0 auto !important;
  gap: 3px !important;
  padding-right: 30px !important;
  white-space: nowrap !important;
}
.top-actions button,
.top-actions .file-button {
  height: 23px !important;
  min-height: 23px !important;
  padding: 0 8px !important;
  font-size: 12px !important;
  border-radius: 2px !important;
  background: #505050 !important;
}
#btnCommandPalette, #btnShortcuts, #btnExportAVIF { display: none !important; }
.workspace {
  grid-template-columns: 32px minmax(0, 1fr) 302px !important;
  min-height: 0 !important;
  background: var(--work) !important;
}
.toolrail {
  width: 32px !important;
  min-width: 32px !important;
  padding: 2px 1px !important;
  gap: 1px !important;
  border-right: 1px solid #202020 !important;
  background: var(--rail) !important;
  overflow: hidden !important;
  scrollbar-width: none !important;
  display: flex !important;
  flex-direction: column !important;
}
.toolrail::-webkit-scrollbar { width: 0 !important; height: 0 !important; }
.tool {
  width: 29px !important;
  height: 25px !important;
  min-height: 25px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #343434 !important;
  color: #d7d7d7 !important;
  font-size: 14px !important;
  line-height: 1 !important;
  display: grid !important;
  place-items: center !important;
}
.tool:hover { background: #4e4e4e !important; }
.tool.active {
  background: #595959 !important;
  color: #fff !important;
  box-shadow: inset 2px 0 0 var(--accent) !important;
}
.tool span { display: none !important; }
.stage-wrap {
  display: grid !important;
  grid-template-rows: 30px 27px minmax(0, 1fr) 22px !important;
  background: #282828 !important;
  min-width: 0 !important;
  overflow: hidden !important;
}
.stage-toolbar {
  grid-row: 1 !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 2px 5px !important;
  border-bottom: 1px solid #333 !important;
  background: var(--toolbar) !important;
  gap: 6px !important;
  overflow: hidden !important;
  align-items: center !important;
}
.tool-options,
.zoom-actions {
  gap: 6px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}
.tool-options { flex: 1 1 auto !important; min-width: 0 !important; }
.zoom-actions { flex: 0 0 auto !important; }
.tool-options label,
.zoom-actions span {
  font-size: 12px !important;
  color: #d1d1d1 !important;
  gap: 4px !important;
}
.tool-options input[type="range"] { width: 82px !important; }
.tool-options input[type="number"] { width: 52px !important; height: 22px !important; padding: 1px 4px !important; }
.tool-options input[type="color"] { width: 25px !important; height: 21px !important; padding: 0 !important; }
.stage-toolbar select,
.stage-toolbar input[type="number"] {
  height: 22px !important;
  padding: 1px 5px !important;
  border-radius: 1px !important;
  background: #303030 !important;
  border-color: #5a5a5a !important;
  color: #e2e2e2 !important;
  font-size: 12px !important;
}
.zoom-actions button {
  height: 23px !important;
  min-height: 23px !important;
  padding: 0 7px !important;
  border-radius: 1px !important;
}
#btnToggleInspector { display: none !important; }
.document-tabs {
  grid-row: 2 !important;
  height: 27px !important;
  min-height: 27px !important;
  padding: 0 4px !important;
  gap: 3px !important;
  background: #303030 !important;
  border-bottom: 1px solid #202020 !important;
  overflow: hidden !important;
}
.doc-tab {
  height: 25px !important;
  min-height: 25px !important;
  min-width: 150px !important;
  padding: 0 9px !important;
  border-radius: 3px 3px 0 0 !important;
  border-color: #555 !important;
  background: #4b4b4b !important;
  font-size: 12px !important;
}
.doc-tab small { font-size: 10px !important; }
.tab-add {
  height: 25px !important;
  width: 25px !important;
  min-height: 25px !important;
  border-radius: 0 !important;
}
.workspace-modes { display: none !important; }
.stage-scroller {
  grid-row: 3 !important;
  padding: 42px !important;
  place-items: center !important;
  overflow: auto !important;
  background: radial-gradient(circle at center, #303030 0, #252525 75%) !important;
}
#editorCanvas {
  box-shadow: 0 18px 34px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.45) !important;
}
.statusbar {
  grid-row: 4 !important;
  height: 22px !important;
  min-height: 22px !important;
  padding: 0 8px !important;
  background: #3a3a3a !important;
  border-top: 1px solid #202020 !important;
  color: #c5c5c5 !important;
  font-size: 11px !important;
}
.inspector {
  position: relative !important;
  border-left: 1px solid #202020 !important;
  background: #3c3c3c !important;
  padding: 0 4px 4px !important;
  gap: 4px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
.inspector-controlbar { display: none !important; }
.inspector-tabs {
  height: 27px;
  min-height: 27px;
  display: flex;
  align-items: stretch;
  gap: 1px;
  background: #303030;
  border-bottom: 1px solid #242424;
  margin: 0 -4px 4px;
  padding: 2px 3px 0;
  overflow: hidden;
}
.inspector-tabs button {
  flex: 1 1 0;
  min-width: 0;
  height: 25px;
  min-height: 25px;
  padding: 0 4px;
  border-radius: 2px 2px 0 0;
  border: 1px solid transparent;
  background: transparent;
  color: #bdbdbd;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inspector-tabs button:hover { background: #494949; color: #fff; }
.inspector-tabs button.active {
  background: #4d4d4d;
  border-color: #303030;
  color: #fff;
}
.inspector > section.panel { display: none !important; }
.inspector[data-tab="layers"] > section.panel:nth-of-type(1),
.inspector[data-tab="layers"] > section.panel:nth-of-type(2),
.inspector[data-tab="layers"] > section.panel:nth-of-type(6),
.inspector[data-tab="paint"] > section.panel:nth-of-type(3),
.inspector[data-tab="text"] > section.panel:nth-of-type(4),
.inspector[data-tab="vector"] > section.panel:nth-of-type(5),
.inspector[data-tab="adjust"] > section.panel:nth-of-type(7),
.inspector[data-tab="raw"] > section.panel:nth-of-type(8),
.inspector[data-tab="select"] > section.panel:nth-of-type(9),
.inspector[data-tab="export"] > section.panel:nth-of-type(10),
.inspector[data-tab="actions"] > section.panel:nth-of-type(11),
.inspector[data-tab="batch"] > section.panel:nth-of-type(12),
.inspector[data-tab="panorama"] > section.panel:nth-of-type(13),
.inspector[data-tab="precision"] > section.panel:nth-of-type(14),
.inspector[data-tab="scripts"] > section.panel:nth-of-type(15),
.inspector[data-tab="perf"] > section.panel:nth-of-type(16),
.inspector[data-tab="perf"] > section.panel:nth-of-type(17),
.inspector[data-tab="perf"] > section.panel:nth-of-type(18) {
  display: block !important;
}
.panel {
  border-radius: 0 !important;
  border: 1px solid #303030 !important;
  background: #484848 !important;
  padding: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  flex: 0 0 auto !important;
}
.panel + .panel { margin-top: 4px !important; }
.panel-title {
  min-height: 24px !important;
  margin: 0 !important;
  padding: 0 7px !important;
  background: #393939 !important;
  border-bottom: 1px solid #303030 !important;
  color: #e1e1e1 !important;
  font-size: 12px !important;
}
.panel-title strong { font-size: 12px !important; font-weight: 600 !important; }
.panel-tag, .panel-collapse { display: none !important; }
.panel label {
  margin: 5px 7px !important;
  gap: 3px !important;
  font-size: 11px !important;
  color: #c7c7c7 !important;
}
.panel input, .panel select, .panel textarea {
  border-radius: 1px !important;
  background: #303030 !important;
  border-color: #565656 !important;
  color: #e2e2e2 !important;
  padding: 3px 5px !important;
  font-size: 12px !important;
}
.panel input[type="range"] { height: 17px !important; }
.panel input[type="color"] { min-height: 22px !important; height: 22px !important; }
.grid2, .grid3 {
  gap: 5px !important;
  padding: 0 6px !important;
}
.layer-actions,
.layer-pro-actions,
.selection-actions,
.shape-actions,
.transform-actions {
  gap: 5px !important;
  padding: 0 6px 6px !important;
}
.layer-actions button,
.layer-pro-actions button,
.selection-actions button,
.shape-actions button,
.transform-actions button,
.mini-actions button,
#btnTextAutoBox,
#btnApplyAdjustmentPreset,
#btnRemoveBgAuto,
#btnSelectSubject {
  min-height: 23px !important;
  padding: 1px 6px !important;
  font-size: 11px !important;
  border-radius: 1px !important;
}
.layers-list {
  max-height: calc(100vh - 282px) !important;
  min-height: 168px !important;
  padding: 3px !important;
  gap: 1px !important;
  overflow-y: auto !important;
  background: #3f3f3f !important;
}
.layer-item {
  grid-template-columns: 26px minmax(0, 1fr) auto !important;
  gap: 6px !important;
  padding: 4px 5px !important;
  border-radius: 0 !important;
  border: 1px solid transparent !important;
  background: #505050 !important;
}
.layer-item:hover { background: #5a5a5a !important; }
.layer-item.active { background: #666 !important; border-color: #777 !important; }
.layer-thumb,
.layer-thumb-wrap { width: 25px !important; height: 25px !important; border-radius: 0 !important; }
.layer-name { font-size: 12px !important; }
.layer-kind { font-size: 10px !important; color: #c9c9c9 !important; }
.vis-toggle { min-height: 20px !important; padding: 1px 5px !important; }
.hint, .compact-note p {
  margin: 5px 7px !important;
  color: #b8b8b8 !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
}
.soft-sep { margin: 6px 0 !important; border-top-color: #333 !important; }
.text-panel textarea { min-height: 68px !important; resize: vertical !important; }
.perf-stats {
  margin: 5px 6px !important;
  gap: 3px !important;
}
.perf-stats div {
  grid-template-columns: 70px 1fr !important;
  padding: 3px 5px !important;
  border-radius: 0 !important;
  background: #3f3f3f !important;
}
.install-banner {
  top: auto !important;
  bottom: 8px !important;
  right: 8px !important;
  left: auto !important;
  transform: none !important;
  padding: 5px 7px !important;
  border-radius: 2px !important;
  background: #3d3d3d !important;
  font-size: 12px !important;
}
.modal-card { border-radius: 0 !important; background: #444 !important; }
.command-item, .shortcut-grid div { border-radius: 0 !important; background: #4b4b4b !important; }
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 32px minmax(0, 1fr) !important; }
  .inspector {
    position: fixed !important;
    right: 0 !important;
    top: 29px !important;
    bottom: 22px !important;
    width: 304px !important;
    transform: translateX(calc(100% - 16px)) !important;
    transition: transform .16s ease !important;
    z-index: 30 !important;
    box-shadow: -12px 0 24px rgba(0,0,0,.35) !important;
  }
  .inspector:hover,
  .inspector:focus-within,
  .inspector.is-open { transform: translateX(0) !important; }
  .top-actions .file-button,
  .top-actions #btnSaveProject,
  .top-actions #btnExportJPG,
  .top-actions #btnExportWEBP { display: none !important; }
}
@media (max-width: 760px) {
  .app-shell { height: 100vh !important; min-height: 100vh !important; grid-template-rows: 29px minmax(0, 1fr) !important; }
  .topbar { flex-direction: row !important; align-items: center !important; overflow-x: auto !important; }
  .menu-root { padding: 0 7px !important; }
  .top-actions { display: none !important; }
  .workspace { min-height: 0 !important; grid-template-columns: 32px minmax(0, 1fr) !important; grid-template-rows: 1fr !important; }
  .toolrail { flex-direction: column !important; border-right: 1px solid #202020 !important; border-bottom: 0 !important; }
  .stage-toolbar { overflow-x: auto !important; }
  .stage-scroller { padding: 26px !important; place-items: center !important; }
}


/* v2.0.0 — correção da topbar e toolbar esquerda sem rolagem */
.menu-group.is-open .menu-popover {
  display: grid !important;
  gap: 3px !important;
  z-index: 1000 !important;
}
.menu-group.is-open .menu-root {
  background: #5b5b5b !important;
  color: #fff !important;
}
body.inspector-hidden .workspace {
  grid-template-columns: 38px minmax(0, 1fr) 0 !important;
}
body.inspector-hidden .inspector {
  display: none !important;
}
.workspace {
  grid-template-columns: 38px minmax(0, 1fr) 302px !important;
}
.toolrail {
  width: 38px !important;
  min-width: 38px !important;
  padding: 2px 1px !important;
  gap: 0 !important;
  overflow: hidden !important;
}
.tool {
  width: 36px !important;
  height: 27px !important;
  min-height: 27px !important;
  font-size: 15px !important;
}
.tool.active {
  box-shadow: inset 3px 0 0 var(--accent) !important;
}
@media (max-height: 760px) {
  .tool { height: 25px !important; min-height: 25px !important; font-size: 14px !important; }
  .toolrail { gap: 0 !important; }
}


/* v2.0.0 — tema moderno com layout clássico Photopea/Photoshop */
:root {
  --bg: #25262b;
  --panel: #3f424b;
  --panel-2: #4a4e59;
  --line: #25272d;
  --text: #eceef3;
  --muted: #bec4ce;
  --accent: #f2b705;
  --accent-2: #69d8ff;
  --toolbar: #3d4048;
  --rail: #33363d;
  --work: #282a30;
}
.app-shell { grid-template-rows: 30px minmax(0,1fr) !important; }
.topbar {
  height: 30px !important;
  min-height: 30px !important;
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 0 6px !important;
  gap: 4px !important;
  overflow: visible !important;
  background: linear-gradient(180deg,#464a54,#3a3d45) !important;
  border-bottom: 1px solid #202228 !important;
  z-index: 2000 !important;
}
.brand { flex: 0 0 24px !important; width: 24px !important; min-width: 24px !important; margin-right: 4px !important; pointer-events: none !important; }
.brand-mark { width: 19px !important; height: 19px !important; border-radius: 4px !important; font-size: 12px !important; background: linear-gradient(135deg,var(--accent),var(--accent-2)) !important; }
.brand strong,.brand small { display: none !important; }
.legacy-actions,.top-actions {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  right: 0 !important;
}
.menu-strip {
  flex: 1 1 auto !important;
  height: 30px !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  overflow: visible !important;
  min-width: 0 !important;
  position: relative !important;
  z-index: 2100 !important;
}
.menu-group { position: relative !important; flex: 0 0 auto !important; }
.menu-root {
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #e1e5ec !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 30px !important;
  min-width: auto !important;
}
.menu-root:hover,.menu-group.is-open .menu-root,.menu-group:focus-within .menu-root { background: rgba(255,255,255,.12) !important; color: #fff !important; }
.menu-popover {
  position: absolute !important;
  top: 30px !important;
  left: 0 !important;
  z-index: 3000 !important;
  min-width: 240px !important;
  max-width: 320px !important;
  display: none !important;
  gap: 1px !important;
  padding: 4px !important;
  border-radius: 3px !important;
  background: #444852 !important;
  border: 1px solid #1e2026 !important;
  box-shadow: 0 18px 36px rgba(0,0,0,.5) !important;
}
.menu-group.is-open .menu-popover { display: grid !important; }
.menu-popover button {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  min-height: 25px !important;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 2px !important;
  background: transparent !important;
  color: #ecedf1 !important;
  font-size: 12px !important;
  text-align: left !important;
}
.menu-popover button:hover { background: rgba(255,255,255,.13) !important; }
.version-badge {
  position: absolute !important;
  right: 7px !important;
  top: 8px !important;
  font-size: 10px !important;
  opacity: .5 !important;
  color: #e8e8e8 !important;
  pointer-events: none !important;
  z-index: 2200 !important;
}
.workspace { grid-template-columns: 46px minmax(0,1fr) 306px !important; background: var(--work) !important; }
body.inspector-hidden .workspace { grid-template-columns: 46px minmax(0,1fr) 0 !important; }
.toolrail {
  width: 46px !important;
  min-width: 46px !important;
  padding: 4px 3px !important;
  gap: 2px !important;
  overflow: hidden !important;
  background: linear-gradient(180deg,#383b43,#30333a) !important;
  border-right: 1px solid #202228 !important;
  scrollbar-width: none !important;
}
.toolrail::-webkit-scrollbar { width:0 !important; height:0 !important; }
.tool {
  width: 39px !important;
  height: 31px !important;
  min-height: 31px !important;
  padding: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 3px !important;
  background: transparent !important;
  color: #dce0e7 !important;
  display: grid !important;
  place-items: center !important;
  font-size: 0 !important;
  line-height: 1 !important;
}
.tool:hover { background: rgba(255,255,255,.10) !important; border-color: rgba(255,255,255,.08) !important; }
.tool.active { background: #515762 !important; border-color: #6c737f !important; box-shadow: inset 3px 0 0 var(--accent) !important; }
.tool span { display:none !important; }
.tool svg { width: 19px !important; height: 19px !important; display: block !important; }
.tool svg path,.tool svg rect,.tool svg circle,.tool svg ellipse,.tool svg line,.tool svg polygon {
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.tool[data-tool="text"] svg path { stroke-width: 2.1; }
.tool[data-tool="polygon"],.tool[data-tool="star"],.tool[data-tool="arrow"],.tool[data-tool="dodge"],.tool[data-tool="burn"] { display: none !important; }
.stage-wrap { grid-template-rows: 30px 27px minmax(0,1fr) 22px !important; background: #282a30 !important; }
.stage-toolbar {
  grid-row: 1 !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 3px 7px !important;
  background: #3f424b !important;
  border-bottom: 1px solid #292c32 !important;
  overflow: hidden !important;
}
.document-tabs {
  grid-row: 2 !important;
  height: 27px !important;
  min-height: 27px !important;
  padding: 0 5px !important;
  background: #30333a !important;
  border-bottom: 1px solid #202228 !important;
}
.inspector { background: #383b43 !important; border-left: 1px solid #202228 !important; }
.inspector-tabs { background: #30333a !important; }
.inspector-tabs button.active { background: #4c515c !important; }
.panel { background: #424650 !important; border-color: #2e3138 !important; }
.panel-title { background: #33363d !important; border-bottom-color: #2a2d33 !important; }
.layers-list { background: #3b3f48 !important; }
.layer-item { background: #4a4f5a !important; }
.layer-item.active { background: #5b626f !important; }
@media (max-height: 760px) {
  .tool { height: 29px !important; min-height: 29px !important; }
  .tool svg { width:18px !important; height:18px !important; }
}
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 46px minmax(0,1fr) !important; }
  .inspector { top: 30px !important; }
}
@media (max-width: 760px) {
  .topbar { overflow-x: auto !important; overflow-y: visible !important; }
  .menu-root { padding: 0 8px !important; }
  .workspace { grid-template-columns: 46px minmax(0,1fr) !important; }
}


/* v2.0.0 — layout clássico + tema moderno consistente */
:root {
  --bg: #22252b;
  --panel: #383c46;
  --panel-2: #454a56;
  --line: #252931;
  --text: #edf0f5;
  --muted: #b8c0cc;
  --accent: #f2b705;
  --accent-2: #65d7ff;
  --menu-bg: #3f444e;
  --menu-hover: rgba(255,255,255,.13);
  --dialog-bg: #3b404b;
  --field-bg: #242831;
}
.app-shell { grid-template-rows: 30px minmax(0,1fr) !important; }
.topbar { background: linear-gradient(180deg,#414651,#363a43) !important; border-bottom:1px solid #20242b !important; color:var(--text) !important; }
.brand-mark { box-shadow:none !important; }
.menu-root { color:#eceff5 !important; }
.menu-popover,
.context-menu,
[role="menu"] {
  background: var(--menu-bg) !important;
  border: 1px solid #20242b !important;
  color: var(--text) !important;
  border-radius: 6px !important;
  box-shadow: 0 20px 42px rgba(0,0,0,.48) !important;
}
.menu-popover button,
.context-menu button,
[role="menu"] button {
  color: var(--text) !important;
  border-radius: 4px !important;
  min-height: 27px !important;
}
.menu-popover button:hover,
.context-menu button:hover,
[role="menu"] button:hover { background: var(--menu-hover) !important; }
.menu-popover kbd,
.command-item kbd { color:#f7d45b !important; background: rgba(0,0,0,.22) !important; border: 1px solid rgba(255,255,255,.08) !important; border-radius: 4px !important; padding: 1px 5px !important; }
.workspace { grid-template-columns: 52px minmax(0,1fr) 312px !important; }
body.inspector-hidden .workspace { grid-template-columns: 52px minmax(0,1fr) 0 !important; }
.toolrail {
  width:52px !important; min-width:52px !important; padding:5px 4px !important; gap:2px !important;
  background: linear-gradient(180deg,#363b44,#2f333b) !important;
  overflow:hidden !important;
}
.tool {
  width:44px !important; height:32px !important; min-height:32px !important;
  border-radius:4px !important; color:#e7ebf2 !important;
}
.tool:hover { background: rgba(255,255,255,.10) !important; }
.tool.active { background:#545b68 !important; border-color:#778190 !important; box-shadow: inset 3px 0 0 var(--accent) !important; }
.tool svg { width:20px !important; height:20px !important; }
.tool svg path,.tool svg rect,.tool svg circle,.tool svg ellipse,.tool svg line,.tool svg polygon { stroke-width:1.8 !important; stroke:currentColor !important; fill:none !important; }
.tool[data-tool="text"] svg path { stroke-width:2.2 !important; }
.tool[data-tool="polygon"],.tool[data-tool="star"],.tool[data-tool="arrow"],.tool[data-tool="dodge"],.tool[data-tool="burn"] { display:none !important; }
.stage-toolbar,
.document-tabs,
.statusbar,
.inspector-controlbar,
.inspector-tabs { background:#333842 !important; border-color:#22262d !important; }
.stage-toolbar button,
.stage-toolbar .file-button,
.zoom-actions button,
.inspector-controlbar button,
.panel button,
.theme-dialog-actions button,
.modal-title button {
  background: linear-gradient(180deg,#4b515e,#3a3f49) !important;
  border:1px solid #272b33 !important;
  border-radius:5px !important;
  color:var(--text) !important;
  box-shadow:none !important;
}
.stage-toolbar button:hover,
.inspector-controlbar button:hover,
.panel button:hover,
.theme-dialog-actions button:hover,
.modal-title button:hover { border-color:#66707d !important; background:#525966 !important; }
.primary-action,
#themeDialogOk,
#btnSelectSubject { background: linear-gradient(180deg,#f5c634,#d49d00) !important; color:#16181d !important; border-color:#f5c634 !important; font-weight:700 !important; }
select,
input[type="text"], input[type="search"], input[type="number"], input[type="range"], textarea,
.theme-dialog-input {
  background: var(--field-bg) !important;
  border: 1px solid #20242b !important;
  color: var(--text) !important;
  border-radius:5px !important;
}
input[type="color"] { border-radius:5px !important; }
.inspector { background:#343943 !important; }
.inspector-tabs { padding:4px !important; gap:3px !important; }
.inspector-tabs button { border-radius:4px !important; padding:6px 7px !important; color:#cfd5df !important; }
.inspector-tabs button.active { background:#505763 !important; color:#fff !important; border-color:#6b7482 !important; }
.panel { background:#3d424d !important; border-color:#272c34 !important; border-radius:7px !important; box-shadow:none !important; padding:8px !important; }
.panel-title { background:#343943 !important; color:#f3f5f9 !important; border-bottom:1px solid #292e36 !important; margin:-8px -8px 8px !important; padding:6px 8px !important; border-radius:7px 7px 0 0 !important; }
.layer-item { background:#474d59 !important; border-color:#2b3038 !important; border-radius:5px !important; }
.layer-item.active { background:#596272 !important; border-color:#d2a010 !important; }
.modal-backdrop { background: rgba(11,13,17,.62) !important; backdrop-filter: blur(6px) !important; z-index: 5000 !important; }
.modal-card,
.theme-dialog-card {
  background: var(--dialog-bg) !important;
  color: var(--text) !important;
  border: 1px solid #20242b !important;
  border-radius: 8px !important;
  box-shadow: 0 24px 58px rgba(0,0,0,.58) !important;
  padding: 0 !important;
}
.modal-title { background:#30353e !important; border-bottom:1px solid #242932 !important; margin:0 !important; padding:8px 10px !important; border-radius:8px 8px 0 0 !important; }
.modal-title strong { font-size:13px !important; }
.shortcuts-card,.command-card,.theme-dialog-card { overflow:hidden !important; }
.shortcut-grid, .command-results, .theme-dialog-body, .theme-dialog-input, .theme-dialog-actions { margin:10px !important; }
.shortcut-grid div,
.command-item { background:#444a55 !important; border:1px solid #2a2f37 !important; border-radius:6px !important; color:var(--text) !important; }
.command-item:hover,.command-item.active { background:#535b69 !important; border-color:var(--accent) !important; }
.command-search { width:calc(100% - 20px) !important; margin:10px !important; }
.theme-dialog-body { line-height:1.45; color:#e9edf4; white-space:normal; }
.theme-dialog-input { width:calc(100% - 20px) !important; margin-top:0 !important; padding:8px 9px !important; }
.theme-dialog-actions { display:flex; justify-content:flex-end; gap:8px; padding-bottom:10px; }
.theme-dialog-actions .hidden { display:none !important; }
.install-banner { background:var(--dialog-bg) !important; border-color:#20242b !important; border-radius:8px !important; color:var(--text) !important; }
@media (max-height: 760px) {
  .tool { height:30px !important; min-height:30px !important; }
  .tool svg { width:19px !important; height:19px !important; }
}

/* v2.0.0 — Seção 13: painel de camadas profissional */
.pro-layers-panel {
  padding: 0 !important;
  overflow: hidden !important;
}
.pro-layer-title {
  margin: 0 !important;
  border-radius: 7px 7px 0 0 !important;
}
.pro-layer-mini-actions button {
  min-width: 25px !important;
  min-height: 22px !important;
  padding: 0 6px !important;
  font-size: 12px !important;
}
.layer-mixer-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 64px 58px;
  gap: 5px;
  padding: 6px;
  background: #353a43;
  border-bottom: 1px solid #252a31;
}
.layer-mixer-row select,
.layer-mixer-row input {
  height: 24px !important;
  min-height: 24px !important;
  width: 100% !important;
  padding: 2px 5px !important;
  font-size: 11px !important;
}
.layer-mixer-row label {
  margin: 0 !important;
  color: #cfd5df !important;
  display: grid !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px !important;
  font-size: 10px !important;
}
.layer-quick-row {
  display: grid;
  grid-template-columns: 1fr 1fr .7fr;
  gap: 5px;
  padding: 0 6px 6px;
  background: #353a43;
  border-bottom: 1px solid #252a31;
}
.layer-quick-row button { min-height: 23px !important; font-size: 11px !important; padding: 1px 5px !important; }
.pro-layers-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 1px !important;
  padding: 4px !important;
  max-height: 340px !important;
  min-height: 150px !important;
  background: #30343c !important;
  overflow-y: auto !important;
}
.pro-layer-item {
  display: grid !important;
  grid-template-columns: 21px 44px 30px minmax(0, 1fr) 23px !important;
  min-height: 49px !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 3px 4px !important;
  border: 1px solid transparent !important;
  background: #444a55 !important;
  color: #ecf0f6 !important;
  border-radius: 3px !important;
  cursor: default !important;
  user-select: none !important;
}
.pro-layer-item:hover { background: #4b525e !important; }
.pro-layer-item.active {
  background: #596272 !important;
  border-color: #e0ab12 !important;
  box-shadow: inset 0 0 0 1px rgba(242,183,5,.22) !important;
}
.pro-layer-item.dragging { opacity: .45 !important; }
.pro-layer-item.drop-target { outline: 2px solid #75d5ff !important; outline-offset: -2px !important; }
.pro-layer-item.group-layer { background: #3e4b58 !important; }
.pro-layer-item.clipped { border-left: 3px solid #75d5ff !important; }
.pro-eye,
.layer-lock-toggle,
.mask-thumb-button {
  width: 21px !important;
  min-width: 21px !important;
  height: 23px !important;
  min-height: 23px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  background: transparent !important;
  border: 0 !important;
  color: #d9dee8 !important;
  font-size: 13px !important;
}
.layer-lock-toggle { color: #b9c1cf !important; font-size: 11px !important; }
.pro-thumb-wrap {
  width: 42px !important;
  height: 42px !important;
  position: relative !important;
  border: 1px solid #1f232a !important;
  background: #777 !important;
}
.pro-thumb-wrap .layer-thumb {
  width: 42px !important;
  height: 42px !important;
  border-radius: 0 !important;
  border: 0 !important;
  background-size: cover !important;
  background-position: center !important;
  image-rendering: auto !important;
}
.layer-type-glyph {
  position: absolute;
  right: -1px;
  bottom: -1px;
  min-width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  font: 700 9px/1 Arial, sans-serif;
  color: #fff;
  background: rgba(28,31,38,.92);
  border: 1px solid rgba(255,255,255,.25);
}
.mask-thumb-button {
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  border: 1px solid #1f232a !important;
  background: #111 !important;
}
.mask-thumb-button img { width: 26px; height: 26px; display:block; object-fit: cover; }
.mask-thumb-placeholder {
  width: 28px;
  height: 28px;
  border: 1px dashed rgba(255,255,255,.08);
  background: rgba(0,0,0,.08);
}
.layer-main { min-width: 0; display: grid; gap: 1px; }
.pro-layer-item .layer-name {
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: #f1f4f8 !important;
}
.pro-layer-item .layer-kind {
  font-size: 10px !important;
  color: #c3cad6 !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.pro-layer-item .layer-badges { display: flex !important; gap: 3px !important; min-height: 13px; }
.pro-layer-item .layer-badge {
  font-size: 8px !important;
  line-height: 12px !important;
  height: 13px !important;
  padding: 0 4px !important;
  border-radius: 2px !important;
  color: #e4e9f1 !important;
  background: rgba(0,0,0,.24) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}
.pro-layer-actions,
.pro-layer-pro-actions {
  padding: 6px !important;
  background: #353a43 !important;
  border-top: 1px solid #252a31 !important;
}
.layer-context-menu {
  position: fixed;
  z-index: 6000;
  min-width: 190px;
  display: grid;
  gap: 2px;
  padding: 5px;
  background: #3b414b;
  border: 1px solid #20252d;
  box-shadow: 0 16px 42px rgba(0,0,0,.55);
  border-radius: 6px;
}
.layer-context-menu button {
  text-align: left !important;
  justify-content: flex-start !important;
  background: transparent !important;
  border: 0 !important;
  color: #edf1f7 !important;
  border-radius: 4px !important;
  min-height: 25px !important;
  padding: 4px 8px !important;
}
.layer-context-menu button:hover { background: #535b69 !important; }
.layer-context-menu button.danger { color: #ffb7c5 !important; }
.hidden.layer-context-menu { display: none !important; }


/* v2.0.0 — Seção 14: Opções de Mesclagem / Layer Style */
.layer-style-card { width:min(980px, calc(100vw - 32px)) !important; max-height:min(86vh, 820px) !important; padding:0 !important; overflow:hidden !important; }
.layer-style-body { display:grid; grid-template-columns:160px minmax(0,1fr); min-height:420px; max-height:calc(86vh - 108px); overflow:hidden; }
.layer-style-presets { border-right:1px solid #252a33; background:#30343d; padding:10px; display:flex; flex-direction:column; gap:8px; }
.layer-style-presets button { text-align:left; padding:8px 10px !important; border-radius:6px !important; }
.layer-style-grid { overflow:auto; padding:10px; display:grid; gap:8px; background:#3a3f49; }
.fx-block { border:1px solid #252a33; background:#333842; border-radius:8px; padding:9px; }
.fx-block > .checkline { margin:0 0 8px 0 !important; color:#f1f4f8 !important; font-weight:700; }
.grid4 { display:grid; grid-template-columns:repeat(5, minmax(92px,1fr)); gap:7px; align-items:end; }
.grid4 label { margin:0 !important; font-size:11px !important; color:#c6ccd7 !important; }
.grid4 input[type="number"], .grid4 select { height:26px !important; padding:4px 6px !important; border-radius:4px !important; }
.grid4 input[type="color"] { width:100%; height:26px; padding:0; border:1px solid #20242b; background:#1f232b; }
.layer-style-actions { border-top:1px solid #252a33; background:#30343d; margin:0 !important; padding:9px 10px !important; display:grid !important; grid-template-columns:auto 1fr auto auto; align-items:center; }
.layer-style-actions button { padding:7px 12px !important; border-radius:6px !important; }
.layer-badge { text-transform:none; }
.layer-badge.fx-badge, .layer-badge:has(+ .fx-never) { color:#ffd24a; }
@media (max-width:760px) {
  .layer-style-body { grid-template-columns:1fr; }
  .layer-style-presets { border-right:0; border-bottom:1px solid #252a33; flex-direction:row; flex-wrap:wrap; }
  .grid4 { grid-template-columns:repeat(2, minmax(110px,1fr)); }
}


/* v2.1.0 — Objeto Inteligente */
.smart-object-actions {
  margin-top: 8px;
  border: 1px solid rgba(242,183,5,.18);
  background: linear-gradient(180deg, rgba(242,183,5,.08), rgba(255,255,255,.025));
  border-radius: 10px;
  padding: 8px;
}
.smart-object-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.smart-object-title strong { font-size: 12px; color: var(--text); }
.smart-object-title span { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.smart-object-actions button { min-height: 28px; padding: 5px 7px; font-size: 11px; }
.layer-badge { text-transform: uppercase; }
.layer-item .layer-type-glyph { font-size: 11px; font-weight: 900; }
.layer-item.smart-object-layer .layer-thumb-wrap { outline: 1px solid rgba(242,183,5,.65); }

/* v2.8.0 — ferramentas clássicas compactas */
.toolrail {
  width: 44px !important;
  padding: 4px 4px !important;
  gap: 2px !important;
  overflow: hidden !important;
  align-items: center !important;
}
.tool {
  width: 34px !important;
  height: 26px !important;
  min-height: 26px !important;
  border-radius: 5px !important;
  padding: 0 !important;
}
.tool svg { width: 18px !important; height: 18px !important; }
.tool.active { box-shadow: inset 0 0 0 1px rgba(242,183,5,.85), 0 0 0 1px rgba(242,183,5,.25) !important; }
.workspace { grid-template-columns: 44px minmax(0,1fr) 306px !important; }
.stage-toolbar { min-height: 34px !important; padding: 3px 7px !important; }
.tool-options { gap: 6px !important; }
.tool-options label { font-size: 11px !important; }
.tool-options input[type="color"] { width: 25px !important; height: 22px !important; }
.tool-options input[type="range"] { width: 82px !important; }
.zoom-actions button { min-height: 24px !important; padding: 3px 7px !important; border-radius: 5px !important; }
@media (max-height: 830px) {
  .tool { height: 24px !important; min-height: 24px !important; }
  .tool svg { width: 17px !important; height: 17px !important; }
  .toolrail { gap: 1px !important; }
}
@media (max-width: 760px) {
  .toolrail { width: auto !important; flex-direction: row !important; overflow-x: auto !important; }
  .tool { width: 34px !important; min-width: 34px !important; }
  .workspace { grid-template-columns: 1fr !important; }
}


/* v2.8.0 — seleção inteligente avançada */
.smart-selection-actions button {
  min-height: 32px;
  font-weight: 650;
}
#targetColorPicker {
  width: 44px;
  height: 24px;
  padding: 0;
  border-radius: 5px;
}


/* v2.8.0 — ações e automação */
.actions-panel .action-record-bar {
  display:flex; align-items:center; gap:8px;
  padding:6px 8px; margin:0 0 8px;
  background:rgba(0,0,0,.18); border:1px solid rgba(255,255,255,.07); border-radius:6px;
  color:var(--muted); font-size:12px;
}
.action-record-dot {
  width:10px; height:10px; border-radius:999px;
  background:#6d7480; box-shadow:0 0 0 2px rgba(255,255,255,.04);
}
.action-record-dot.recording {
  background:#ff4e64;
  box-shadow:0 0 0 3px rgba(255,78,100,.12), 0 0 16px rgba(255,78,100,.55);
  animation: ipe-record-pulse 1.1s ease-in-out infinite;
}
@keyframes ipe-record-pulse { 50% { opacity:.55; transform:scale(.92); } }
.action-step-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:10px 0 6px; color:var(--muted); font-size:12px; }
.action-steps-list {
  min-height:110px; max-height:260px; overflow:auto;
  background:rgba(0,0,0,.16); border:1px solid rgba(255,255,255,.07); border-radius:6px; padding:5px;
}
.action-step-item {
  display:grid; grid-template-columns:24px minmax(0,1fr) auto; gap:6px; align-items:center;
  padding:5px 6px; margin-bottom:4px;
  background:#474d59; border:1px solid #2b3038; border-radius:5px;
}
.action-step-item span { color:#f4c842; font-size:11px; font-weight:700; }
.action-step-item strong { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:12px; }
.action-step-item small { grid-column:2; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:var(--muted); font-size:10px; margin-top:-4px; }
.action-step-item button { grid-column:3; grid-row:1 / span 2; width:24px; min-height:24px !important; padding:0 !important; color:#ff8b9a !important; }
.actions-panel select,
.actions-panel input[type="text"] { width:100%; }


/* v2.8.0 — processamento em lote */
.batch-panel .batch-drop {
  border: 1px dashed rgba(242,183,5,.42);
  background: linear-gradient(180deg, rgba(242,183,5,.08), rgba(0,208,255,.035));
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 4px;
  cursor: pointer;
  margin-bottom: 8px;
}
.batch-panel .batch-drop:hover,
.batch-panel .batch-drop.dragover { border-color: var(--accent); background: rgba(242,183,5,.13); }
.batch-panel .batch-drop small { color: var(--muted); }
.batch-file-list { display: grid; gap: 5px; max-height: 160px; overflow: auto; margin-top: 8px; }
.batch-file-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.035); font-size: 12px; }
.batch-file-item strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 650; }
.batch-file-item small { color: var(--muted); }
.batch-progress { height: 7px; border-radius: 999px; overflow: hidden; background: #080a0f; border: 1px solid var(--line); margin-top: 8px; }
#batchProgressBar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .18s ease; }


/* v2.8.0 — Panorama */
.panorama-panel .batch-drop-zone {
  min-height: 74px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 4px;
  border: 1px dashed rgba(255,255,255,.22) !important;
  background: linear-gradient(180deg, rgba(242,183,5,.08), rgba(0,208,255,.05)) !important;
}
.panorama-panel .batch-drop-zone.dragover {
  border-color: var(--accent) !important;
  background: rgba(242,183,5,.16) !important;
}
.panorama-panel .batch-file-item small {
  display: block;
  color: #c8c8c8;
  opacity: .85;
}
.panorama-panel .panel-tag { opacity: .75; }


/* v2.8.0 — Camera Raw / Revelação */
.raw-panel .grid2 { gap: 6px; }
.raw-panel input[type="range"] { width: 100%; }
.raw-panel .raw-actions button { min-height: 27px; }
.raw-panel .panel-tag { opacity: .78; }
.raw-panel select { width: 100%; }


/* v2.9.0 — precisão: réguas, guias e medição */
.precision-panel .selection-actions button { min-height: 28px; }
.precision-panel .hint { color: #d7d7d7; }
.tool[data-tool="measure"] svg { stroke-width: 1.9; }


/* v3.0 Scripts / Plugins */
.scripts-panel .hint { margin: 6px 10px 10px; line-height: 1.35; }
#scriptInfo { margin: 6px 10px 4px; }
#scriptSelect { width: calc(100% - 20px); margin: 0 10px 10px; }
#scriptsList { max-height: 240px; overflow: auto; }
.script-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; padding: 8px 10px; border-top: 1px solid #3a3a3a; }
.script-row:first-child { border-top: 0; }
.script-row .script-meta { display: flex; flex-direction: column; gap: 3px; }
.script-row .script-meta strong { font-size: 12px; color: #fff; }
.script-row .script-meta small { font-size: 11px; color: #bdbdbd; line-height: 1.3; }
.script-row .script-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.script-chip { font-size: 10px; padding: 2px 6px; border: 1px solid #4a4a4a; border-radius: 999px; background: #404040; color: #e8e8e8; }

/* v3.1 QA Final */
.inspector[data-tab="perf"] > section.qa-final-panel,
.inspector[data-tab="perf"] > section.performance-panel {
  display: block !important;
}
.qa-output {
  margin: 8px 10px 10px;
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  background: #2f2f2f;
  border: 1px solid #242424;
  color: #e8e8e8;
  border-radius: 4px;
  padding: 8px;
  font-size: 11px;
  line-height: 1.45;
}
.qa-output .ok { color: #9cffb3; }
.qa-output .warn { color: #ffd16a; }
.qa-output .fail { color: #ff8a8a; }


/* v3.8.0 — Toolbar agrupada estilo editor profissional */
.grouped-toolrail {
  width: 42px !important;
  min-width: 42px !important;
  padding: 4px 3px !important;
  overflow: visible !important;
  background: #2f353f !important;
  border-right: 1px solid #1f242c !important;
  z-index: 30 !important;
}
.toolrail-inner {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  width: 100% !important;
  overflow: visible !important;
}
.tool-group {
  position: relative !important;
  width: 34px !important;
  height: 34px !important;
  flex: 0 0 34px !important;
}
.grouped-toolrail .tool {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 5px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #d7dde8 !important;
  display: grid !important;
  place-items: center !important;
  position: relative !important;
  box-shadow: none !important;
}
.grouped-toolrail .tool svg {
  width: 20px !important;
  height: 20px !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 1.85 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
.grouped-toolrail .tool:hover,
.grouped-toolrail .tool-group.is-open > .tool-main {
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.08) !important;
}
.grouped-toolrail .tool.active,
.grouped-toolrail .tool-group.active-group > .tool-main {
  background: linear-gradient(180deg, #5d6574, #404754) !important;
  border-color: rgba(242,183,5,.65) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 var(--accent) !important;
}
.tool-corner {
  position: absolute !important;
  right: 2px !important;
  bottom: 0 !important;
  font-size: 8px !important;
  color: rgba(255,255,255,.58) !important;
  line-height: 1 !important;
  pointer-events: none !important;
}
.tool-flyout {
  position: absolute !important;
  left: 39px !important;
  top: -4px !important;
  min-width: 178px !important;
  max-width: 224px !important;
  display: none !important;
  grid-template-columns: repeat(4, 34px) !important;
  gap: 5px !important;
  padding: 8px !important;
  background: #383d47 !important;
  border: 1px solid #596170 !important;
  box-shadow: 0 18px 44px rgba(0,0,0,.38) !important;
  z-index: 100 !important;
  border-radius: 8px !important;
}
.tool-group:hover > .tool-flyout,
.tool-group:focus-within > .tool-flyout,
.tool-group.is-open > .tool-flyout {
  display: grid !important;
}
.tool-flyout-title {
  grid-column: 1 / -1 !important;
  color: #f5f7fb !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .02em !important;
  padding: 0 2px 3px !important;
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
  margin-bottom: 1px !important;
}
.grouped-toolrail .tool-flyout .tool {
  display: grid !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  background: #454b56 !important;
  border: 1px solid rgba(255,255,255,.06) !important;
}
.grouped-toolrail .tool-flyout .tool:hover { background: #555d6b !important; }
.grouped-toolrail .tool-flyout .tool.active { background: #606879 !important; border-color: var(--accent) !important; }
.grouped-toolrail .tool-flyout .tool span:not(.tool-corner) { display: none !important; }
.grouped-toolrail .tool[data-tool="polygon"],
.grouped-toolrail .tool[data-tool="star"],
.grouped-toolrail .tool[data-tool="arrow"],
.grouped-toolrail .tool[data-tool="dodge"],
.grouped-toolrail .tool[data-tool="burn"] { display: grid !important; }
@media (max-height: 760px) {
  .grouped-toolrail { width: 38px !important; min-width: 38px !important; padding: 3px 2px !important; }
  .tool-group { width: 32px !important; height: 32px !important; flex-basis: 32px !important; }
  .grouped-toolrail .tool { width: 32px !important; min-width: 32px !important; height: 32px !important; min-height: 32px !important; }
  .grouped-toolrail .tool svg { width: 18px !important; height: 18px !important; }
  .toolrail-inner { gap: 2px !important; }
}
@media (max-width: 760px) {
  .grouped-toolrail { width: auto !important; min-width: 0 !important; overflow-x: auto !important; overflow-y: visible !important; }
  .toolrail-inner { flex-direction: row !important; }
  .tool-flyout { left: 0 !important; top: 38px !important; }
}


/* v3.3 context menus */
.context-menu {
  min-width: 220px !important;
  max-width: 300px !important;
  padding: 6px !important;
  background: #303030 !important;
  border: 1px solid #555 !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.55) !important;
  border-radius: 8px !important;
  z-index: 999 !important;
}
.context-menu .context-menu-label {
  padding: 5px 8px 6px !important;
  color: #d9d9d9 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
}
.context-menu button {
  width: 100% !important;
  display: flex !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 7px 9px !important;
  background: transparent !important;
  color: #f1f1f1 !important;
  border: 0 !important;
  border-radius: 5px !important;
  font-size: 12px !important;
  text-align: left !important;
}
.context-menu button:hover { background: #4a4a4a !important; color: #fff !important; }
.context-menu button.danger { color: #ff9aa8 !important; }
.context-menu button kbd { color: #bbb; font-size: 10px; font-weight: 500; }
.context-sep { height: 1px; background: #4a4a4a; margin: 5px 4px; }
.canvas-context-hot { outline: 1px solid rgba(242,183,5,.45); }

/* v3.4 — menu superior reorganizado */
.menu-popover .menu-sep {
  height: 1px;
  margin: 5px 7px;
  background: rgba(255,255,255,.13);
  border: 0;
}
.menu-popover button kbd {
  margin-left: auto;
  opacity: .72;
}
.menu-group .menu-popover {
  min-width: 214px;
}
.menu-root {
  white-space: nowrap;
}


/* v3.8.0 — Barra de opções contextual */
.contextual-options {
  min-width: 0;
  overflow: hidden;
  flex-wrap: nowrap !important;
}
.tool-options-title {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-right: 1px solid rgba(255,255,255,.12);
  color: #f3c34a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.tool-options label, .tool-options #brushSizeLabel {
  transition: opacity .12s ease, transform .12s ease;
}
.tool-options [data-option-hidden="1"] {
  display: none !important;
}
.tool-options [data-option-core="1"] {
  display: inline-flex;
}
.contextual-options-empty {
  color: #9ca3af;
  font-size: 12px;
}
@media (max-width: 980px) {
  .contextual-options { flex-wrap: wrap !important; }
  .tool-options-title { width: 100%; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 4px; }
}

/* v3.8.0 — Ícones modernos próprios: linha consistente, acento Ipê e menos cara de cópia */
.grouped-toolrail {
  --tool-bg-a: #343944;
  --tool-bg-b: #272b34;
  --tool-border: #4a5060;
}
.tool-group[data-tool-group="core"] { --tool-accent: #f2b705; }
.tool-group[data-tool-group="selection"] { --tool-accent: #83a8ff; }
.tool-group[data-tool-group="paint"] { --tool-accent: #f6c445; }
.tool-group[data-tool-group="retouch"] { --tool-accent: #73d0ff; }
.tool-group[data-tool-group="vector"] { --tool-accent: #c99cff; }
.tool-group[data-tool-group="color"] { --tool-accent: #5ee3c2; }
.tool-group[data-tool-group="crop"] { --tool-accent: #ff9a62; }
.tool-group[data-tool-group="nav"] { --tool-accent: #b7c4d6; }

.grouped-toolrail .tool.modern-tool-icon {
  position: relative !important;
  border-radius: 10px !important;
  border: 1px solid color-mix(in srgb, var(--tool-accent, #f2b705) 18%, #353946 82%) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,0)),
    linear-gradient(180deg, var(--tool-bg-a), var(--tool-bg-b)) !important;
  color: #d7dde8 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 1px 0 rgba(0,0,0,.35) !important;
  transition: background .14s ease, border-color .14s ease, color .14s ease, transform .12s ease, box-shadow .14s ease !important;
}
.grouped-toolrail .tool.modern-tool-icon:hover,
.grouped-toolrail .tool-group.is-open > .tool-main.modern-tool-icon {
  color: #ffffff !important;
  border-color: color-mix(in srgb, var(--tool-accent, #f2b705) 54%, #596171 46%) !important;
  background:
    radial-gradient(circle at 30% 18%, color-mix(in srgb, var(--tool-accent, #f2b705) 22%, transparent) 0%, transparent 52%),
    linear-gradient(180deg, #414957, #2d333e) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 0 0 1px rgba(255,255,255,.025), 0 8px 18px rgba(0,0,0,.24) !important;
}
.grouped-toolrail .tool.modern-tool-icon:active { transform: translateY(1px) scale(.98) !important; }
.grouped-toolrail .tool.modern-tool-icon.active,
.grouped-toolrail .tool-group.active-group > .tool-main.modern-tool-icon {
  color: #ffffff !important;
  border-color: var(--tool-accent, #f2b705) !important;
  background:
    radial-gradient(circle at 26% 18%, color-mix(in srgb, var(--tool-accent, #f2b705) 38%, transparent) 0%, transparent 58%),
    linear-gradient(180deg, color-mix(in srgb, var(--tool-accent, #f2b705) 21%, #343944), #252b36) !important;
  box-shadow:
    inset 3px 0 0 var(--tool-accent, #f2b705),
    inset 0 1px 0 rgba(255,255,255,.12),
    0 0 0 1px color-mix(in srgb, var(--tool-accent, #f2b705) 38%, transparent),
    0 8px 20px rgba(0,0,0,.22) !important;
}
.grouped-toolrail .tool svg.ipe-modern-icon {
  width: 21px !important;
  height: 21px !important;
  display: block !important;
  overflow: visible !important;
  stroke: currentColor !important;
  stroke-width: 1.85 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  fill: none !important;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.35));
}
.grouped-toolrail .tool svg.ipe-modern-icon path,
.grouped-toolrail .tool svg.ipe-modern-icon rect,
.grouped-toolrail .tool svg.ipe-modern-icon circle,
.grouped-toolrail .tool svg.ipe-modern-icon ellipse,
.grouped-toolrail .tool svg.ipe-modern-icon line,
.grouped-toolrail .tool svg.ipe-modern-icon polygon {
  stroke: currentColor !important;
  stroke-width: inherit !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  fill: none !important;
}
.grouped-toolrail .tool svg.ipe-modern-icon [opacity] { opacity: var(--icon-soft-opacity, .38); }
.grouped-toolrail .tool .tool-corner {
  color: color-mix(in srgb, var(--tool-accent, #f2b705) 75%, #fff 25%) !important;
  font-size: 8px !important;
  right: 3px !important;
  bottom: 2px !important;
  opacity: .88 !important;
}
.grouped-toolrail .tool-flyout {
  border-color: color-mix(in srgb, var(--tool-accent, #f2b705) 28%, #3a3f4b 72%) !important;
  box-shadow: 0 18px 46px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.05) !important;
}
.grouped-toolrail .tool-flyout .tool.modern-tool-icon {
  grid-template-columns: 30px minmax(0, 1fr) !important;
  justify-content: start !important;
  color: #dbe2ee !important;
}
.grouped-toolrail .tool-flyout .tool.modern-tool-icon svg.ipe-modern-icon {
  width: 20px !important;
  height: 20px !important;
  justify-self: center;
}
.grouped-toolrail .tool-flyout .tool.modern-tool-icon span:not(.tool-corner) {
  display: block !important;
  color: #d8dde8 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: .01em;
}
@media (max-height: 820px) {
  .grouped-toolrail .tool svg.ipe-modern-icon { width: 19px !important; height: 19px !important; }
}


/* v3.7 UX final polish */
.statusbar { gap: 12px; }
#uxHint { color: #b8c2d5; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
.ipe-tooltip { position: fixed; z-index: 999999; max-width: 320px; padding: 8px 10px; border: 1px solid rgba(242,183,5,.42); border-radius: 10px; background: rgba(17,19,24,.96); color: #f5f5f5; box-shadow: 0 10px 30px rgba(0,0,0,.42); font-size: 12px; line-height: 1.32; pointer-events: none; backdrop-filter: blur(10px); }
.ipe-tooltip strong { display:block; margin-bottom: 2px; color: #ffd76b; font-size: 12px; }
.ipe-tooltip small { display:block; color: #aeb7c7; }
.ipe-tooltip.hidden { display: none; }
body.ipe-compact-panels .inspector-controlbar { padding: 6px; gap: 4px; }
body.ipe-compact-panels .inspector-tabs { gap: 4px; padding: 6px; }
body.ipe-compact-panels .inspector-tabs button { padding: 5px 7px; font-size: 11px; }
body.ipe-compact-panels .panel { padding-top: 6px; }
body.ipe-compact-panels .panel-title { margin-bottom: 5px; }
body.ipe-compact-panels .panel label { margin: 5px 0; }
.tool-group.keyboard-focus .tool-main, .tool:focus-visible, .menu-root:focus-visible, .menu-popover button:focus-visible, .context-menu button:focus-visible { outline: 2px solid rgba(242,183,5,.95); outline-offset: 2px; }
.tool-flyout-title::after { content: '  •  clique para escolher'; color: #8791a1; font-weight: 400; font-size: 10px; }
@media (max-width: 1200px) { #uxHint { display:none; } .menu-root { padding-inline: 7px; } }


/* v3.8.0 — Hotfix visual: flyouts legíveis e painel direito sem fileira gigante de letras */
.inspector-panel-switcher {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px 8px !important;
  border-bottom: 1px solid #242a33 !important;
  background: #303641 !important;
}
.inspector-panel-switcher label {
  margin: 0 !important;
  color: #c6cedb !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
}
.inspector-panel-select {
  min-width: 0 !important;
  width: 100% !important;
  height: 30px !important;
  border-radius: 8px !important;
  border: 1px solid #4d5665 !important;
  background: #1f252e !important;
  color: #eef3fb !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  outline: none !important;
}
.inspector-panel-select:focus {
  border-color: #f2b705 !important;
  box-shadow: 0 0 0 2px rgba(242,183,5,.18) !important;
}
.inspector-tabs {
  display: none !important;
}

.grouped-toolrail .tool-flyout {
  min-width: 218px !important;
  max-width: 242px !important;
  width: max-content !important;
  grid-template-columns: minmax(198px, 1fr) !important;
  gap: 5px !important;
  padding: 9px !important;
  border-radius: 10px !important;
}
.grouped-toolrail .tool-flyout-title {
  padding: 0 4px 7px !important;
  margin-bottom: 3px !important;
}
.grouped-toolrail .tool-flyout-title::after {
  content: '  •  escolha uma ferramenta' !important;
  color: #9aa4b4 !important;
  font-size: 10px !important;
  font-weight: 400 !important;
}
.grouped-toolrail .tool-flyout .tool,
.grouped-toolrail .tool-flyout .tool.modern-tool-icon {
  width: 100% !important;
  min-width: 0 !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 10px 0 7px !important;
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr) !important;
  column-gap: 8px !important;
  align-items: center !important;
  justify-items: start !important;
  place-items: center start !important;
  text-align: left !important;
}
.grouped-toolrail .tool-flyout .tool svg,
.grouped-toolrail .tool-flyout .tool svg.ipe-modern-icon {
  width: 19px !important;
  height: 19px !important;
  justify-self: center !important;
}
.grouped-toolrail .tool-flyout .tool span:not(.tool-corner),
.grouped-toolrail .tool-flyout .tool.modern-tool-icon span:not(.tool-corner) {
  display: block !important;
  width: 100% !important;
  max-width: 170px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: #e8edf6 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}
.grouped-toolrail .tool-flyout .tool .tool-corner {
  display: none !important;
}
.grouped-toolrail .tool-flyout .tool:hover span:not(.tool-corner),
.grouped-toolrail .tool-flyout .tool.active span:not(.tool-corner) {
  color: #fff !important;
}
body.ipe-compact-panels .inspector-panel-switcher { padding: 5px 7px !important; }
body.ipe-compact-panels .inspector-panel-select { height: 28px !important; font-size: 11px !important; }


/* v3.8.0 — Biblioteca ampliada de fontes e pincéis */
#fontFamily, #brushPreset { min-width: 170px; }
.brush-panel select optgroup, #fontFamily optgroup { font-weight: 700; color: #f4c84a; background: #202531; }
.brush-panel select option, #fontFamily option { color: #f5f7fb; background: #202531; }
