:root {
  --bg: #0e0f13;
  --bg2: #15161c;
  --bg3: #1c1e26;
  --bg4: #252833;
  --line: #2a2d38;
  --line2: #353947;
  --tx: #e8e9ef;
  --tx2: #a3a7b7;
  --tx3: #6f7486;
  --ac: #7c5cff;
  --ac2: #9a80ff;
  --acbg: rgba(124, 92, 255, .14);
  --danger: #ff5c7a;
  --ok: #2fd18b;
  --stage: #2a2c35;
  --r: 8px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--tx); font: 13px/1.4 var(--font); overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }
input, select, textarea { font: inherit; color: var(--tx); }
svg { display: block; flex-shrink: 0; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #33364300; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*:hover::-webkit-scrollbar-thumb { background-color: #3a3e4c; }
::-webkit-scrollbar-track { background: transparent; }

#app { display: grid; grid-template-rows: 52px 1fr; height: 100vh; }

/* ---------- topo ---------- */
.topbar { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--bg2); border-bottom: 1px solid var(--line); min-width: 0; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 14px; white-space: nowrap; margin-right: 6px; }
.brand b { color: var(--ac2); font-weight: 700; }
.brand-logo { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #ff6b6b, #7c5cff); box-shadow: 0 4px 14px rgba(124, 92, 255, .35); }
.menu-group { display: flex; gap: 2px; }
.sep { width: 1px; height: 22px; background: var(--line2); margin: 0 4px; }
.spacer { flex: 1; }
.tbtn { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--tx2); white-space: nowrap; }
.tbtn:hover { background: var(--bg4); color: var(--tx); }
.ibtn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--tx2); }
.ibtn:hover:not(:disabled) { background: var(--bg4); color: var(--tx); }
.ibtn.sm { width: 28px; height: 28px; }
.project-name { margin-left: 8px; background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 6px 10px; width: 240px; font-weight: 600; color: var(--tx); }
.project-name:hover { border-color: var(--line2); }
.project-name:focus { outline: none; border-color: var(--ac); background: var(--bg); }
.save-state { color: var(--tx3); font-size: 12px; margin-right: 6px; white-space: nowrap; }
.btn-primary { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 16px; border: 0; border-radius: 8px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #8b6dff, #6a48ff); box-shadow: 0 4px 16px rgba(124, 92, 255, .35); white-space: nowrap; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary.danger { background: var(--danger); box-shadow: 0 4px 16px rgba(255, 92, 122, .3); }

@media (max-width: 1250px) { .tbtn span { display: none; } .project-name { width: 160px; } }
@media (max-width: 900px) { .save-state, .brand span { display: none; } }

/* ---------- layout ---------- */
.main { display: grid; grid-template-columns: 76px 300px 1fr 304px; min-height: 0; }
.rail { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; overflow-y: auto; }
.rail-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 2px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--tx3); font-size: 11px; font-weight: 500; }
.rail-btn svg { width: 21px; height: 21px; }
.rail-btn:hover { color: var(--tx); background: var(--bg3); }
.rail-btn.active { color: #fff; background: var(--acbg); }
.rail-btn.active svg { color: var(--ac2); }

.panel { background: var(--bg2); overflow-y: auto; min-height: 0; }
.panel.left { border-right: 1px solid var(--line); padding: 14px; }
.panel.right { border-left: 1px solid var(--line); }
.panel h3 { margin: 18px 2px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--tx3); font-weight: 600; }
.panel h3:first-child { margin-top: 2px; }
.hint { color: var(--tx3); font-size: 12px; margin: 14px 2px 4px; }
.hint.top { margin-top: 0; margin-bottom: 12px; }
.empty { color: var(--tx3); font-size: 12px; padding: 14px; border: 1px dashed var(--line2); border-radius: var(--r); text-align: center; line-height: 1.5; }
.span2 { grid-column: span 2; }

.grid { display: grid; gap: 8px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 4px 8px; border-radius: var(--r);
  background: var(--bg3); border: 1px solid transparent; color: var(--tx2); cursor: grab; user-select: none; transition: .12s; }
.tile svg { width: 40px; height: 36px; color: #b9a8ff; }
.g4 .tile svg { width: 24px; height: 24px; color: var(--tx); }
.tile span { font-size: 11px; }
.g4 .tile span { font-size: 10px; color: var(--tx3); }
.tile:hover { border-color: var(--ac); background: var(--bg4); color: var(--tx); transform: translateY(-1px); }
.tile:active { cursor: grabbing; }

.text-presets { display: flex; flex-direction: column; gap: 8px; }
.text-tile { padding: 14px; border-radius: var(--r); background: var(--bg3); border: 1px solid transparent; cursor: grab; user-select: none; color: var(--tx); transition: .12s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-tile:hover, .combo-tile:hover { border-color: var(--ac); background: var(--bg4); }
.combo-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--r); background: var(--bg3); border: 1px solid transparent; cursor: grab; user-select: none; }

.button-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; border-radius: var(--r); background: #f3f3f7; border: 2px solid transparent; cursor: grab; user-select: none; transition: .12s; }
.btn-tile:nth-child(1), .btn-tile:nth-child(4), .btn-tile:nth-child(8) { background: #f3f3f7; }
.btn-tile img { max-width: 100%; height: 38px; object-fit: contain; pointer-events: none; }
.btn-tile span { font-size: 11px; color: #4b5060; font-weight: 500; }
.btn-tile:hover { border-color: var(--ac); transform: translateY(-1px); }

/* predefinições salvas */
.snip-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.snip-list .empty { grid-column: span 2; text-align: left; }
.snip-tile { display: flex; flex-direction: column; border-radius: var(--r); background: var(--bg3); border: 1px solid var(--line); cursor: grab; user-select: none; overflow: hidden; transition: .12s; }
.snip-tile:hover { border-color: var(--ac); transform: translateY(-1px); }
.snip-img { height: 66px; display: grid; place-items: center; padding: 6px; background: #f3f3f7; }
.snip-img.dark { background: #2b2e3a; }
.snip-img img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.snip-foot { display: flex; align-items: center; gap: 2px; padding: 3px 3px 3px 8px; }
.snip-foot span { flex: 1; min-width: 0; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tx2); }
.snip-foot .ib { width: 22px; height: 22px; opacity: 0; }
.snip-tile:hover .snip-foot .ib { opacity: 1; }
.snip-cta { padding: 10px 14px 0; margin: 0; }
.snip-cta .sbtn { width: 100%; justify-content: center; border-style: dashed; color: var(--ac2); }
.snip-cta .sbtn:hover { background: var(--acbg); border-color: var(--ac); }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 22px 14px; border: 1.5px dashed var(--line2); border-radius: 12px;
  background: linear-gradient(180deg, rgba(124, 92, 255, .06), transparent); cursor: pointer; transition: .15s; color: var(--tx2); }
.dropzone svg { width: 28px; height: 28px; color: var(--ac2); }
.dropzone b { color: var(--tx); font-size: 13px; }
.dropzone span { font-size: 11.5px; color: var(--tx3); }
.dropzone:hover, .dropzone.over { border-color: var(--ac); background: var(--acbg); }

.tpl-list { display: flex; flex-direction: column; gap: 10px; }
.tpl-card { display: flex; gap: 10px; padding: 8px; border-radius: 10px; background: var(--bg3); border: 1px solid var(--line); }
.tpl-card:hover { border-color: var(--line2); }
.tpl-thumb { position: relative; width: 74px; height: 96px; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: #fff; display: grid; place-items: center; }
.tpl-thumb img { width: 100%; height: 100%; object-fit: contain; background: #e9e9ef; }
.tpl-thumb .badge { position: absolute; left: 4px; bottom: 4px; font-size: 9.5px; font-weight: 600; padding: 2px 5px; border-radius: 4px; background: rgba(14, 15, 19, .8); color: #fff; }
.tpl-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.tpl-info b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-info small { color: var(--tx3); font-size: 11px; line-height: 1.35; }
.tpl-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }

.uploads { margin-top: 12px; }
.img-tile { position: relative; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: repeating-conic-gradient(#2a2c36 0 25%, #22242d 0 50%) 0 0/16px 16px; cursor: grab; border: 1px solid var(--line); }
.img-tile img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.img-tile .ib { position: absolute; top: 4px; right: 4px; opacity: 0; background: rgba(14, 15, 19, .85); }
.img-tile:hover .ib { opacity: 1; }
.img-tile:hover { border-color: var(--ac); }

.row-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.sbtn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 7px; border: 1px solid var(--line2); background: var(--bg3); color: var(--tx); font-size: 12px; font-weight: 500; white-space: nowrap; }
.sbtn:hover { background: var(--bg4); border-color: #454a5b; }
.sbtn.sm { height: 26px; padding: 0 8px; font-size: 11.5px; }
.sbtn.primary { background: var(--ac); border-color: var(--ac); color: #fff; }
.sbtn.primary:hover { background: #8d71ff; }
.ib { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--tx2); }
.ib:hover { background: var(--bg4); color: var(--tx); }
.ib.sm { width: 26px; height: 26px; }
.ib.danger:hover { color: var(--danger); background: rgba(255, 92, 122, .12); }
.ib.on { color: var(--ac2); background: var(--acbg); }

/* páginas */
.page-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.page-item { border-radius: 10px; padding: 6px; background: var(--bg3); border: 2px solid transparent; cursor: pointer; }
.page-item:hover { border-color: var(--line2); }
.page-item.active { border-color: var(--ac); }
.pi-thumb { width: 100%; background: #fff; border-radius: 4px; overflow: hidden; display: grid; place-items: center; max-height: 220px; }
.pi-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pi-empty { width: 100%; height: 100%; background: #fff; }
.pi-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; font-weight: 600; font-size: 12px; }
.pi-foot em { font-style: normal; font-size: 9px; padding: 1px 4px; border-radius: 3px; background: var(--acbg); color: var(--ac2); margin-left: 3px; }
.pi-act { display: flex; opacity: 0; transition: .1s; }
.page-item:hover .pi-act { opacity: 1; }
.pi-act button { width: 20px; height: 20px; border: 0; background: transparent; display: grid; place-items: center; color: var(--tx3); border-radius: 4px; padding: 0; }
.pi-act button:hover { background: var(--bg4); color: var(--tx); }

/* camadas */
.layer-list { display: flex; flex-direction: column; gap: 2px; }
.layer { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; border-radius: 7px; cursor: pointer; color: var(--tx2); border: 1px solid transparent; }
.layer:hover { background: var(--bg3); color: var(--tx); }
.layer.active { background: var(--acbg); color: #fff; border-color: rgba(124, 92, 255, .4); }
.layer.hidden-el { opacity: .45; }
.layer .ly-ic { color: var(--tx3); }
.layer.active .ly-ic { color: var(--ac2); }
.layer .ly-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.layer .ly-link { color: var(--ac2); }
.layer button { width: 24px; height: 24px; display: grid; place-items: center; border: 0; background: transparent; color: var(--tx3); border-radius: 5px; padding: 0; opacity: 0; }
.layer:hover button, .layer button.on { opacity: 1; }
.layer button:hover { background: var(--bg4); color: var(--tx); }
.layer button.on { color: var(--ac2); }
.layer.drop-above { box-shadow: inset 0 2px 0 var(--ac); }
.layer.drop-below { box-shadow: inset 0 -2px 0 var(--ac); }

/* ---------- palco ---------- */
.stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--stage);
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .05) 1px, transparent 0); background-size: 22px 22px; }
.stage.drag-over::after { content: 'Solte aqui'; position: absolute; inset: 10px 10px 54px; border: 2px dashed var(--ac); border-radius: 14px; background: rgba(124, 92, 255, .08);
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 15px; pointer-events: none; }
.stage-scroll { flex: 1; overflow: auto; min-height: 0; }
.stage-inner { min-width: 100%; min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 48px; width: max-content; }
.page-wrap { box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 18px 50px rgba(0, 0, 0, .45); background: #fff; line-height: 0; }
.stage-bar { height: 46px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; background: var(--bg2); border-top: 1px solid var(--line); }
.pager, .zoom { display: flex; align-items: center; gap: 4px; color: var(--tx2); font-size: 12.5px; }
.pager span { min-width: 92px; text-align: center; font-weight: 500; }
.zoom-val { min-width: 58px; height: 28px; border: 1px solid var(--line2); border-radius: 6px; background: var(--bg3); font-size: 12px; font-weight: 600; }

/* ---------- propriedades ---------- */
.props-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 10px 14px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.ph-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ph-title b { font-size: 13.5px; white-space: nowrap; }
.ph-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--acbg); color: var(--ac2); }
.ph-actions { display: flex; gap: 2px; }
.name-row { padding: 10px 14px 0; }
.name-row .txt { background: transparent; border-color: transparent; color: var(--tx2); }
.name-row .txt:hover { border-color: var(--line2); }
.locked-note { margin: 10px 14px 0; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 196, 0, .08); color: #ffd25e; font-size: 12px; }
.locked-note .sbtn { margin-left: auto; }

.psec { border-bottom: 1px solid var(--line); padding: 12px 14px 14px; }
.psec-h { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--tx3); margin-bottom: 10px; }
.psec.collapsed .psec-h { margin-bottom: 0; }
.psec.has-link .psec-h span { color: var(--ac2); }
.psec.muted { border-bottom: 0; }
.psec-b { display: flex; flex-direction: column; gap: 8px; }
.prow { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 8px; }
.prow > label { color: var(--tx2); font-size: 12px; }
.pctl { display: flex; gap: 6px; min-width: 0; align-items: center; }
.prow.two .pctl > * { flex: 1; min-width: 0; }
.prow.ratio-row .pctl > .tg { flex: 0 0 26px; }

.txt, select, .num { height: 30px; border-radius: 7px; border: 1px solid var(--line2); background: var(--bg); }
.txt { width: 100%; padding: 0 9px; outline: none; }
textarea.txt { height: auto; padding: 7px 9px; resize: vertical; min-height: 54px; }
.txt.big { height: 38px; font-size: 14px; }
select { width: 100%; padding: 0 6px; outline: none; cursor: pointer; }
select option { background: var(--bg2); color: var(--tx); }
.txt:focus, select:focus, .num:focus-within { border-color: var(--ac); box-shadow: 0 0 0 3px rgba(124, 92, 255, .18); }
.num { display: flex; align-items: center; padding: 0 7px; gap: 4px; min-width: 0; }
.num em { font-style: normal; color: var(--tx3); font-size: 11px; white-space: nowrap; }
.num span { color: var(--tx3); font-size: 11px; }
.num input { width: 100%; min-width: 0; border: 0; background: transparent; outline: none; height: 100%; padding: 0; font-variant-numeric: tabular-nums; }
.num input:disabled { color: var(--tx3); }
.num.sm { width: 74px; flex: 0 0 74px; }
.num input::-webkit-inner-spin-button { opacity: .4; }

.range { display: flex; align-items: center; gap: 8px; width: 100%; }
.range input[type=range] { flex: 1; min-width: 0; accent-color: var(--ac); height: 4px; }

.color-ctl { display: flex; align-items: center; height: 30px; border-radius: 7px; border: 1px solid var(--line2); background: var(--bg); width: 100%; overflow: hidden; }
.color-ctl:focus-within { border-color: var(--ac); }
.color-ctl input[type=color] { width: 30px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; flex-shrink: 0; }
.color-ctl input[type=color]::-webkit-color-swatch-wrapper { padding: 5px; }
.color-ctl input[type=color]::-webkit-color-swatch { border-radius: 5px; border: 1px solid rgba(255, 255, 255, .15); }
.color-ctl input[data-part=hex] { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; text-transform: uppercase; font-variant-numeric: tabular-nums; font-size: 12px; }
.color-ctl .alpha { display: flex; align-items: center; border-left: 1px solid var(--line2); padding: 0 6px; height: 100%; }
.color-ctl .alpha input { width: 32px; border: 0; background: transparent; outline: none; text-align: right; font-size: 12px; }
.color-ctl .alpha input::-webkit-inner-spin-button { display: none; }
.color-ctl .alpha span { color: var(--tx3); font-size: 11px; }

.color-ctl .pick { width: 30px; height: 100%; flex-shrink: 0; display: grid; place-items: center; border: 0; border-left: 1px solid var(--line2); background: transparent; color: var(--tx2); padding: 0; }
.color-ctl .pick:hover { color: var(--tx); background: var(--bg4); }
.color-ctl .pick.on { color: #fff; background: var(--ac); }
.sw-label { font-size: 10.5px; color: var(--tx3); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

/* conta-gotas */
.stage.picking .upper-canvas { cursor: crosshair !important; }
.stage.picking .page-wrap { box-shadow: 0 0 0 2px var(--ac), 0 18px 50px rgba(0, 0, 0, .45); }
.loupe { position: fixed; z-index: 80; pointer-events: none; padding: 6px; border-radius: 12px; background: #1f2129; border: 1px solid var(--line2); box-shadow: 0 14px 36px rgba(0, 0, 0, .55); }
.loupe canvas { display: block; width: 121px; height: 121px; border-radius: 7px; }
.loupe-info { display: flex; align-items: center; gap: 7px; padding: 6px 2px 1px; font: 600 12px var(--font); font-variant-numeric: tabular-nums; }
.loupe-info i { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .25); }
.pick-banner { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 75; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px;
  background: var(--ac); color: #fff; font-size: 12.5px; font-weight: 500; box-shadow: 0 10px 30px rgba(124, 92, 255, .4); pointer-events: none; animation: pop .16s; }
.pick-banner kbd { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .3); color: #fff; }
.pick-banner .muted { opacity: .8; }

.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin-top: 2px; }
.sw { aspect-ratio: 1; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .14); padding: 0; }
.sw:hover { transform: scale(1.12); }

.btn-row { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }
.btn-row .gap { width: 6px; }
.tg { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--line2); background: var(--bg); color: var(--tx2); padding: 0; }
.tg:hover { color: var(--tx); border-color: #4a4f60; }
.tg.on { background: var(--acbg); color: var(--ac2); border-color: rgba(124, 92, 255, .5); }
.btn-row .ib { border: 1px solid var(--line2); background: var(--bg); }

.seg { display: flex; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; }
.seg button { flex: 1; height: 30px; border: 0; background: var(--bg); color: var(--tx2); font-size: 11.5px; border-right: 1px solid var(--line2); }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--bg4); color: var(--tx); }

.switch { position: relative; width: 32px; height: 18px; display: inline-block; text-transform: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--bg4); transition: .15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #c5c8d4; transition: .15s; }
.switch input:checked + span { background: var(--ac); }
.switch input:checked + span::after { transform: translateX(14px); background: #fff; }

.font-sel { font-size: 13px; }
.link-preview { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 9px; border-radius: 7px; background: var(--acbg); color: #cfc4ff; font-size: 11.5px; }
.link-preview span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.info-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 8px; background: var(--bg3); border: 1px solid var(--line); color: var(--ac2); }
.info-card div { display: flex; flex-direction: column; gap: 2px; color: var(--tx); }
.info-card span { color: var(--tx3); font-size: 11.5px; }

.tips { margin: 0; padding-left: 16px; color: var(--tx2); font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
kbd { font: 600 10.5px var(--font); padding: 1px 5px; border-radius: 4px; background: var(--bg4); border: 1px solid var(--line2); border-bottom-width: 2px; color: var(--tx); }

/* ---------- menu de contexto ---------- */
.ctx-menu { position: fixed; z-index: 50; min-width: 230px; padding: 5px; border-radius: 10px; background: #1f2129; border: 1px solid var(--line2); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.ctx-menu button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; font-size: 12.5px; }
.ctx-menu button:hover { background: var(--ac); color: #fff; }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button.danger:hover { background: var(--danger); color: #fff; }
.ctx-menu kbd { background: none; border: 0; color: var(--tx3); font-weight: 500; padding: 0; }
.ctx-menu button:hover kbd { color: rgba(255, 255, 255, .75); }
.ctx-menu hr { border: 0; border-top: 1px solid var(--line2); margin: 4px 2px; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(5, 6, 10, .6); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .12s; }
.modal { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--bg2); border: 1px solid var(--line2); border-radius: 14px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: pop .16s; }
.modal.wide { width: min(760px, 100%); }
.modal h2 { margin: 0 0 8px; font-size: 17px; }
.modal p { margin: 0 0 14px; color: var(--tx2); line-height: 1.5; }
.modal .form { display: flex; flex-direction: column; gap: 12px; }
.modal .form label { display: flex; flex-direction: column; gap: 6px; color: var(--tx2); font-size: 12px; }
.modal .form select { height: 38px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-foot .sbtn { height: 34px; }
.size-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.size-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg3); }
.size-card:hover { border-color: var(--ac); background: var(--acbg); }
.size-card b { font-size: 12px; }
.size-card span { font-size: 11px; color: var(--tx3); }
.sc-shape { height: 64px; max-width: 100%; background: #fff; border-radius: 3px; margin-bottom: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.progress { position: relative; height: 30px; border-radius: 8px; background: var(--bg); overflow: hidden; border: 1px solid var(--line2); }
.progress div { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #6a48ff, #9a80ff); transition: width .2s; }
.progress span { position: relative; display: block; text-align: center; line-height: 28px; font-size: 12px; font-weight: 600; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 10px; background: #262935; border: 1px solid var(--line2); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); font-size: 12.5px; animation: pop .18s; transition: .3s; max-width: 520px; }
.toast.ok { border-color: rgba(47, 209, 139, .5); }
.toast.ok::before { content: '✓  '; color: var(--ok); font-weight: 700; }
.toast.error { border-color: rgba(255, 92, 122, .6); }
.toast.out { opacity: 0; transform: translateY(8px); }

@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1100px) {
  .main { grid-template-columns: 64px 260px 1fr 270px; }
  .rail-btn span { font-size: 9.5px; }
}
