:root {
  --bg: #080808;
  --panel: #111111;
  --panel-2: #181818;
  --line: #262626;
  --line-2: #363636;
  --text: #ececec;
  --muted: #8a8a8a;
  --red: #e5141b;
  --red-dim: #7d0b0f;
  --red-rgb: 229, 20, 27;
  --accent-hover: #ff2a30; --accent-press: #b80f15; /* hover / pressed accent */
  --on-red: #fff;          /* text on the accent colour */
  --bar: #0a0a0a;          /* top bar, rail, status bar */
  --field: #0b0b0b;        /* inputs */
  --stage: #070707;        /* behind the design */
  --dot: #1a1a1a;          /* stage dot grid */
  --check-a: #222; --check-b: #1a1a1a; /* transparency checkerboard */
  --radius: 0px; --radius-lg: 0px; --pill: 0px; --bw: 1px;
  --display: 'Anton', 'Archivo Black', Impact, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.4 var(--sans);
  display: grid;
  grid-template-rows: 56px 1fr 30px;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}
.mono { font-family: var(--mono); letter-spacing: .04em; }
[hidden] { display: none !important; }

/* film grain over everything, like the references */
.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 100; opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 33%{transform:translate(-3%,2%)} 66%{transform:translate(2%,-3%)} 100%{transform:translate(0,0)} }
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }

/* ── top bar ── */
.topbar {
  display: flex; align-items: center; gap: 18px; padding: 0 16px; min-width: 0; /* never wider than the window */
  border-bottom: 1px solid var(--line); background: var(--bar);
}
.brand { display: flex; align-items: baseline; gap: 12px; color: inherit; text-decoration: none; }
.brand:hover .brand-mark em { color: var(--accent-hover); }
.brand-mark { font: 26px/1 var(--display); letter-spacing: .02em; }
.brand-mark em { color: var(--red); font-style: normal; }
.brand-sub { font-size: 10px; color: var(--muted); }
.doc-name {
  flex: 1; max-width: 360px; margin: 0 auto; text-align: center; background: transparent; color: var(--text);
  border: 1px solid transparent; padding: 6px 10px; font-size: 12px; text-transform: uppercase;
}
.doc-name:hover, .doc-name:focus { border-color: var(--line-2); outline: none; }
.top-actions { display: flex; gap: 8px; }

.btn {
  font: 700 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  padding: 10px 14px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 0;
}
.btn:hover { border-color: var(--text); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--red); border-color: var(--red); color: var(--on-red); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary:active { background: var(--accent-press); border-color: var(--accent-press); }
.btn.sm { padding: 7px 10px; }
.btn.block { width: 100%; }
.btn:focus-visible, .rail-btn:focus-visible, .chip:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ── layout ── */
.workspace { --left: 280px; --right: 290px; display: grid; grid-template-columns: 76px var(--left) minmax(0, 1fr) var(--right); min-height: 0; }
body.hide-left .workspace { --left: 0px; }
body.hide-right .workspace { --right: 0px; }
body.hide-left #leftPanel, body.hide-right #inspector { display: none; }
/* fixed columns, so hiding a panel never shifts the others into its place */
@media (min-width: 821px) {
  .workspace > .rail { grid-column: 1; grid-row: 1; }
  .workspace > #leftPanel { grid-column: 2; grid-row: 1; }
  .workspace > #stageWrap { grid-column: 3; grid-row: 1; }
  .workspace > #inspector { grid-column: 4; grid-row: 1; }
}
.rail { border-right: 1px solid var(--line); display: flex; flex-direction: column; background: var(--bar); }
.rail-btn {
  background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--muted); cursor: pointer;
  font: 700 10px/1.2 var(--mono); letter-spacing: .1em; padding: 16px 4px; display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.rail-btn b { font: 20px/1 var(--display); color: var(--line-2); }
.rail-btn:hover { color: var(--text); }
.rail-btn.is-active { color: var(--text); box-shadow: inset 3px 0 0 var(--red); background: var(--panel); }
.rail-btn.is-active b { color: var(--red); }

.panel { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 18px 16px; }
.inspector { border-right: 0; border-left: 1px solid var(--line); }
.panel-title { font: 34px/0.95 var(--display); margin: 0 0 18px; letter-spacing: .01em; }
.panel-title span { color: var(--red); font-size: 13px; font-family: var(--mono); margin-left: 6px; vertical-align: top; }
.sub-title { font-size: 10px; color: var(--muted); margin: 22px 0 10px; font-weight: 400; display: flex; gap: 8px; align-items: center; }
.sub-title::after { content: ''; flex: 1; height: 1px; background: var(--red-dim); }

/* ── source panel ── */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 10px;
  border: 1px dashed var(--line-2); cursor: pointer; text-align: center; position: relative;
  background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(255,255,255,.015) 8px 16px);
}
.dropzone::before, .dropzone::after { content: ''; position: absolute; width: 10px; height: 10px; border: 2px solid var(--red); }
.dropzone::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.dropzone::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.dropzone:hover, .dropzone.is-over { border-color: var(--red); background-color: rgba(var(--red-rgb),.06); }
.dz-icon { font: 40px/1 var(--display); color: var(--red); }
.dz-title { font: 18px/1 var(--display); letter-spacing: .04em; }
.dz-hint { font-size: 10px; color: var(--muted); }

.field-row { display: flex; gap: 6px; margin-top: 12px; }
.input {
  width: 100%; background: var(--field); border: 1px solid var(--line-2); color: var(--text); padding: 8px 9px; font-size: 11px; border-radius: 0;
}
.input:focus { outline: none; border-color: var(--red); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }

.sample-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sample { aspect-ratio: 1; border: 1px solid var(--line); padding: 0; cursor: pointer; background: #000; position: relative; overflow: hidden; }
.sample img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.sample:hover { border-color: var(--red); }
.sample:hover img { transform: scale(1.05); }
.sample span { position: absolute; left: 6px; bottom: 5px; font: 9px var(--mono); color: #fff; mix-blend-mode: difference; }

.text-preset { display: block; width: 100%; text-align: left; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 14px; margin-bottom: 8px; cursor: pointer; }
.text-preset:hover { border-color: var(--red); }

.shape-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shape-btn { aspect-ratio: 1; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; display: grid; place-items: center; }
.shape-btn:hover { border-color: var(--red); }
.shape-btn i { display: block; width: 46%; height: 46%; background: var(--red); }
.ico-ellipse { border-radius: 50%; }
.ico-tri { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ico-line { height: 4px !important; }

.layer-list { list-style: none; margin: 0; padding: 0; }
.layer-item { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); margin-bottom: 4px; cursor: pointer; background: var(--panel-2); font-size: 12px; }
.layer-item.is-selected { border-color: var(--red); box-shadow: inset 3px 0 0 var(--red); }
.layer-item .idx { font: 10px var(--mono); color: var(--muted); width: 22px; }
.layer-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-item button { background: none; border: 0; color: var(--muted); cursor: pointer; font: 12px var(--mono); padding: 2px 4px; }
.layer-item button:hover { color: var(--text); }
.layer-item.is-hidden .nm { opacity: .4; text-decoration: line-through; }

/* ── stage ── */
.stage-wrap {
  position: relative; overflow: hidden; min-width: 0;
  background:
    radial-gradient(circle at 1px 1px, #1d1d1d 1px, transparent 0) 0 0/22px 22px,
    #060606;
}
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.busy { position: absolute; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 5; }
.busy span { border: 1px solid var(--red); padding: 12px 18px; background: var(--bar); font-size: 12px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { color: var(--red); } }

/* ── inspector ── */
.insp-group { border-top: 1px solid var(--line); padding: 14px 0; }
.insp-group:first-of-type { border-top: 0; padding-top: 0; }
.insp-head { font: 10px var(--mono); color: var(--muted); margin: 0 0 10px; display: flex; justify-content: space-between; letter-spacing: .1em; }
.insp-head b { color: var(--red); font-weight: 400; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font: 9px var(--mono); color: var(--muted); letter-spacing: .1em; display: flex; justify-content: space-between; }
.field > span b { color: var(--text); font-weight: 400; }
.field.full { grid-column: 1 / -1; }
input[type=range] { width: 100%; accent-color: var(--red); height: 18px; margin: 0; }
input[type=color] { width: 100%; height: 32px; border: 1px solid var(--line-2); background: var(--field); padding: 2px; cursor: pointer; }
textarea.input { resize: vertical; min-height: 70px; font-family: var(--sans); font-size: 13px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }
.empty-insp { color: var(--muted); font: 11px/1.6 var(--mono); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.chip { font: 700 10px var(--mono); padding: 6px 9px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; letter-spacing: .06em; }
.chip:hover, .chip.is-active { border-color: var(--red); color: var(--text); background: rgba(var(--red-rgb),.15); }
.toggle { display: flex; align-items: center; gap: 8px; font: 10px var(--mono); color: var(--muted); cursor: pointer; }
.toggle input { accent-color: var(--red); }
.rb-card { border: 1px solid var(--red-dim); padding: 12px; background: linear-gradient(180deg, rgba(var(--red-rgb),.08), transparent); }
.rb-card .meta { margin: 8px 0 0; }
.meta { font-size: 10px; color: var(--muted); margin: 6px 0; }
.error { color: #ff5a5f; font-size: 11px; min-height: 1em; margin: 8px 0 0; }

/* ── top nav ── */
.top-nav { display: flex; gap: 2px; margin-left: 8px; }
.top-nav a { color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 700; padding: 8px 12px; border: 1px solid transparent; letter-spacing: .08em; }
.top-nav a:hover { color: var(--text); border-color: var(--line-2); }
.top-nav a.is-active { color: var(--text); border-color: var(--red); box-shadow: inset 0 -2px 0 var(--red); }
body.is-remove .doc-name, body.is-remove .top-actions, body.is-remove .top-file { visibility: hidden; }

/* ── remove background view ── */
.rm { min-height: 0; overflow: auto; position: relative;
  background: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0) 0 0/22px 22px, var(--stage); }
.rm-landing { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; max-width: 1240px; margin: 0 auto; padding: 56px 32px; min-height: 100%; }
.rm-tag { color: var(--red); font-size: 11px; margin: 0 0 14px; }
.rm-title { font: clamp(64px, 10vw, 150px)/.86 var(--display); margin: 0; letter-spacing: .01em; }
.rm-title span { color: transparent; -webkit-text-stroke: 2px var(--red); }
.rm-sub { color: #bdbdbd; font-size: 15px; max-width: 520px; margin: 22px 0; line-height: 1.55; }
.rm-steps { list-style: none; padding: 0; margin: 0; display: flex; gap: 22px; flex-wrap: wrap; font-size: 10px; color: var(--muted); }
.rm-steps b { color: var(--red); font: 22px/1 var(--display); margin-right: 8px; vertical-align: -3px; }
.rm-upload { position: relative; background: var(--panel); border: 1px solid var(--line-2); padding: 36px 28px; text-align: center; }
.rm-upload.is-over { border-color: var(--red); background: #160a0b; }
.rm-upload::before, .rm-upload::after, .rm-corner::before, .rm-corner::after { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid var(--red); }
.rm-upload::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.rm-upload::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.rm-corner::before { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.rm-corner::after { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.rm-upload-btn { font-size: 15px; padding: 20px 34px; width: 100%; max-width: 340px; }
.rm-upload .field-row { max-width: 420px; margin: 14px auto 0; }
.rm-upload .sub-title { margin-top: 28px; }
.rm-samples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rm-samples .sample { aspect-ratio: 4 / 3; }

.rm-result { display: grid; grid-template-columns: 1fr 300px; height: 100%; min-height: 0; }
.rm-stage-col { display: flex; flex-direction: column; padding: 16px; min-width: 0; min-height: 0; gap: 10px; }
.rm-tabs { align-self: center; width: min(420px, 100%); margin: 0; background: var(--bar); }
.rm-stage { position: relative; flex: 1; min-height: 300px; }
.rm-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.rm-split { position: absolute; width: 2px; background: var(--red); transform: translateX(-1px); pointer-events: none; }
.rm-split span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--red); color: var(--on-red); font: 700 14px var(--mono); padding: 6px 8px; }
.rm-scan { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); overflow: hidden; }
.rm-scan i { position: absolute; left: 0; right: 0; height: 3px; background: var(--red); box-shadow: 0 0 24px 6px rgba(var(--red-rgb),.6); animation: scan 1.6s ease-in-out infinite alternate; }
@keyframes scan { from { top: 4%; } to { top: 96%; } }
@media (prefers-reduced-motion: reduce) { .rm-scan i { animation: none; top: 50%; } }
.rm-scan span { position: relative; border: 1px solid var(--red); background: var(--bar); padding: 12px 18px; font-size: 12px; }
.rm-stage-col .meta { text-align: center; }
.rm-side { border-left: 1px solid var(--line); background: var(--panel); padding: 18px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.rm-side .sub-title { margin: 14px 0 4px; }
.rm-dl { padding: 18px 14px; font-size: 14px; flex-direction: column; gap: 6px; }
.rm-dl small, .rm-side .btn small { font-size: 9px; opacity: .8; font-weight: 400; }
.rm-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.swatch { aspect-ratio: 1; border: 1px solid var(--line-2); cursor: pointer; padding: 0; }
.swatch.is-transparent { background: repeating-conic-gradient(var(--line-2) 0 25%, var(--check-a) 0 50%) 0 0/10px 10px; }
.swatch.is-active { outline: 2px solid var(--red); outline-offset: 2px; }
.rm-bg-row .btn.is-active { border-color: var(--red); background: rgba(var(--red-rgb),.15); }

/* ── status bar ── */
.statusbar { display: flex; align-items: center; gap: 22px; padding: 0 16px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); background: var(--bar); }
.statusbar .spacer { flex: 1; }
.dot::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); margin-right: 6px; vertical-align: 0; }
.dot.is-on::before { background: #2bd96b; box-shadow: 0 0 6px #2bd96b; }
.dot.is-off::before { background: var(--red); }
.checker { width: 120px; height: 8px; background: repeating-conic-gradient(var(--red) 0 25%, transparent 0 50%) 0 0/8px 8px; }

/* ── dialog ── */
.dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); padding: 24px; width: min(440px, 92vw); border-radius: 0; }
.dialog::backdrop { background: rgba(0,0,0,.7); }
.seg { display: flex; border: 1px solid var(--line-2); padding: 0; margin: 0 0 16px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px 0; font: 700 11px var(--mono); cursor: pointer; letter-spacing: .1em; }
.seg input:checked + span { background: var(--red); color: var(--on-red); }
.seg input:focus-visible + span { outline: 2px solid #fff; outline-offset: -4px; }
.mp-meter { height: 6px; background: var(--panel-2); border: 1px solid var(--line); }
.mp-meter div { height: 100%; background: var(--red); width: 0; transition: width .15s; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--bar); border: 1px solid var(--line-2); border-left: 3px solid var(--red); padding: 10px 14px; font-size: 11px; transition: .2s; z-index: 50; max-width: 80vw;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { border-left-color: #ff5a5f; color: #ffb3b5; }

@media (max-width: 960px) {
  .rm-landing { grid-template-columns: 1fr; gap: 28px; padding: 28px 16px; }
  .rm-result { grid-template-columns: 1fr; height: auto; }
  .rm-stage { min-height: 55vh; }
  .rm-side { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 1100px) {
  .workspace { --left: 240px; --right: 250px; grid-template-columns: 64px var(--left) minmax(0, 1fr) var(--right); }
}
@media (max-width: 820px) {
  body { grid-template-rows: auto 1fr auto; overflow: auto; }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .doc-name { order: 3; max-width: none; flex-basis: 100%; }
  .top-nav { order: 2; margin-left: 0; }
  body.is-remove .doc-name, body.is-remove .top-actions { display: none; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: auto auto 55vh auto; min-height: auto; }
  .panel { overflow: visible; }
  #statusSel { display: none; }
  .rail { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-btn { flex: 1; border-bottom: 0; }
  .panel, .inspector { border: 0; border-top: 1px solid var(--line); }
  .checker, .brand-sub { display: none; }
}

/* static hosting (no server): URL import is unavailable */
body.is-static #urlForm, body.is-static #rmUrlForm { display: none; }

/* ── intro / boot sequence ── */
.intro { position: fixed; inset: 0; z-index: 200; overflow: hidden; cursor: pointer; --hud-line: #e9e9e9; --hud-plate: #0c0c0c; --hud-yellow: #f2c230; }
.intro-half { position: absolute; left: 0; right: 0; height: 50.5%; background: #050505; transition: transform .75s cubic-bezier(.7, 0, .2, 1); }
.intro-half.top { top: 0; border-bottom: 1px solid var(--red-dim); }
.intro-half.bottom { bottom: 0; border-top: 1px solid var(--red-dim); }
.intro-grid {
  position: absolute; inset: 0; opacity: .5; transition: opacity .3s;
  background:
    linear-gradient(transparent 49.9%, rgba(var(--red-rgb),.25) 50%, transparent 50.1%) 0 0/100% 100%,
    radial-gradient(circle at 1px 1px, #222 1px, transparent 0) 0 0/24px 24px;
}
.intro-stage { position: absolute; left: 50%; top: 50%; width: min(1240px, 96vw); height: min(760px, 92vh); transform: translate(-50%, -50%); transition: opacity .25s, filter .25s; }
.intro-skip { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font: 10px var(--mono); letter-spacing: .2em; color: #6b6b6b; margin: 0; animation: blink 1.2s steps(2) infinite; }

/* chamfered plate: outer = outline color, inner = plate, both clipped */
.hud { position: absolute; --cut: 14px; padding: 1.5px; background: var(--hud-line); color: var(--hud-line);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  opacity: 0; animation: hud-in .55s steps(1, end) var(--d) forwards, hud-settle .5s cubic-bezier(.2, .8, .2, 1) var(--d) forwards; }
.hud-in { background: var(--hud-plate); height: 100%; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
  clip-path: inherit; font: 9px/1.25 var(--mono); letter-spacing: .06em; }
@keyframes hud-in { 0% { opacity: 0; } 10% { opacity: 1; } 18% { opacity: .1; } 30% { opacity: 1; } 38% { opacity: .35; } 50%, 100% { opacity: 1; } }
@keyframes hud-settle { from { transform: translate(var(--dx, 0), var(--dy, 0)) scaleX(1.06); filter: blur(2px); } to { transform: none; filter: none; } }

.hud-row { display: flex; align-items: center; gap: 8px; }
.hud-foot { margin-top: auto; justify-content: space-between; color: #9a9a9a; }
.hud-logo { width: 22px; height: 22px; background: var(--red); color: #fff; display: grid; place-items: center; flex: none; }
.hud-logo svg { width: 14px; height: 14px; }
.hud-name { font: 20px/1 var(--display); letter-spacing: .04em; color: #fff; }
.hud-mini { font-size: 8px; color: #9a9a9a; }
.hud-red { color: var(--red); font-size: 11px; }
.hud-fine { margin: 0; font-size: 7px; color: #8a8a8a; max-width: 30ch; }
.hud-bar canvas { display: block; }
.hud-tab-y { background: var(--hud-yellow); color: #000; padding: 1px 6px; font-weight: 700; }
.hud-vert { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 7px; color: #8a8a8a; }
.hud-screen { border: 1px solid var(--hud-line); background: #f1f1f1; color: #111; padding: 6px 8px; min-height: 52px; display: flex; flex-direction: column; font: 700 11px/1.35 var(--mono); }
.hud-screen span:last-child::after { content: '█'; animation: blink .8s steps(2) infinite; }
.hud-kanji { font: 900 26px/1 'Archivo Black', sans-serif; color: #fff; letter-spacing: .02em; }
.hud-redline { height: 8px; background: var(--red); margin: -10px -12px 4px; clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%); }
.hud-warn { width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 16px solid var(--red); position: relative; font-size: 0; }
.hud-type { border: 1px solid #555; padding: 2px 8px; color: #bbb; }
.hud-caution { background: var(--hud-yellow); color: #000; padding: 2px 6px 2px 18px; font-weight: 700; position: relative; }
.hud-caution::before { content: ''; position: absolute; left: 3px; top: 2px; bottom: 2px; width: 11px; background: repeating-linear-gradient(-45deg, #000 0 2px, transparent 2px 4px); }
.hud-vstrip { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--red); color: #fff; padding: 6px 4px; margin: -10px 0 -10px -12px; }
.hud-vstrip b { writing-mode: vertical-rl; font: 900 16px/1 sans-serif; }
.hud-vstrip span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 8px; }
.p-corp .hud-in { flex-direction: row; gap: 12px; }

/* layout of the plates around the brand */
.p-crypto { left: 1%;  top: 3%;  width: 220px; height: 112px; --dx: -60px; }
.p-mod    { left: 30%; top: 0;   width: 300px; height: 92px;  --dy: -50px; }
.p-dc     { right: 1%; top: 4%;  width: 250px; height: 124px; --dx: 60px; }
.p-check  { left: 0;   top: 36%; width: 200px; height: 142px; --dx: -70px; }
.p-corp   { right: 0;  top: 40%; width: 250px; height: 116px; --dx: 70px; }
.p-proto  { left: 4%;  bottom: 3%; width: 220px; height: 104px; --dy: 50px; }
.p-pass   { right: 6%; bottom: 4%; width: 220px; height: 92px;  --dy: 50px; }

.hud-main { left: 50%; top: 50%; width: min(560px, 92vw); height: auto; margin: 0; --cut: 22px; translate: -50% -50%; --dy: 30px; }
.hud-main .hud-in { padding: 16px 20px; gap: 12px; }
.hud-main-top .hud-right { margin-left: auto; }
.hud-main-body { display: flex; align-items: center; gap: 18px; }
.hud-reticle { width: 110px; height: 110px; flex: none; animation: spin 6s linear infinite; }
.hud-reticle circle { fill: none; }
.hud-reticle .r-outer { stroke: #6a6a6a; stroke-width: 1; }
.hud-reticle .r-dash { stroke: var(--hud-line); stroke-width: 2; stroke-dasharray: 3 5; }
.hud-reticle .r-red { stroke: var(--red); stroke-width: 3; stroke-dasharray: 40 20; }
.hud-reticle .r-tick { stroke: var(--hud-line); stroke-width: 2; }
.hud-reticle text { fill: #fff; font: 700 9px var(--mono); }
@keyframes spin { to { transform: rotate(360deg); } }
.hud-brand { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hud-logo-big { font: clamp(34px, 6vw, 52px)/.9 var(--display); color: #fff; letter-spacing: .02em; }
.hud-logo-big em { color: var(--red); font-style: normal; }
.hud-tab-red { align-self: flex-start; background: var(--red); color: #fff; padding: 3px 10px; font-weight: 700; letter-spacing: .2em; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.hud-brand canvas { max-width: 100%; }
.hud-log { list-style: none; margin: 0; padding: 0; min-height: 72px; font-size: 10px; color: #b5b5b5; display: flex; flex-direction: column; gap: 2px; }
.hud-log li { display: flex; justify-content: space-between; animation: log-in .2s steps(3) both; }
.hud-log b { color: var(--red); }
@keyframes log-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.hud-progress { height: 10px; border: 1px solid #555; padding: 2px; }
.hud-progress i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--red) 0 10px, transparent 10px 13px); transform: scaleX(0); transform-origin: left; }
.hud-pct { color: #fff; font-variant-numeric: tabular-nums; }

/* exit: plates glitch out, then the screen splits */
.intro.is-leaving { pointer-events: none; }
.intro.is-leaving .intro-stage { opacity: 0; filter: blur(3px) contrast(2); transition-duration: .2s; }
.intro.is-leaving .intro-grid, .intro.is-leaving .intro-skip { opacity: 0; }
.intro.is-leaving .intro-half.top { transform: translateY(-101%); transition-delay: .15s; }
.intro.is-leaving .intro-half.bottom { transform: translateY(101%); transition-delay: .15s; }

@media (max-width: 900px), (max-height: 560px) {
  .intro .hud:not(.hud-main) { display: none; }
}
.intro.is-reduced .hud, .intro.is-reduced .hud-reticle, .intro.is-reduced .intro-skip { animation: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .intro-half { transition-duration: .01s; }
}

/* ───────── QR code ───────── */
.qr-form { display: flex; flex-direction: column; gap: 10px; }
.qr-fields { display: flex; flex-direction: column; gap: 8px; }
.qr-fields textarea { min-height: 64px; resize: vertical; }
.qr-preview { position: relative; display: grid; place-items: center; padding: 14px; background: var(--panel-2); border: 1px solid var(--line);
  background-image: linear-gradient(45deg, #1a1a1a 25%, transparent 25%, transparent 75%, #1a1a1a 75%), linear-gradient(45deg, #1a1a1a 25%, transparent 25%, transparent 75%, #1a1a1a 75%);
  background-size: 14px 14px; background-position: 0 0, 7px 7px; }
.qr-preview::before, .qr-preview::after { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid var(--red); }
.qr-preview::before { top: 4px; left: 4px; border-right: 0; border-bottom: 0; }
.qr-preview::after { bottom: 4px; right: 4px; border-left: 0; border-top: 0; }
.qr-preview canvas { width: 100%; max-width: 220px; height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.qr-form .error:empty { display: none; }
.qr-note { grid-column: 1 / -1; }
.qr-note:empty { display: none; }

/* ── offline / install ── */
.dot.is-offline::before { background: #f5a524; box-shadow: 0 0 6px #f5a524; }
body.is-offline #urlForm, body.is-offline #rmUrlForm { display: none; }

/* ───────── tabs + recents ───────── */
.tabs { flex: 1; min-width: 230px; display: flex; align-items: stretch; align-self: stretch; gap: 4px; padding-top: 10px; }
.tab-list { flex: 0 1 auto; min-width: min(170px, 100%); display: flex; align-items: stretch; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab-list::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; min-width: 76px; max-width: 220px; flex: 0 1 auto; overflow: hidden; border: 1px solid var(--line); border-bottom: 0; background: #0d0d0d; position: relative; }
.tab.is-active { background: var(--panel); border-color: var(--line-2); flex: 0 0 auto; width: 200px; max-width: 40vw; overflow: visible; }
.tab.is-active::before { content: ''; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px; background: var(--red); }
.tab .doc-name { flex: 1 1 auto; max-width: none; width: auto; min-width: 0; margin: 0; text-align: left; padding: 6px 4px 6px 12px; font-size: 11px; }
.tab-name { flex: 1; min-width: 0; background: none; border: 0; color: var(--muted); font: 11px var(--mono); text-align: left; padding: 6px 4px 6px 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-name:hover { color: var(--text); }
.tab-x { background: none; border: 0; color: var(--muted); font-size: 15px; width: 26px; cursor: pointer; flex: none; }
.tab-x:hover { color: var(--red); }
.tab-add, .tab-recents { background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer; font: 700 10px var(--mono); letter-spacing: .08em; padding: 0 10px; flex: none; }
.tab-add { font-size: 16px; }
.tab-add:hover, .tab-recents:hover { color: var(--text); border-color: var(--line-2); }
body.is-remove .tabs { visibility: hidden; }
#saveState { color: var(--muted); }
.recents { width: min(860px, 94vw); }
.recents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; max-height: 60vh; overflow: auto; margin-top: 12px; }
.recent { position: relative; border: 1px solid var(--line); background: var(--panel-2); }
.recent:hover { border-color: var(--red); }
.recent-open { display: flex; flex-direction: column; width: 100%; background: none; border: 0; color: var(--text); padding: 0; cursor: pointer; text-align: left; }
.recent-thumb { aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden;
  background: repeating-conic-gradient(#1c1c1c 0 25%, #252525 0 50%) 0 0 / 14px 14px; }
.recent-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.recent-meta { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 10px; }
.recent-meta b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-meta small { font-size: 9px; color: var(--muted); }
.recent-del { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; background: rgba(0,0,0,.7); border: 1px solid var(--line-2); color: var(--text); cursor: pointer; }
.recent-del:hover { background: var(--red); }
@media (max-width: 900px) { .tabs { order: 3; flex-basis: 100%; padding-top: 0; } }

/* ───────── screen recorder ───────── */
.rec-card { text-align: left; display: flex; flex-direction: column; gap: 14px; }
.rec-card .seg { margin: 0; }
.rec-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center; }
.rec-grid .rec-span { grid-column: 1 / -1; }
.rec-grid .field { grid-column: 2; }
.rec-grid .field:first-child { grid-column: 1; }
.rec-bubble-row { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; }
.rec-cam-preview { position: relative; aspect-ratio: 1; border: 2px solid var(--red); border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--bar); }
.rec-cam-preview[data-shape="rounded"] { border-radius: 12%; }
.rec-cam-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); opacity: 0; }
.rec-cam-preview.is-on video { opacity: 1; }
.rec-cam-preview span { font-size: 9px; color: var(--muted); }
.rec-bubble-opts { display: flex; flex-direction: column; gap: 10px; }
.rec-pos { margin: 0; }
.rec-pos .chip { min-width: 38px; font-size: 14px; }
.rec-start { max-width: none; }
.rec-card .error:empty { display: none; }
.rec-live { display: grid; grid-template-rows: 1fr auto; height: 100%; min-height: 0; padding: 16px; gap: 14px; }
.rec-stage { position: relative; min-height: 0; border: 1px solid var(--line-2); background: #000; }
.rec-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.rec-badge { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.75); border: 1px solid var(--red); padding: 6px 12px; font-size: 13px; }
.rec-badge i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: recblink 1s steps(2) infinite; }
.rec-badge.is-paused i { animation: none; background: #f5a524; }
@keyframes recblink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .rec-badge i { animation: none; } }
.rec-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.rec-controls .meta { flex-basis: 100%; text-align: center; margin: 0; }
.rec-video { flex: 1; min-height: 0; width: 100%; background: #000; border: 1px solid var(--line-2); }
.rec-count { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0,0,0,.6); pointer-events: none; }
.rec-count b { font: 220px/1 var(--display); color: var(--red); animation: recpulse 1s ease-out; }
@keyframes recpulse { from { transform: scale(1.6); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }
@media (max-width: 900px) { .rec-bubble-row { grid-template-columns: 96px 1fr; } }

/* ───────── align, groups ───────── */
.align-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.align-row .chip { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 8.5px; padding: 6px 2px; }
.align-row .chip b { font-size: 15px; font-weight: 400; line-height: 1; }
.align-row .chip:hover { border-color: var(--red); }
.layer-item.is-grouped .nm::before { content: '▣ '; color: var(--red); }

/* ───────── text panel ───────── */
.text-panel { display: flex; flex-direction: column; gap: 8px; }
.text-panel .panel-title { margin-bottom: 10px; }
.tp-search { position: relative; display: block; }
.tp-search span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; pointer-events: none; }
.tp-search .input { width: 100%; padding-left: 34px; border-color: var(--line-2); }
.tp-add { padding: 14px 10px; font-size: 10.5px; gap: 8px; letter-spacing: .03em; white-space: nowrap; }
.tp-add b { font: 18px/1 var(--display); }
.tp-magic { padding: 12px; }
.tp-head { display: flex; align-items: center; gap: 8px; margin-top: 14px; font: 10px var(--mono); color: var(--text); }
.tp-head b { flex: 1; letter-spacing: .1em; }
.tp-kit-icon { color: var(--red); font-size: 14px; }
.tp-link { background: none; border: 0; color: var(--text); font: 700 10px var(--mono); letter-spacing: .08em; cursor: pointer; padding: 4px 0; }
.tp-link:hover { color: var(--red); }
#tpKit { margin-top: 8px; }
.tp-kit-empty { padding: 12px; font-size: 10px; }
.tp-kit-form { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line-2); padding: 12px; background: var(--panel-2); }
.tp-kit-row { display: flex; gap: 6px; align-items: center; }
.tp-kit-row select { flex: 1; min-width: 0; }
.tp-kit-row input[type=color] { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line-2); background: none; }
.tp-kit-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tp-kit-font { background: var(--panel-2); border: 1px solid var(--line); padding: 10px 4px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-kit-font:hover { border-color: var(--red); }
.tp-kit-colors { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 8px; }
.tp-style { display: block; width: 100%; text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 0; color: var(--text); padding: 16px 14px; margin-bottom: 8px; cursor: pointer; line-height: 1.1; }
.tp-style:hover { border-color: var(--red); }
.tp-style[data-style="title"] span { font-size: 26px; text-transform: uppercase; }
.tp-style[data-style="subtitle"] span { font-size: 17px; }
.tp-style[data-style="body"] span { font-size: 12px; }
.tp-combos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tp-combo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1; padding: 8px; background: var(--bar); border: 1px solid var(--line); cursor: pointer; overflow: hidden; text-align: center; line-height: 1; }
.tp-combo:hover { border-color: var(--red); }
.tp-combo span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-results { display: flex; flex-direction: column; gap: 6px; }
.tp-font { text-align: left; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font-size: 20px; padding: 12px 14px; cursor: pointer; }
.tp-font:hover { border-color: var(--red); }

/* ── right-click menu ── */
.ctx-menu {
  position: fixed; z-index: 90; min-width: 248px; max-width: 320px; padding: 5px 0;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 14px 40px rgba(0,0,0,.65), 4px 4px 0 var(--red-dim);
}
.ctx-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 12px 7px 10px;
  background: none; border: 0; color: var(--text); font: 13px var(--sans); text-align: left; cursor: pointer;
}
.ctx-item:hover:not(:disabled), .ctx-item:focus-visible, .ctx-item.is-open { background: var(--panel-2); outline: none; box-shadow: inset 2px 0 0 var(--red); }
.ctx-item:disabled { color: var(--muted); opacity: .55; cursor: default; }
.ctx-item.is-danger:hover:not(:disabled) { color: #ff4d52; }
.ctx-check { width: 12px; font-size: 9px; color: var(--red); }
.ctx-check:empty { display: none; }
.ctx-check:not(:empty) { width: 8px; margin-right: -4px; }
.ctx-ico { flex: none; width: 18px; height: 18px; display: grid; place-items: center; color: var(--muted); }
.ctx-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ctx-item:hover:not(:disabled) .ctx-ico, .ctx-item.is-open .ctx-ico { color: var(--text); }
.ctx-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-kbd { font-size: 10px; color: var(--muted); }
.has-sub .ctx-kbd { font-size: 15px; color: var(--text); }
.ctx-badge { margin-left: 8px; padding: 1px 5px; font-size: 9px; color: var(--red); border: 1px solid var(--red-dim); vertical-align: 1px; }
.ctx-sep { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.ctx-head { padding: 6px 12px 2px 12px; text-align: left; font-size: 9px; letter-spacing: .14em; color: var(--red); }
.ctx-ask textarea.input { resize: vertical; min-height: 84px; font: 13px var(--sans); }
.ctx-ask .ctx-hint { margin: 8px 0 0; }
#stage.is-brush { cursor: copy; }

.layer-item .badges { font-size: 10px; color: var(--red); letter-spacing: .08em; }
.lock-note { border: 1px solid var(--red-dim); padding: 10px; margin-bottom: 12px; background: rgba(var(--red-rgb),.06); }
.lock-note p { margin: 0 0 8px; font-size: 11px; color: var(--red); letter-spacing: .1em; }

/* components (panel 03) */
.comp-h { margin: 22px 0 6px; font-size: 10px; letter-spacing: .14em; color: var(--muted); font-weight: 400; }
.comp-list { display: grid; gap: 4px; }
.comp-row { display: flex; border: 1px solid var(--line); background: var(--panel-2); }
.comp-row:hover { border-color: var(--red); }
.comp-add { flex: 1; display: grid; gap: 2px; padding: 8px 10px; background: none; border: 0; color: var(--text); text-align: left; cursor: pointer; }
.comp-add b { font: 600 13px var(--sans); }
.comp-add span { font-size: 10px; color: var(--muted); }
.comp-del { background: none; border: 0; border-left: 1px solid var(--line); color: var(--muted); padding: 0 12px; cursor: pointer; font-size: 16px; }
.comp-del:hover { color: var(--red); }

/* ── ferramentas: floating bar on the stage ── */
.toolbar {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%); z-index: 6;
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0,0,0,.5), 3px 3px 0 var(--red-dim);
}
.tb-close, .toolbar-show {
  width: 40px; height: 28px; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer;
}
.tb-close:hover { color: var(--text); }
.tb-btn {
  width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  background: var(--panel-2); border: 1px solid transparent; color: var(--text); cursor: pointer;
}
.tb-btn:hover { border-color: var(--line-2); }
.tb-btn.is-active { background: var(--red); color: var(--on-red); }
.tb-btn svg, .tool-card svg, .brush-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tb-btn[data-tool="draw"]:not(.is-active) svg { stroke: var(--ink, var(--red)); }
.toolbar-show {
  position: absolute; left: 14px; top: 14px; z-index: 6; height: 40px;
  background: var(--panel); border: 1px solid var(--line-2); color: var(--red);
}
.tool-fly {
  position: absolute; left: 72px; top: 50%; transform: translateY(-50%); z-index: 6; width: 236px; padding: 10px;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.fly-shape { width: 52px; height: 52px; margin: 0 6px 6px 0; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; display: inline-grid; place-items: center; }
.fly-shape.is-active { border-color: var(--red); }
.fly-shape i { transform: scale(.5); }
.fly-hint { margin: 4px 0 0; font-size: 9px; color: var(--muted); letter-spacing: .12em; }
#stage.is-tool { cursor: crosshair; }

/* tools panel + brushes */
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tool-card {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 4px 8px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.tool-card span { font-size: 8px; letter-spacing: .08em; color: var(--muted); text-align: center; }
.tool-card kbd { position: absolute; top: 3px; right: 4px; font-size: 8px; color: var(--muted); }
.tool-card:hover { border-color: var(--line-2); }
.tool-card.is-active { border-color: var(--red); box-shadow: inset 0 -2px 0 var(--red); }
.tool-card.is-active svg { stroke: var(--red); }
.brush-count { font-weight: 400; color: var(--red); margin-left: 6px; }
.brush-settings { display: grid; gap: 10px; }
.brush-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.is-compact .brush-list { grid-template-columns: repeat(3, 1fr); }
.brush-btn {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 6px 4px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.brush-btn canvas { width: 72px; height: 28px; max-width: 100%; }
.is-compact .brush-btn canvas { width: 56px; height: 22px; }
.brush-btn span.mono { font-size: 8px; letter-spacing: .08em; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brush-btn.is-active { border-color: var(--red); background: rgba(var(--red-rgb),.08); }
.brush-del { position: absolute; top: 0; right: 4px; color: var(--muted); font-size: 14px; }
.brush-del:hover { color: var(--red); }
.brush-colors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.brush-colors .swatch { width: 24px; height: 24px; flex: none; border-radius: min(var(--radius), 6px); }
.brush-colors .cp-wrap { flex-basis: 100%; }
.brush-colors .swatch.is-active { outline: 2px solid var(--red); outline-offset: 1px; }
.brush-colors input[type=color] { width: 100%; height: 100%; min-height: 20px; padding: 0; border: 1px solid var(--line-2); background: none; cursor: pointer; }
.brush-range { display: grid; gap: 4px; font-size: 9px; color: var(--muted); letter-spacing: .1em; }
.brush-range span { display: flex; justify-content: space-between; }
.brush-range b { color: var(--text); font-weight: 400; }
.brush-io { display: grid; gap: 6px; margin: 14px 0 8px; }
.btn.block { text-align: center; }

/* table editor */
.table-cells { display: grid; gap: 2px; grid-column: 1 / -1; overflow-x: auto; margin: 6px 0; }
.table-cells .cell { padding: 6px; font-size: 11px; min-width: 0; }
.table-cells .cell.is-head { border-color: var(--red-dim); font-weight: 700; }

/* signature */
.sig-dialog { width: min(720px, 94vw); }
.sig-pad { display: block; width: 100%; aspect-ratio: 640 / 240; background: #fbfaf7; cursor: crosshair; touch-action: none; margin-top: 12px; }
.sig-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.sig-colors { display: flex; gap: 6px; }
.sig-colors .swatch { width: 26px; }
.sig-colors .swatch.is-active { outline: 2px solid var(--red); outline-offset: 2px; }

/* ── home ── */
.top-nav .nav-home { display: grid; place-items: center; padding: 6px 10px; }
.nav-home svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.home { display: grid; grid-template-columns: 232px 1fr; min-height: 0; }
.home-side { display: flex; flex-direction: column; gap: 14px; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--panel); }
.home-create { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; font-size: 13px; letter-spacing: .1em; }
.home-create span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--red); font-size: 18px; line-height: 1; }
.home-nav { display: grid; gap: 2px; }
.home-nav button, .home-trash {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: none; border: 1px solid transparent;
  color: var(--muted); font: 700 11px var(--mono); letter-spacing: .1em; text-align: left; cursor: pointer;
}
.home-nav button:hover, .home-trash:hover { color: var(--text); border-color: var(--line-2); }
.home-nav button.is-active, .home-trash.is-active { color: var(--text); background: var(--panel-2); box-shadow: inset 3px 0 0 var(--red); }
.home-trash { margin-top: auto; }
.home-trash svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.home-trash b { margin-left: auto; color: var(--red); font-weight: 700; }
.home-main { overflow: auto; padding: 28px 36px 60px; }
.home-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.home-title { font: 56px/1 var(--display); margin: 0; letter-spacing: .01em; flex: 1; text-transform: uppercase; }
.home-search { width: min(320px, 100%); }
.home-back { order: -1; }
.home-sec { margin-top: 30px; }
.home-sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.home-sec-head h2 { margin: 0; font: 26px var(--display); letter-spacing: .02em; text-transform: uppercase; flex: 1; }
.home-sec-head h2:empty { display: none; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.home-grid.is-empty, .folder-grid.is-empty { display: block; color: var(--muted); font: 12px var(--mono); padding: 18px; border: 1px dashed var(--line-2); }
.home-card { cursor: pointer; outline: none; }
.home-thumb {
  aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 14px; background: var(--panel-2); border: 1px solid var(--line);
  transition: border-color .15s;
}
.home-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.home-thumb span { font-size: 10px; color: var(--muted); }
.home-card:hover .home-thumb, .home-card:focus-visible .home-thumb { border-color: var(--red); }
.home-meta { position: relative; display: grid; gap: 2px; padding: 8px 28px 0 2px; }
.home-meta b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-meta span { font-size: 10px; color: var(--muted); }
.home-more { position: absolute; right: 0; top: 4px; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 4px; }
.home-more:hover { color: var(--text); }
.home-card.is-trashed { cursor: default; }
.home-card.is-trashed .home-thumb { filter: grayscale(.7); opacity: .75; }
.home-card.is-trashed .home-meta { padding-right: 2px; }
.home-card.is-trashed .home-meta span { color: var(--red); }
.trash-actions { display: flex; gap: 6px; margin-top: 8px; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.folder { display: flex; align-items: center; gap: 14px; padding: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); cursor: pointer; text-align: left; }
.folder:hover { border-color: var(--red); }
.folder svg { width: 40px; height: 40px; flex: none; fill: var(--red); stroke: var(--red); stroke-width: 1; stroke-linejoin: round; }
.folder span { display: grid; gap: 2px; min-width: 0; }
.folder b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder small { font-size: 9px; color: var(--muted); letter-spacing: .1em; }
.home-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 18px 0 24px; }
.home-tabs button { background: none; border: 0; color: var(--muted); font: 700 11px var(--mono); letter-spacing: .1em; padding: 10px 0; cursor: pointer; }
.home-tabs button.is-active { color: var(--text); box-shadow: inset 0 -2px 0 var(--red); }
.home-empty { text-align: center; max-width: 640px; margin: 70px auto 0; }
.home-empty h3 { font-size: 18px; margin: 18px 0 8px; }
.home-empty p { color: var(--muted); margin: 0; }
.trash-art { display: inline-grid; place-items: center; width: 120px; height: 120px; border: 2px solid var(--red); box-shadow: 8px 8px 0 var(--red-dim); }
.trash-art svg { width: 64px; height: 64px; fill: none; stroke: var(--red); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* ── criar um design ── */
.create-dlg[open] { display: grid; grid-template-columns: 250px 1fr; width: min(1280px, 96vw); height: min(820px, 92vh); padding: 0; }
.create-side { padding: 26px 16px; border-right: 1px solid var(--line); overflow: auto; }
.create-title { font: 34px/1 var(--display); margin: 0 0 22px 8px; text-transform: uppercase; }
.create-cats { display: grid; gap: 2px; }
.create-cats button { text-align: left; padding: 10px 12px; background: none; border: 1px solid transparent; color: var(--text); font: 13px var(--sans); cursor: pointer; }
.create-cats button:hover { border-color: var(--line-2); }
.create-cats button.is-active { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--red); }
.create-main { display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.create-top { display: flex; gap: 10px; padding: 22px 26px 10px; }
.create-search { flex: 1; font-size: 15px; padding: 12px 14px; }
.create-x { font-size: 20px; }
.create-body { overflow: auto; padding: 4px 26px 30px; }
.create-h { font: 22px var(--display); text-transform: uppercase; letter-spacing: .02em; margin: 22px 0 12px; }
.quick-row { display: flex; gap: 18px; flex-wrap: wrap; }
.quick { display: grid; justify-items: center; gap: 8px; width: 92px; background: none; border: 0; color: var(--text); cursor: pointer; }
.quick-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-2); transition: border-color .15s, background .15s; }
.quick-ico svg { width: 24px; height: 24px; fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick:hover .quick-ico { border-color: var(--red); background: rgba(var(--red-rgb),.1); }
.quick small { font-size: 11px; text-align: center; }
.preset-row { display: grid; grid-auto-flow: column; grid-auto-columns: 220px; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.preset { display: grid; gap: 4px; text-align: left; background: none; border: 0; color: var(--text); cursor: pointer; padding: 0; }
.preset-art { display: grid; place-items: center; height: 168px; background: var(--panel-2); border: 1px solid var(--line); transition: border-color .15s; }
.preset:hover .preset-art { border-color: var(--red); }
.preset b { font-size: 13px; font-weight: 600; margin-top: 6px; }
.preset small { font-size: 9px; color: var(--muted); letter-spacing: .1em; }
.preset-frame {
  --paper: #161616; position: relative; background: var(--paper); border: 1px solid var(--line-2);
  box-shadow: 6px 6px 0 var(--red-dim); overflow: hidden;
}
.preset-frame i { position: absolute; left: 12%; height: 6%; min-height: 3px; background: var(--red); }
.preset-frame i:nth-child(1) { top: 16%; width: 52%; }
.preset-frame i:nth-child(2) { top: 30%; width: 34%; background: #8a8a8a; }
.preset-frame i:nth-child(3) { bottom: 12%; width: 76%; height: 28%; opacity: .35; }
.preset-frame.kind-table i:nth-child(3) { background: repeating-linear-gradient(90deg, var(--red) 0 1px, transparent 1px 20%), repeating-linear-gradient(0deg, var(--red) 0 1px, transparent 1px 25%); opacity: .8; height: 44%; }
.preset-frame.kind-whiteboard i:nth-child(3) { background: none; border: 2px solid var(--red); border-radius: 40% 60% 50% 40%; opacity: .8; }
.preset-frame.kind-upload { display: grid; place-items: center; }
.preset-frame.kind-upload::after { content: '+'; font: 40px var(--display); color: var(--red); }
.preset-frame.kind-upload i { display: none; }
.custom-wrap { max-width: 420px; }
.custom-size { display: grid; gap: 12px; }
.upload-drop { display: grid; gap: 8px; place-items: center; padding: 50px 20px; border: 1px dashed var(--line-2); cursor: pointer; }
.upload-drop:hover { border-color: var(--red); }
.upload-drop b { font-size: 14px; letter-spacing: .1em; }
.upload-drop span { font-size: 9px; color: var(--muted); letter-spacing: .1em; text-align: center; }
@media (max-width: 760px) {
  .home { grid-template-columns: 1fr; }
  .home-side { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .home-trash { margin-top: 0; }
  .create-dlg[open] { grid-template-columns: 1fr; }
  .create-side { display: none; }
}

.rail-btn.is-long { font-size: 8px; letter-spacing: .02em; }

/* shape library (03 FORMAS) */
.shape-search { width: 100%; margin: 14px 0 0; }
.shape-lib { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.shape-lib-btn { aspect-ratio: 1; padding: 8px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; display: grid; place-items: center; }
.shape-lib-btn:hover { border-color: var(--red); }
.shape-lib-btn svg { width: 100%; height: 100%; fill: var(--text); }
.shape-lib-btn:hover svg { fill: var(--red); }

/* tool flyouts v2: shape library and the pen rack */
.tool-fly.is-shapes { width: 268px; }
.fly-shapes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; max-height: min(420px, 60vh); overflow-y: auto; padding-right: 2px; }
.fly-shape { width: auto; height: auto; aspect-ratio: 1; margin: 0; padding: 7px; display: grid; place-items: center; }
.fly-shape svg { width: 100%; height: 100%; fill: var(--text); }
.fly-shape:hover svg, .fly-shape.is-active svg { fill: var(--red); }
.tool-fly:not(.is-shapes) { width: auto; padding: 10px 0 10px 0; overflow: visible; }
.pens { position: relative; display: grid; justify-items: start; gap: 10px; width: 132px; }
.pen-rack { display: grid; gap: 2px; width: 100%; overflow: hidden; }
.pen {
  width: 120px; height: 34px; padding: 0 0 0 0; margin-left: -34px; background: none; border: 0; cursor: pointer;
  transition: transform .32s cubic-bezier(.3, 1.7, .5, 1), filter .2s;
  filter: brightness(.75);
}
.pen svg { width: 100%; height: 100%; display: block; }
.pen:hover { transform: translateX(6px); filter: none; }
.pen.is-active { transform: translateX(20px); filter: drop-shadow(0 3px 6px rgba(0,0,0,.6)); }
.pen.is-picked { animation: pen-pick .45s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes pen-pick { 0% { transform: translateX(0) rotate(0); } 45% { transform: translateX(26px) rotate(-6deg); } 100% { transform: translateX(20px) rotate(0); } }
@media (prefers-reduced-motion: reduce) { .pen, .pen.is-picked { transition: none; animation: none; } }
.pen-color { width: 30px; height: 30px; margin-left: 14px; border-radius: 50%; border: 2px solid var(--panel); outline: 1px solid var(--line-2); cursor: pointer; }
.pen-more { display: grid; gap: 3px; width: 34px; height: 30px; margin-left: 12px; padding: 7px 8px; background: var(--panel-2); border: 1px solid var(--line-2); cursor: pointer; }
.pen-more i { display: block; height: 2px; background: var(--text); }
.pen-pop {
  position: absolute; left: calc(100% + 12px); bottom: 0; width: 260px; padding: 14px; z-index: 7;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0,0,0,.6);
}
.pen-swatches { display: grid; grid-template-columns: repeat(4, 28px); gap: 8px; justify-content: start; }
.pen-swatches .swatch { width: 28px; height: 28px; border-radius: 50%; }
.pen-swatches .cp-wrap { grid-column: 1 / -1; }
.pen-pop:has(.pen-swatches) { width: auto; }
.pen-swatches .swatch.is-active { outline: 2px solid var(--red); outline-offset: 2px; }
.pen-swatches input[type=color] { width: 100%; aspect-ratio: 1; height: auto; border: 1px solid var(--line-2); border-radius: 50%; padding: 0; background: none; cursor: pointer; }
.num-range { display: grid; gap: 6px; font-size: 13px; }
.num-range + .num-range { margin-top: 14px; }
.num-range div { display: grid; grid-template-columns: 1fr 58px; gap: 10px; align-items: center; }
.num-range input[type=number] { padding: 6px; text-align: center; }

/* ── edit bar: contextual actions for the selection (top of the stage) ── */
.edit-bar {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 7;
  display: flex; align-items: center; gap: 2px; padding: 4px; max-width: calc(100% - 24px); overflow-x: auto;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0,0,0,.5), 3px 3px 0 var(--red-dim);
  scrollbar-width: none;
}
.eb-btn {
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; white-space: nowrap; flex: none;
  background: none; border: 1px solid transparent; color: var(--text); font: 600 12px var(--sans); cursor: pointer;
}
.eb-btn:hover { background: var(--panel-2); border-color: var(--line-2); }
.eb-btn.is-open { background: var(--red); color: var(--on-red); }
.eb-btn svg, .mini-bar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* narrow stage: tighter buttons, then icon-only where an icon exists */
.edit-bar.is-tight .eb-btn { padding: 0 5px; font-size: 11px; }
.edit-bar.is-tight .eb-sep { margin: 0 1px; }
.edit-bar.is-tighter .eb-btn svg + span { display: none; }
.eb-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; flex: none; }

.mini-bar {
  position: absolute; z-index: 7; display: flex; gap: 2px; padding: 3px;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.mini-bar button { width: 32px; height: 30px; display: grid; place-items: center; padding: 0; background: none; border: 0; color: var(--text); cursor: pointer; }
.mini-bar button:hover { background: var(--panel-2); color: var(--red); }

.edit-pop {
  position: absolute; z-index: 8; width: 280px; max-height: calc(100% - 70px); overflow: auto; padding: 14px;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 14px 40px rgba(0,0,0,.6), 3px 3px 0 var(--red-dim);
  animation: pop-in .14s ease-out;
}
.edit-pop h4 { margin: 0 0 10px; font-size: 10px; color: var(--red); letter-spacing: .14em; }
.edit-pop h4:not(:first-child) { margin-top: 16px; }
.edit-pop .meta { margin: 10px 0 0; font-size: 10px; color: var(--muted); line-height: 1.5; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.pop-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pop-btns + .pop-btns { margin-top: 6px; }
.pop-color { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 13px; }
.pop-color input { width: 44px; height: 28px; padding: 0; border: 1px solid var(--line-2); background: none; cursor: pointer; }

.anim-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.anim-btn { display: grid; justify-items: center; gap: 6px; padding: 8px 2px 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.anim-btn:hover { border-color: var(--line-2); }
.anim-btn.is-active { border-color: var(--red); }
.anim-btn span { font-size: 8px; letter-spacing: .06em; }
.anim-demo { display: block; width: 22px; height: 22px; background: var(--red); }
.anim-demo.a-none { background: none; border: 2px solid var(--line-2); }
.anim-btn:hover .a-fade, .anim-btn.is-active .a-fade { animation: a-fade 1.2s infinite; }
.anim-btn:hover .a-rise, .anim-btn.is-active .a-rise { animation: a-rise 1.2s infinite; }
.anim-btn:hover .a-slide, .anim-btn.is-active .a-slide { animation: a-slide 1.2s infinite; }
.anim-btn:hover .a-pop, .anim-btn.is-active .a-pop { animation: a-pop 1.2s infinite; }
.anim-btn:hover .a-drop, .anim-btn.is-active .a-drop { animation: a-drop 1.2s infinite; }
.anim-btn:hover .a-spin, .anim-btn.is-active .a-spin { animation: a-spin 1.2s infinite; }
.anim-btn:hover .a-pulse, .anim-btn.is-active .a-pulse { animation: a-pulse 1.2s infinite; }
@keyframes a-fade { 0% { opacity: 0; } 60%, 100% { opacity: 1; } }
@keyframes a-rise { 0% { opacity: 0; transform: translateY(10px); } 60%, 100% { opacity: 1; transform: none; } }
@keyframes a-slide { 0% { opacity: 0; transform: translateX(-12px); } 60%, 100% { opacity: 1; transform: none; } }
@keyframes a-pop { 0% { opacity: 0; transform: scale(.3); } 45% { transform: scale(1.15); } 70%, 100% { opacity: 1; transform: none; } }
@keyframes a-drop { 0% { transform: translateY(-14px); } 40% { transform: none; } 55% { transform: translateY(-4px); } 70%, 100% { transform: none; } }
@keyframes a-spin { 0% { opacity: 0; transform: rotate(-90deg) scale(.6); } 60%, 100% { opacity: 1; transform: none; } }
@keyframes a-pulse { 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .anim-btn .anim-demo { animation: none !important; } }

.insp-group.is-flash { animation: flash .9s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: inset 0 0 0 2px var(--red); } 100% { box-shadow: none; } }

/* ── page bar (bottom right of the stage): zoom, Páginas, 2/8, grid, full screen, help ── */
.page-bar {
  position: absolute; right: 12px; bottom: 12px; z-index: 6; display: flex; align-items: center; gap: 4px; padding: 4px 6px;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.page-bar button { height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: none; border: 1px solid transparent; color: var(--text); cursor: pointer; font: 600 12px var(--sans); }
.page-bar button:hover { background: var(--panel-2); border-color: var(--line-2); }
.page-bar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#zoomSlider { width: 140px; accent-color: var(--red); margin: 0 4px; }
.pb-pct { min-width: 52px; justify-content: flex-end; font: 600 12px var(--mono) !important; }
.pb-pages { background: var(--panel-2) !important; border-color: var(--line-2) !important; }
.pb-pages.is-active { background: var(--red) !important; border-color: var(--red) !important; color: var(--on-red) !important; }
.pb-count { font: 600 12px var(--mono) !important; padding: 0 6px !important; }
.pb-icon { width: 32px; justify-content: center; padding: 0 !important; }
.pb-help { width: 26px; height: 26px !important; border: 1.5px solid var(--text) !important; border-radius: 50%; font: 700 13px var(--sans) !important; margin-left: 4px; }

.page-strip {
  position: absolute; left: 12px; right: 12px; bottom: 58px; z-index: 6; display: flex; gap: 10px; padding: 10px; overflow-x: auto;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 8px 24px rgba(0,0,0,.45); animation: pop-in .14s ease-out;
}
.pg-card { position: relative; flex: none; display: grid; justify-items: center; gap: 4px; padding: 0; background: none; border: 0; color: var(--muted); cursor: pointer; }
.pg-frame { display: grid; place-items: center; background: #050505; border: 2px solid var(--line-2); overflow: hidden; color: var(--muted); font: 300 30px var(--sans); }
.pg-frame canvas { display: block; }
.pg-card:hover .pg-frame { border-color: var(--muted); }
.pg-card.is-active .pg-frame { border-color: var(--red); }
.pg-card.is-active .pg-num { color: var(--red); }
.pg-card.is-drag { opacity: .4; }
.pg-card.is-over .pg-frame { border-color: var(--red); border-style: dashed; }
.pg-num { font-size: 10px; letter-spacing: .1em; }
.pg-more { position: absolute; top: 4px; right: 4px; width: 22px; height: 18px; display: none; place-items: center; background: rgba(0,0,0,.75); color: #fff; font-style: normal; font-size: 13px; line-height: 1; }
.pg-card:hover .pg-more, .pg-card:focus-visible .pg-more { display: grid; }
.pg-add .pg-frame { border-style: dashed; }
.pg-add:hover .pg-frame { color: var(--red); border-color: var(--red); }

.page-grid-dlg { width: min(980px, 94vw); }
.page-grid { display: flex; flex-wrap: wrap; gap: 16px; max-height: 64vh; overflow: auto; padding: 4px; margin: 10px 0; }
.help-dlg { width: min(560px, 94vw); }
.help-keys { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 12px 0; font-size: 11px; }
.help-keys dt { color: var(--red); }
.help-keys dd { margin: 0; color: var(--text); font-family: var(--sans); font-size: 13px; }

.present { position: fixed; inset: 0; z-index: 300; background: #000; cursor: pointer; }
.present canvas { width: 100%; height: 100%; display: block; }
.present:hover 
/* tighter top bar on smaller screens, so the open designs keep room */
@media (max-width: 1320px) {
  .brand-sub { display: none; }
  .topbar { gap: 12px; }
  .tab.is-active { width: 170px; }
}

/* arrows on the stage edges hide or show the side panels */
.edge-toggle {
  position: absolute; top: 50%; z-index: 6; width: 16px; height: 64px; transform: translateY(-50%); padding: 0;
  display: grid; place-items: center; background: var(--panel); color: var(--muted); border: 1px solid var(--line-2); cursor: pointer; font-size: 14px;
}
.edge-toggle:hover { color: var(--on-red); background: var(--red); border-color: var(--red); }
.edge-toggle.is-left { left: 0; border-left: 0; border-radius: 0 10px 10px 0; }
.edge-toggle.is-right { right: 0; border-right: 0; border-radius: 10px 0 0 10px; }

.top-name { flex: 0 1 170px; width: 170px; min-width: 70px; margin: 0; text-align: right; font-size: 11px; }

/* ───────── round 4 ───────── */

/* rail: section break before the apps, app buttons, scrolls when short */
.rail { overflow-y: auto; scrollbar-width: none; }
.rail-btn { padding: 12px 4px; flex: none; }
.rail-sep { padding: 10px 0 4px; font-size: 8px; letter-spacing: .2em; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }
.rail-btn.is-app { font-size: 8px; letter-spacing: .04em; }
.rail-btn.is-app svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rail-btn.is-app:hover svg { stroke: var(--text); }
.rail-btn.is-app.is-active svg { stroke: var(--red); }

/* colour inputs: a round swatch plus the rainbow "+" that opens our picker */
.cp-wrap { display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px; vertical-align: middle; width: auto; align-self: flex-start; }
input[type=color].cp-input {
  width: 28px !important; height: 28px !important; min-width: 28px; flex: none; padding: 0; border-radius: 50%;
  border: 1px solid var(--line-2); background: none; cursor: pointer; overflow: hidden; -webkit-appearance: none; appearance: none;
}
.cp-input::-webkit-color-swatch-wrapper { padding: 0; }
.cp-input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.cp-input::-moz-color-swatch { border: 0; border-radius: 50%; }
.cp-plus {
  position: relative; width: 28px; height: 28px; flex: none; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: conic-gradient(from 90deg, #ff2a2a, #ffb000, #f5f500, #2bd96b, #1fb5ff, #3a5bff, #b84dff, #ff2a9a, #ff2a2a);
}
.cp-plus::after {
  content: ''; position: absolute; inset: 4px; border-radius: 50%;
  --plus: var(--text);
  background: linear-gradient(var(--plus), var(--plus)) center / 10px 2px no-repeat, linear-gradient(var(--plus), var(--plus)) center / 2px 10px no-repeat, var(--panel);
}
.cp-plus:hover::after { background-color: var(--panel-2); }
.cp-plus:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.cp-pop {
  position: fixed; z-index: 60; width: 244px; padding: 12px; display: grid; gap: 10px;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0,0,0,.65), 3px 3px 0 var(--red-dim);
  animation: pop-in .14s ease-out;
}
.cp-sv { position: relative; height: 140px; cursor: crosshair; touch-action: none; }
.cp-sv canvas { width: 100%; height: 100%; display: block; }
.cp-knob, .cp-hue-knob {
  position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6); transform: translate(-50%, -50%); pointer-events: none;
}
.cp-hue {
  position: relative; height: 12px; border-radius: 6px; cursor: pointer; touch-action: none;
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.cp-hue-knob { top: 50%; background: transparent; }
.cp-row { display: flex; align-items: center; gap: 8px; }
.cp-now { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); }
.cp-hex { flex: 1; min-width: 0; padding: 6px 8px; text-transform: uppercase; }
.cp-drop { width: 32px; height: 30px; display: grid; place-items: center; padding: 0; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); cursor: pointer; }
.cp-drop:hover { border-color: var(--red); color: var(--red); }
.cp-drop svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cp-sets { display: grid; gap: 6px; max-height: 200px; overflow-y: auto; }
.cp-sets h5 { margin: 4px 0 0; font-size: 9px; letter-spacing: .14em; color: var(--muted); font-weight: 400; }
.cp-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.cp-swatches button { aspect-ratio: 1; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); cursor: pointer; }
.cp-swatches button:hover { outline: 2px solid var(--red); outline-offset: 1px; }

/* uploads recentes */
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.upload-card { position: relative; display: grid; gap: 3px; }
.upload-card > button:first-child {
  aspect-ratio: 1; padding: 0; overflow: hidden; cursor: pointer;
  background: repeating-conic-gradient(var(--check-a) 0 25%, var(--check-b) 0 50%) 0 0/12px 12px; border: 1px solid var(--line);
}
.upload-card > button:first-child:hover { border-color: var(--red); }
.upload-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-card > span { font-size: 9px; color: var(--muted); text-align: center; }
.upload-del {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; padding: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.75); border: 0; color: #fff; font-size: 14px; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.upload-card:hover .upload-del, .upload-del:focus-visible { opacity: 1; }
.upload-del:hover { background: var(--red); }

/* QR: padrão, cantos, logotipo */
.qr-h { margin: 16px 0 6px; font-size: 10px; letter-spacing: .14em; color: var(--muted); font-weight: 400; }
.qr-opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.qr-opt {
  aspect-ratio: 1; padding: 6px; display: grid; place-items: center; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
}
.qr-opt canvas { width: 100%; height: 100%; display: block; }
.qr-opt b { font: 400 22px/1 var(--sans); color: var(--red); }
.qr-opt:hover { border-color: var(--line-2); }
.qr-opt.is-active { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }

/* tool flyouts for Linha and Nota adesiva: one slim column */
.tool-fly.is-slim { width: auto; padding: 6px; }
.fly-col { display: grid; gap: 4px; }
.fly-opt {
  width: 44px; height: 44px; padding: 6px; display: grid; place-items: center; cursor: pointer;
  background: var(--panel-2); border: 1px solid transparent; color: var(--text);
}
.fly-opt:hover { border-color: var(--line-2); }
.fly-opt.is-active { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.fly-opt svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sticky-chip { position: relative; display: block; width: 28px; height: 28px; background: var(--paper); clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%); }
.sticky-chip::after { content: ''; position: absolute; right: 0; bottom: 0; width: 30%; height: 30%; background: rgba(0,0,0,.22); clip-path: polygon(0 0, 100% 0, 0 100%); }

/* item 9: the tools bar rises into place (and its buttons one after another) */
@keyframes rise-y { from { opacity: 0; transform: translateY(calc(-50% + 28px)); } to { opacity: 1; transform: translateY(-50%); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.toolbar:not([hidden]) { animation: rise-y .42s cubic-bezier(.2, .9, .3, 1.15) both; }
.toolbar.is-rising > * { animation: rise-in .36s cubic-bezier(.2, .9, .3, 1.2) both; }
.toolbar > :nth-child(2) { animation-delay: .03s; } .toolbar > :nth-child(3) { animation-delay: .06s; }
.toolbar > :nth-child(4) { animation-delay: .09s; } .toolbar > :nth-child(5) { animation-delay: .12s; }
.toolbar > :nth-child(6) { animation-delay: .15s; } .toolbar > :nth-child(7) { animation-delay: .18s; }
.toolbar > :nth-child(8) { animation-delay: .21s; } .toolbar > :nth-child(9) { animation-delay: .24s; }
.toolbar > :nth-child(n+10) { animation-delay: .27s; }
.tool-fly:not([hidden]) { animation: rise-y .34s cubic-bezier(.2, .9, .3, 1.15) both; }
.toolbar-show:not([hidden]) { animation: rise-in .3s ease-out both; }
@media (prefers-reduced-motion: reduce) { .toolbar, .toolbar > *, .tool-fly, .toolbar-show { animation: none !important; } }

/* signature */
.sig-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 600 16px var(--sans); }
.sig-back { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); font-size: 16px; cursor: pointer; }
.sig-back:hover { border-color: var(--red); color: var(--red); }
.sig-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.sig-tabs button { padding: 10px 2px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 600 12px var(--sans); cursor: pointer; }
.sig-tabs button:hover { color: var(--text); }
.sig-tabs button.is-active { color: var(--text); border-bottom-color: var(--red); }
.sig-body { display: grid; gap: 12px; }
.sig-preview { min-height: 110px; display: grid; place-items: center; padding: 12px; background: #f4f1ea; border: 1px solid var(--line-2); overflow: hidden; }
.sig-preview span { font-size: 40px; line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.sig-preview.is-checker { background: repeating-conic-gradient(#e6e6e6 0 25%, #fff 0 50%) 0 0/14px 14px; }
.sig-preview canvas { max-width: 100%; max-height: 160px; display: block; }
.sig-ink { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sig-dot { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); cursor: pointer; }
.sig-dot.is-active { outline: 2px solid var(--red); outline-offset: 2px; }
.sig-pad { width: 100%; aspect-ratio: 640 / 300; display: block; background: #f4f1ea; border: 1px solid var(--line-2); cursor: crosshair; touch-action: none; }
.sig-pad-tools { display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.sig-drop { display: grid; gap: 6px; place-items: center; text-align: center; padding: 26px 12px; border: 1px dashed var(--line-2); cursor: pointer; }
.sig-drop:hover { border-color: var(--red); }
.sig-drop b { font: 600 13px var(--sans); }
.sig-drop span { font-size: 9px; color: var(--muted); }
.sig-save { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; cursor: pointer; font-size: 13px; }
.sig-save input { position: absolute; opacity: 0; pointer-events: none; }
.sig-save i { position: relative; width: 34px; height: 18px; flex: none; border-radius: 9px; background: var(--line-2); transition: background .15s; }
.sig-save i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sig-save input:checked + i { background: var(--red); }
.sig-save input:checked + i::after { transform: translateX(16px); }
.sig-save input:focus-visible + i { outline: 2px solid var(--red); outline-offset: 2px; }
.sig-saved-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sig-card { position: relative; }
.sig-use { width: 100%; height: 64px; padding: 6px; display: grid; place-items: center; overflow: hidden; background: #f4f1ea; border: 1px solid var(--line); font-size: 22px; cursor: pointer; }
.sig-use:hover { border-color: var(--red); }
.sig-use img, .sig-use canvas { max-width: 100%; max-height: 100%; }
.sig-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; background: rgba(0,0,0,.7); border: 0; color: #fff; cursor: pointer; }
.sig-del:hover { background: var(--red); }

/* apps: Shape Cropper and Fisheye */
.app-preview { position: relative; aspect-ratio: 1; margin-bottom: 10px; border: 1px solid var(--line-2); display: grid; place-items: center; overflow: hidden; }
.app-preview.is-checker { background: repeating-conic-gradient(var(--check-a) 0 25%, var(--check-b) 0 50%) 0 0/16px 16px; }
.app-preview canvas { width: 100%; height: 100%; object-fit: contain; display: block; cursor: grab; touch-action: none; }
.app-preview canvas:active { cursor: grabbing; }
.app-preview p { position: absolute; margin: 0; font-size: 10px; color: var(--muted); pointer-events: none; }
.app-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 6px 8px; background: var(--panel-2); border: 1px solid var(--line); }
.app-name span { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-clear { padding: 2px 6px; background: none; border: 0; cursor: pointer; font-size: 14px; filter: grayscale(1); }
.app-clear:hover { filter: none; }
.app-source { display: grid; gap: 6px; margin-bottom: 10px; }
.app-panel .num-range { margin: 12px 0; }
.app-panel .toggle { margin: 10px 0; }
.sc-reset { margin-top: 4px; }
.sc-frames { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-bottom: 14px; }
#leftPanel { overflow-x: hidden; }
.sc-add { position: relative; z-index: 1; }
.sc-frame { min-width: 0; aspect-ratio: 1; padding: 5px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.sc-frame svg { width: 100%; height: 100%; fill: currentColor; }
.sc-frame b { font: 20px/1 var(--display); }
.sc-frame:hover { border-color: var(--line-2); color: var(--text); }
.sc-frame.is-active { border-color: var(--red); color: var(--red); }

/* elementos */
.el-search { margin: 0 0 6px; }
.el-head { display: flex; align-items: center; gap: 10px; margin: 8px 0; font: 600 15px var(--sans); }
.el-row { display: grid; grid-auto-flow: column; grid-auto-columns: 74px; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.el-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.el-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 6px; }
.el-tile { display: grid; gap: 4px; padding: 0; background: none; border: 0; color: var(--text); cursor: pointer; text-align: center; }
.el-thumb { aspect-ratio: 1; display: grid; place-items: center; padding: 8px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.el-thumb svg { width: 100%; height: 100%; }
.el-tile:hover .el-thumb { border-color: var(--red); }
.el-label { font-size: 10px; line-height: 1.2; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.el-tile:hover .el-label { color: var(--text); }
.el-tile.is-cat .el-thumb { padding: 0; border: 0; background: none; }
.el-tile.is-cat:hover .el-thumb { transform: translateY(-2px); transition: transform .15s; }
.el-line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* charts in the inspector */
.chart-data { min-height: 90px; resize: vertical; font-size: 12px; }
.chart-color-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* pages: hidden ones are dimmed and struck through */
.tab.is-hidden-page .tab-name { opacity: .5; text-decoration: line-through; }
.pg-card.is-hidden-page .pg-frame { opacity: .35; }
.pg-card.is-hidden-page .pg-num::after { content: ' · OCULTA'; }

/* topbar: Arquivo + Redimensionar */
.top-file { display: flex; gap: 6px; flex: none; }
.top-file .btn { padding: 10px 11px; }
@media (max-width: 1500px) { #resizeBtn .rs-label { display: none; } }
@media (max-width: 1640px) { .brand-sub { display: none; } }
.tabs { min-width: 0; justify-content: flex-start; align-self: center; align-items: center; padding-top: 0; }
.tabs .tab-recents { padding: 8px 12px; font-size: 11px; line-height: 1.4; }
@media (max-width: 1000px) { .top-name { display: none; } }

/* Arquivo ▸ Configurações / Acessibilidade */
.stage-wrap[data-bg=gray] { background-color: #3a3a3a; }
.stage-wrap[data-bg=light] { background-color: #e9e6e0; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: .001s !important; animation-delay: 0s !important; transition-duration: .001s !important; }
body.strong-focus :focus-visible { outline: 3px solid #ffd84d !important; outline-offset: 3px !important; }
body.big-ui { zoom: 1.12; }

/* dialogs: localizar, versões, redimensionar */
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin: 6px 0; }
.check input { accent-color: var(--red); width: 16px; height: 16px; }
.check-row { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.find-dlg { width: min(480px, calc(100vw - 32px)); }
.find-dlg .dialog-actions { flex-wrap: wrap; }
.versions-dlg { width: min(760px, calc(100vw - 32px)); }
.versions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; max-height: 60vh; overflow-y: auto; }
.version { display: grid; gap: 6px; justify-items: center; padding: 8px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.version:hover:not(:disabled) { border-color: var(--red); }
.version.is-current { border-color: var(--red); cursor: default; }
.version canvas { max-width: 100%; height: 96px; object-fit: contain; background: repeating-conic-gradient(var(--check-a) 0 25%, var(--check-b) 0 50%) 0 0/10px 10px; }
.version span { display: grid; gap: 2px; text-align: center; }
.version b { font-size: 10px; letter-spacing: .08em; }
.version small { font-size: 9px; color: var(--muted); }
.resize-dlg { width: min(520px, calc(100vw - 32px)); }
.resize-list { display: grid; max-height: 260px; overflow-y: auto; margin: 6px 0 12px; border: 1px solid var(--line); }
.rs-item { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); text-align: left; cursor: pointer; font: 13px var(--sans); }
.rs-item small { color: var(--muted); font-size: 10px; flex: none; }
.rs-item:hover { background: var(--panel-2); }
.rs-item.is-active { background: var(--red); color: var(--on-red); }
.rs-item.is-active small { color: var(--on-red); }

/* presentation notes */
.present-notes {
  position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%); width: min(760px, calc(100vw - 40px)); margin: 0;
  padding: 12px 16px; background: rgba(0,0,0,.78); border-left: 3px solid var(--red); color: #f2f2f2; font: 15px/1.45 var(--sans); white-space: pre-wrap;
}

/* Arquivo ▸ Imprimir: only the pages go to paper */
.print-area { display: none; }
@media print {
  body.is-printing > :not(.print-area) { display: none !important; }
  body.is-printing { display: block; background: #fff; }
  body.is-printing .print-area { display: block; }
  .print-area img { display: block; width: 100%; height: auto; page-break-after: always; break-after: page; }
  .print-area img:last-child { page-break-after: auto; break-after: auto; }
}

/* ───────── round 5 ───────── */
/* "+ ⌃" on the pages bar and strip: add a page, or one in another format */
.pb-add { display: inline-flex; height: 32px; border: 1px solid var(--line-2); }
.pb-add button { height: 100%; padding: 0 10px; background: none; border: 0; color: var(--text); cursor: pointer; font: 600 16px/1 var(--sans); }
.pb-add button + button { border-left: 1px solid var(--line-2); padding: 0 8px; font-size: 13px; }
.pb-add button:hover { background: var(--panel-2); color: var(--red); }
.pg-split { display: grid; grid-template-columns: 1fr auto; border: 1px dashed var(--line-2); }
.pg-split button { background: none; border: 0; color: var(--muted); cursor: pointer; font: 600 20px/1 var(--sans); }
.pg-split .pg-more-fmt { width: 26px; border-left: 1px dashed var(--line-2); font-size: 13px; }
.pg-split button:hover { color: var(--red); background: var(--panel-2); }
.pf-pop {
  position: fixed; z-index: 60; display: grid; grid-template-columns: repeat(3, 92px); gap: 6px; padding: 8px;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0,0,0,.6), 3px 3px 0 var(--red-dim);
  animation: pop-in .14s ease-out;
}
.pf-item { display: grid; justify-items: center; gap: 6px; padding: 10px 4px 8px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); cursor: pointer; font: 600 11px/1.15 var(--sans); text-align: center; }
.pf-item:hover, .pf-item:focus-visible { border-color: var(--red); outline: none; }
.pf-item i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--c); color: #fff; }
.pf-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Remover fundo: brush and the tray of photos */
.rm-stage.is-brush { cursor: none; }
.rm-brush { display: grid; gap: 10px; }
.rm-brush-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rm-bmode {
  display: grid; justify-items: center; gap: 6px; padding: 12px 6px; background: var(--panel-2); border: 1px solid var(--line-2);
  color: var(--text); font: 600 13px var(--sans); cursor: pointer;
}
.rm-bmode svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.rm-bmode:hover:not(:disabled) { border-color: var(--muted); }
.rm-bmode.is-active { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); color: var(--text); }
.rm-bmode.is-active[data-brush=erase] svg { stroke: var(--red); }
.rm-bmode.is-active[data-brush=restore] svg { stroke: #2bd96b; }
.rm-bmode:disabled { opacity: .4; cursor: not-allowed; }
.rm-brush .num-range { margin: 0; }
.rm-magic { margin: 0; }
.rm-magic small { display: block; font-size: 9px; color: var(--muted); }
.rm-brush .btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rm-del { color: var(--muted); }
.rm-del:hover { color: var(--red); border-color: var(--red); }
.rm-tray { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; }
.rm-tray[hidden] { display: none; }
.rm-tray-add {
  width: 56px; height: 56px; flex: none; background: var(--panel-2); border: 1px dashed var(--line-2); color: var(--text);
  font: 300 26px/1 var(--sans); cursor: pointer;
}
.rm-tray-add:hover { border-color: var(--red); color: var(--red); }
.rm-tray-list { display: flex; gap: 8px; overflow-x: auto; max-width: calc(100% - 70px); padding: 4px 2px; }
.rm-thumb { position: relative; flex: none; }
.rm-thumb > button:first-child {
  width: 56px; height: 56px; padding: 0; overflow: hidden; cursor: pointer;
  background: repeating-conic-gradient(var(--check-a) 0 25%, var(--check-b) 0 50%) 0 0/10px 10px; border: 2px solid var(--line-2);
}
.rm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rm-thumb.is-active > button:first-child { border-color: var(--red); }
.rm-thumb.is-busy > button:first-child::after { content: ''; position: absolute; inset: 2px; background: rgba(0,0,0,.45) linear-gradient(90deg, transparent, rgba(var(--red-rgb),.6), transparent) 0 0/200% 100%; animation: rm-busy 1s linear infinite; }
@keyframes rm-busy { to { background-position: -200% 0; } }
.rm-thumb-x {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0; border-radius: 50%;
  background: #000; border: 1px solid var(--line-2); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.rm-thumb:hover .rm-thumb-x, .rm-thumb.is-active .rm-thumb-x, .rm-thumb-x:focus-visible { opacity: 1; }
.rm-thumb-x:hover { background: var(--red); border-color: var(--red); }

/* round 5: Elementos ▸ 3D */
.el-tile.is-3d .el-thumb { position: relative; padding: 6px; background: radial-gradient(circle at 50% 40%, #2a2a2a, var(--panel-2)); }
.el-tile.is-3d .el-thumb img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.el-3d { position: absolute; right: 3px; bottom: 3px; padding: 1px 4px; font-size: 9px; font-style: normal; font-weight: 700; color: var(--on-red); background: var(--red); }
.el-sec { margin-top: 14px; }
.el-tile.is-3d:hover .el-thumb img { transform: translateY(-2px) scale(1.04); transition: transform .15s; }

/* round 5: phones. The editor is an app screen: a compact header, the design
   on top, the open panel as a sheet below it and the rail as a bottom bar. */
.rail-m { display: none; }
@media (max-width: 820px) {
  body { height: 100vh; height: 100dvh; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
  body.is-remove { height: auto; min-height: 100dvh; overflow: auto; grid-template-rows: auto 1fr; }
  .statusbar { display: none; }
  .topbar { flex-wrap: wrap; gap: 6px 8px; padding: 6px 10px; }
  .brand-mark { font-size: 20px; }
  .top-nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; gap: 0; }
  .top-nav::-webkit-scrollbar { display: none; }
  .top-nav a { flex: none; padding: 6px 10px; font-size: 10px; }
  .tabs { display: none; }
  body:not(.is-remove) .top-file { margin-left: auto; }
  .top-file .btn, .top-actions .btn { padding: 8px 9px; font-size: 10px; }
  .top-file #resizeBtn { display: none; }
  body.is-remove .top-file, body.is-remove .top-actions { display: none; }

  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; grid-template-areas: "stage" "sheet" "rail"; min-height: 0; height: 100%; }
  .workspace > #stageWrap { grid-area: stage; min-height: 0; }
  .workspace > #leftPanel, .workspace > #inspector { grid-area: sheet; max-height: 44dvh; overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px 18px; border-top: 1px solid var(--line-2); }
  .workspace > .rail { grid-area: rail; flex-direction: row; overflow-x: auto; scrollbar-width: none; border: 0; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .rail::-webkit-scrollbar { display: none; }
  .rail-btn, .rail-m { flex: 0 0 auto; min-width: 64px; padding: 8px 8px; border-bottom: 0; border-right: 1px solid var(--line); }
  .rail-btn.is-active { box-shadow: inset 0 3px 0 var(--red); }
  .rail-btn b { font-size: 16px; }
  .rail-btn.is-app svg { width: 18px; height: 18px; }
  .rail-sep { display: none; }
  .rail-m { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; color: var(--muted); cursor: pointer; font: 700 10px/1.2 var(--mono); letter-spacing: .1em; border-top: 0; border-left: 0; }
  .rail-m b { font: 16px/1 var(--sans); }
  .rail-m.is-active { color: var(--text); background: var(--panel); box-shadow: inset 0 3px 0 var(--red); }
  #inspector { display: none; }
  body.m-insp #inspector { display: block !important; }
  body.m-insp #leftPanel { display: none !important; }
  .edge-toggle { display: none; }
  .panel-title { font-size: 24px; margin-bottom: 10px; }

  .page-bar { left: 8px; right: 8px; bottom: 8px; justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
  #zoomSlider, .pb-pages span, #presentBtn { display: none; }
  .home-side { padding: 10px; gap: 8px; }
}
.rm-stage.is-brush, .rm-stage.is-compare { touch-action: none; }
/* iPhone zooms the page into any field under 16px; keep fields at 16px there */
@media (max-width: 820px) and (pointer: coarse) {
  input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea { font-size: 16px !important; }
}
/* tablets and small laptops: the top bar stays on one line and the page bar fits the stage */
.top-nav a { white-space: nowrap; }
.page-bar { max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; }
@media (max-width: 1100px) and (min-width: 821px) {
  .tabs { display: none; }
  .topbar { gap: 8px; padding: 0 10px; }
  .top-nav a { padding: 8px 7px; font-size: 10px; }
  .brand-mark { font-size: 22px; }
  #zoomSlider { width: 70px; }
  .pb-pages span { display: none; }
}
@media (max-width: 900px) and (min-width: 821px) { .top-file #resizeBtn, #zoomSlider { display: none; } .top-actions .btn, .top-file .btn { padding: 9px 9px; } }

/* ── round 6: themes (Configurações ▸ Tema, saved per profile) ── */
:root[data-theme="escuro"] {
  --bg: #0e1116; --panel: #151a21; --panel-2: #1b2029; --line: #262d38; --line-2: #343d4b;
  --text: #dfe4ec; --muted: #8893a3; --red: #ff4a4f; --red-rgb: 255, 74, 79; --red-dim: #7a2a2d;
  --bar: #0b0e12; --field: #10141a; --stage: #0a0d11; --dot: #1d232d; --check-a: #232a35; --check-b: #1a1f28;
}
:root[data-theme="claro"] {
  --bg: #f3f2ef; --panel: #ffffff; --panel-2: #f1f0ec; --line: #e2dfd8; --line-2: #c9c5bc;
  --text: #141414; --muted: #6b6b6b; --red: #d90f16; --red-rgb: 217, 15, 22; --red-dim: #f1b3b5;
  --bar: #fbfaf8; --field: #ffffff; --stage: #e7e5e0; --dot: #cdc9c0; --check-a: #e4e2dd; --check-b: #f4f3f0;
  color-scheme: light;
}
:root[data-theme="retro"] {
  --bg: #1f2530; --panel: #263042; --panel-2: #2e3a50; --line: #36445c; --line-2: #4b607f;
  --text: #e8d8c9; --muted: #a99d92; --red: #f3701e; --red-rgb: 243, 112, 30; --red-dim: #7a3a14;
  --bar: #1a2029; --field: #1d2431; --stage: #181d26; --dot: #2c3647; --check-a: #2e3a50; --check-b: #263042;
}
:root[data-theme="tech"] {
  --bg: #cfeeff; --panel: #f3fbff; --panel-2: #e2f4fd; --line: #b9def2; --line-2: #8cc6e6;
  --text: #0c3352; --muted: #4f7a96; --red: #1b9be0; --red-rgb: 27, 155, 224; --red-dim: #7fd04b; --on-red: #ffffff;
  --bar: #e9f7ff; --field: #ffffff; --stage: #bfe6fb; --dot: #a6d6ef; --check-a: #d8effb; --check-b: #f2faff;
  --aero-gloss: linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.55) 48%, rgba(255,255,255,.12) 52%, rgba(255,255,255,.35) 100%);
  --aero-glass: rgba(255,255,255,.58);
  color-scheme: light;
}
:root[data-theme="claro"] .grain { opacity: .25; }
:root[data-theme="claro"] .brand-mark, :root[data-theme="claro"] .panel-title { color: var(--text); }

/* ── round 6: Supergráfico style (Configurações ▸ Estilo) — the poster in
   photo 2: chunky rounded letters, full blobs of colour, pills and soft corners ── */
:root[data-style="super"] {
  --display: 'Bungee', 'Archivo Black', Impact, sans-serif;
  --radius: 12px; --radius-lg: 22px; --pill: 999px; --bw: 2px;
}
[data-style="super"] .btn, [data-style="super"] .chip, [data-style="super"] .top-nav a,
[data-style="super"] .tab-recents, [data-style="super"] .home-nav button, [data-style="super"] .home-trash,
[data-style="super"] .seg, [data-style="super"] .home-tabs button { border-radius: var(--pill); }
[data-style="super"] .btn { border-width: var(--bw); font-weight: 800; }
[data-style="super"] .btn.primary { box-shadow: 0 4px 0 var(--red-dim); }
[data-style="super"] .btn.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--red-dim); }
[data-style="super"] input:not([type=range]):not([type=checkbox]):not([type=radio]), [data-style="super"] select,
[data-style="super"] textarea, [data-style="super"] .input { border-radius: var(--radius); border-width: var(--bw); }
[data-style="super"] .top-nav a.is-active { background: var(--red); color: var(--on-red); border-color: var(--red); box-shadow: none; }
[data-style="super"] .rail { gap: 6px; padding: 8px 6px; }
[data-style="super"] .rail-btn { border-radius: var(--radius-lg); border: 0; }
[data-style="super"] .rail-btn.is-active { background: var(--red); color: var(--on-red); box-shadow: none; }
[data-style="super"] .rail-btn.is-active b { color: var(--on-red); }
[data-style="super"] .rail-btn b { font-size: 17px; }
[data-style="super"] .panel-title { font-size: 26px; letter-spacing: 0; }
[data-style="super"] .panel-title span { font-family: var(--mono); }
[data-style="super"] .home-title, [data-style="super"] .brand-mark { letter-spacing: 0; }
[data-style="super"] .brand-mark { font-size: 22px; }
[data-style="super"] .home-nav button.is-active, [data-style="super"] .home-trash.is-active { background: var(--red); color: var(--on-red); box-shadow: none; }
[data-style="super"] .home-card, [data-style="super"] .el-thumb, [data-style="super"] .dropzone, [data-style="super"] .upload-drop,
[data-style="super"] .tp-combo, [data-style="super"] .quick-ico, [data-style="super"] .sc-frame, [data-style="super"] .shape-lib-btn,
[data-style="super"] .rm-thumb, [data-style="super"] .pf-item, [data-style="super"] .home-empty, [data-style="super"] .rb-card,
[data-style="super"] .lock-note, [data-style="super"] .st-card { border-radius: var(--radius-lg); overflow: hidden; }
[data-style="super"] dialog, [data-style="super"] .dialog, [data-style="super"] .ctx-menu, [data-style="super"] .cp-pop,
[data-style="super"] .page-bar, [data-style="super"] .edit-bar, [data-style="super"] .mini-bar, [data-style="super"] .toolbar,
[data-style="super"] .tool-fly, [data-style="super"] .toast, [data-style="super"] .pf-pop, [data-style="super"] .edit-pop { border-radius: var(--radius-lg); }
[data-style="super"] .toast { border-left-width: 1px; border-color: var(--red); }
[data-style="super"] .page-bar button, [data-style="super"] .tb-btn, [data-style="super"] .eb-btn { border-radius: var(--radius); }
[data-style="super"] .home-create { border-radius: var(--radius-lg); }
[data-style="super"] .sub-title::after { height: 3px; border-radius: 3px; background: var(--red); opacity: .35; }
[data-style="super"] .edge-toggle { border-radius: 999px !important; }
[data-style="super"] .statusbar { font-weight: 700; }

/* ── Configurações (home ▸ ⚙) ── */
.home-settings { margin-top: 2px; }
.home-me { display: flex; align-items: center; gap: 10px; padding: 8px 6px; background: none; border: 1px solid transparent; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.home-me:hover { border-color: var(--line-2); }
.home-me small { display: block; color: var(--muted); font: 9px var(--mono); letter-spacing: .1em; }
.avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--c, var(--red)); color: #fff; font: 700 13px var(--sans); text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.avatar.has-photo { background-size: cover; background-position: center; }
/* the pencil on the profile photo (photo 2 of round 9) */
.av-edit { position: relative; flex: none; display: inline-grid; }
.av-edit .avatar { cursor: pointer; }
.av-pen { position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 2px solid var(--panel); background: var(--red); color: #fff; cursor: pointer; }
.av-pen svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.av-pen:hover { transform: scale(1.1); }
.av-del { font-size: 10px; }
.st-wrap { display: grid; gap: 28px; max-width: 980px; }
.st-sec h2 { font: 22px/1 var(--display); margin: 0 0 6px; }
.st-sec > p { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.st-me { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.st-me .input { max-width: 280px; font-size: 14px; }
.st-colors { display: flex; gap: 6px; }
.st-colors button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; }
.st-colors button.is-active { border-color: var(--text); }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.st-card { position: relative; display: grid; gap: 8px; padding: 10px; text-align: left; background: var(--panel); border: 1px solid var(--line-2); color: var(--text); cursor: pointer; font: inherit; }
.st-card:hover { border-color: var(--text); }
.st-card.is-active { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.st-card.is-active::after { content: '✓'; position: absolute; top: 8px; right: 10px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: var(--on-red); font-weight: 800; }
.st-card b { font-size: 13px; }
.st-card small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.st-swatch { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; height: 62px; border: 1px solid var(--line); }
.st-swatch i { display: block; }
.st-prev { height: 90px; display: grid; grid-template-columns: 26px 1fr; gap: 6px; padding: 8px; background: var(--bg); border: 1px solid var(--line); }
.st-prev .r { display: grid; gap: 4px; align-content: start; }
.st-prev .r i { height: 14px; background: var(--panel-2); }
.st-prev .r i:first-child { background: var(--red); }
.st-prev .m { display: grid; gap: 6px; align-content: start; }
.st-prev .m b { font: 15px/1 'Anton', sans-serif; }
.st-prev .m span { width: 70px; height: 16px; background: var(--red); }
.st-prev.is-super .r i { border-radius: 8px; }
.st-prev.is-super .m b { font-family: 'Bungee', sans-serif; font-size: 13px; }
.st-prev.is-super .m span { border-radius: 999px; }
.st-prev.is-super { border-radius: 14px; }
.st-profiles { display: grid; gap: 8px; max-width: 560px; }
.st-prof { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line-2); }
.st-prof.is-current { border-color: var(--red); }
.st-prof .grow { flex: 1; min-width: 0; }
.st-prof .grow small { display: block; color: var(--muted); font: 10px var(--mono); }
.st-toggles { display: grid; gap: 8px; }
.st-toggles label { display: flex; gap: 10px; align-items: center; font-size: 13px; cursor: pointer; }
[data-style="super"] .st-prof, [data-style="super"] .st-swatch { border-radius: var(--radius-lg); overflow: hidden; }
/* ARQUIVO sits in the nav, between ⌂ and EDITOR (editor only) */
.nav-file { flex: none; background: none; color: var(--text); border: 1px solid var(--line-2); font: 700 11px var(--mono); letter-spacing: .08em; padding: 8px 12px; cursor: pointer; margin: 0 6px 0 2px; }
.nav-file:hover { border-color: var(--text); }
[data-style="super"] .nav-file { border-radius: var(--pill); border-width: var(--bw); }
@media (max-width: 1100px) and (min-width: 821px) { .nav-file { padding: 8px 8px; font-size: 10px; } }
@media (max-width: 820px) { .nav-file { padding: 6px 10px; font-size: 10px; } }
.st-wrap { margin-top: 18px; }

/* ── round 7: full screen bar (zoom, pen, effects, laser, presenter, more) ── */
.present canvas#presentCanvas { transition: transform .25s ease; }
.present.has-side canvas#presentCanvas { width: calc(100% - 300px); }
.present.no-cursor, .present.no-cursor * { cursor: none; }
.present[data-tool=pen] .present-ink { cursor: crosshair; }
.present[data-tool=zoom] { cursor: zoom-in; }
.present[data-tool=laser] { cursor: none; }
.present-ink { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
.present-fxc { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.present-laser { position: absolute; z-index: 5; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #ff2a2a; box-shadow: 0 0 10px 4px rgba(255,42,42,.75), 0 0 28px 10px rgba(255,42,42,.35); pointer-events: none; }
.present-spot { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.present-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
  background: rgba(78, 80, 86, .92); backdrop-filter: blur(6px); color: #fff; cursor: default; transition: transform .25s ease, opacity .25s;
}
.present-bar.is-hidden { transform: translateY(100%); opacity: 0; }
.present-progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(255,255,255,.12); }
.present-progress i { display: block; height: 100%; width: 0; background: var(--red); transition: width .3s; }
.present-bar button { width: 36px; height: 36px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: #fff; cursor: pointer; }
.present-bar button:hover { background: rgba(255,255,255,.12); }
.present-bar button.is-on { background: rgba(255,255,255,.22); box-shadow: inset 0 -2px 0 var(--red); }
.present-bar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pbar-left, .pbar-right { display: flex; align-items: center; gap: 4px; }
.pbar-left span { font: 600 13px var(--mono); padding: 0 6px; min-width: 44px; text-align: center; }
.present-notes { bottom: 70px; z-index: 5; }
.present-side { position: absolute; top: 0; right: 0; bottom: 52px; width: 300px; z-index: 5; display: flex; flex-direction: column; gap: 8px; padding: 16px; background: #141414; border-left: 1px solid #333; color: #eee; cursor: default; overflow: auto; }
.present-side .ps-row { display: flex; justify-content: space-between; align-items: baseline; }
.present-side .ps-row span { font: 700 28px var(--mono); color: var(--red); }
.present-side small { color: #888; font-size: 10px; letter-spacing: .12em; margin-top: 8px; }
.present-side canvas { max-width: 100%; border: 1px solid #333; align-self: flex-start; }
.present-side p { margin: 0; font: 14px/1.5 var(--sans); white-space: pre-wrap; }
.ps-reset { margin-top: auto; background: none; border: 1px solid #444; color: #ddd; padding: 8px; font: 700 10px var(--mono); letter-spacing: .1em; cursor: pointer; }
.present .ctx-menu { z-index: 10; }

/* ── round 7: two-row window bar like Canva's app. Row 1: ⋯, home, the open
   projects as tabs, +, sections and the profile. Row 2 (editor only):
   Arquivo, Redimensionar, Recentes … name, undo/redo, Exportar. ── */
body { grid-template-rows: auto minmax(0, 1fr) 30px; }
.topbar { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; height: auto; }
.tb-row { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 12px; }
.tb-tabs { height: 44px; background: var(--bar); }
.tb-edit { height: 46px; gap: 10px; border-top: 1px solid var(--line); background: var(--panel); }
body.is-remove .tb-edit { display: none; }
.tb-tabs .brand { margin-right: 6px; }
.tb-tabs .brand-mark { font-size: 22px; }
.win-btn, .tb-tabs .nav-home, .me-btn, .dtab-add {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer; border-radius: var(--radius);
}
.win-btn:hover, .tb-tabs .nav-home:hover, .dtab-add:hover { color: var(--text); background: var(--panel-2); }
.win-btn.is-open { color: var(--text); background: var(--panel-2); border-color: var(--line-2); }
.win-btn svg, .tb-tabs .nav-home svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.win-btn svg circle { fill: currentColor; stroke: none; }
.tb-tabs .nav-home.is-active { color: var(--on-red); background: var(--red); border-color: var(--red); box-shadow: none; }
/* the home button says clearly that you are on Home, and a thin rule keeps it apart from the project tabs */
/* ⌂ is a tab like the project tabs: same height, flush against them, and its
   highlight never goes past the tab beside it; a 1px rule sits between */
.tb-tabs .nav-home { position: relative; align-self: flex-end; width: 44px; height: 38px; margin-right: 1px; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; }
.tb-tabs .nav-home::after { content: ''; position: absolute; right: -1px; top: 9px; bottom: 9px; width: 1px; background: var(--line-2); pointer-events: none; }
.tb-tabs .nav-home.is-active::after { display: none; }
.tb-tabs .nav-home.is-active { box-shadow: inset 0 2px 0 rgba(255,255,255,.25); }
.tb-tabs .nav-home + .dtabs { padding-top: 6px; }
.dtab-add { font-size: 20px; width: 30px; height: 30px; }
.dtabs { display: flex; align-items: flex-end; align-self: stretch; gap: 0; min-width: 0; flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; padding-top: 6px; }
.dtabs::-webkit-scrollbar { display: none; }
.dtab { position: relative; flex: 0 1 auto; max-width: 200px; min-width: 90px; height: 38px; display: flex; align-items: center; gap: 6px; padding: 0 4px 0 9px; color: var(--muted); background: transparent; border: 1px solid transparent; border-bottom: 0; cursor: pointer; font: 600 12px var(--sans); border-radius: var(--radius) var(--radius) 0 0; }
.dtab:hover { color: var(--text); background: var(--panel-2); }
.dtab.is-active { color: var(--text); background: var(--panel); border-color: var(--line); }
.dtab.is-active::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--red); }
.dtab:not(.is-active) + .dtab:not(.is-active)::after { content: ''; position: absolute; left: -2px; top: 10px; bottom: 10px; width: 1px; background: var(--line-2); }
.dtab i { flex: none; width: 16px; height: 16px; border-radius: 4px; background: var(--c, var(--red)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.dtab span { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtab button { flex: none; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; background: none; border: 0; color: inherit; cursor: pointer; font-size: 15px; border-radius: 4px; opacity: .7; }
.dtab button:hover { opacity: 1; background: var(--line-2); }
body.is-remove .dtab.is-active { background: transparent; border-color: transparent; color: var(--muted); }
body.is-remove .dtab.is-active::before { display: none; }
.tb-tabs .top-nav { margin-left: auto; flex: none; }
.tb-tabs .top-nav a { padding: 7px 10px; font-size: 10px; }
.me-btn { margin-left: 6px; border-radius: 50%; }
.me-btn .avatar { width: 30px; height: 30px; font-size: 12px; }
.me-btn:hover .avatar { box-shadow: 0 0 0 2px var(--text); }
.top-file { gap: 2px; }
.tb-link { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; background: none; border: 0; color: var(--text); font: 700 11px var(--mono); letter-spacing: .08em; cursor: pointer; border-radius: var(--radius); }
.tb-link:hover { background: var(--panel-2); }
.tb-link[aria-expanded=true] { background: var(--panel-2); }
.tb-edit .top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tb-edit .doc-name { flex: none; width: 240px; max-width: 30vw; margin: 0; text-align: left; }
@media (max-width: 1100px) { .tb-tabs .brand { display: none; } .tb-edit .doc-name { width: 170px; } .tb-link { padding: 0 9px; } }
@media (max-width: 820px) {
  body { grid-template-rows: auto minmax(0, 1fr); }
  .tb-tabs { height: 42px; padding: 0 6px; gap: 2px; }
  .tb-tabs .top-nav { order: 0; flex-basis: auto; overflow: visible; }
  .tb-tabs .top-nav a { padding: 6px 6px; font-size: 9px; }
  .dtab { min-width: 92px; flex-basis: auto; }
  .tb-edit { height: auto; flex-wrap: wrap; padding: 6px 8px; gap: 6px; }
  .tb-edit .doc-name { display: none; }
  .tb-link { padding: 0 8px; font-size: 10px; height: 30px; }
  .tb-edit .top-actions .btn { padding: 8px 9px; }
}
@media (max-width: 560px) { .tb-tabs .top-nav { display: none; } }
[data-style="super"] .dtab { border-radius: 14px 14px 0 0; }
[data-style="super"] .tb-link, [data-style="super"] .win-btn, [data-style="super"] .dtab-add { border-radius: var(--pill); }
[data-style="super"] .tb-tabs .nav-home { border-radius: 14px 14px 0 0; }

/* hover and pressed: the red themes brighten, the others only darken their own accent (no red) */
:root[data-theme="escuro"] { --accent-hover: #ff6a6e; --accent-press: #c93a3e; }
:root[data-theme="claro"] { --accent-hover: #b80c12; --accent-press: #8e090e; }
:root[data-theme="retro"], :root[data-theme="tech"], :root[data-theme="neon"], :root[data-theme="cyber"] {
  --accent-hover: color-mix(in srgb, var(--red) 82%, #000); --accent-press: color-mix(in srgb, var(--red) 64%, #000);
}
:root[data-theme="retro"] .present-laser, :root[data-theme="tech"] .present-laser, :root[data-theme="neon"] .present-laser, :root[data-theme="cyber"] .present-laser { background: var(--red); box-shadow: 0 0 10px 4px rgba(var(--red-rgb),.75), 0 0 28px 10px rgba(var(--red-rgb),.35); }
:root[data-theme="retro"] .ctx-item.is-danger:hover:not(:disabled), :root[data-theme="tech"] .ctx-item.is-danger:hover:not(:disabled),
:root[data-theme="neon"] .ctx-item.is-danger:hover:not(:disabled), :root[data-theme="cyber"] .ctx-item.is-danger:hover:not(:disabled) { color: var(--accent-hover); }
.rail-btn:active, .tb-link:active, .dtab:active, .win-btn:active, .chip:active, .btn:not(.primary):active { background: color-mix(in srgb, var(--panel-2) 70%, #000); }

/* ── round 7: theme Neon, from the NSVY poster: black, lime, hot pink, lavender ── */
:root[data-theme="neon"] {
  --bg: #050505; --panel: #0d0d10; --panel-2: #16161b; --line: #24242c; --line-2: #3a3a46;
  --text: #f3f3f3; --muted: #a7a4c9; --red: #c8f31d; --red-rgb: 200, 243, 29; --red-dim: #ff2d6f; --on-red: #0a0a0a;
  --bar: #000000; --field: #0a0a0d; --stage: #030303; --dot: #1d1d24; --check-a: #1b1b22; --check-b: #121217;
}
:root[data-theme="neon"] .brand-mark em { color: #ff2d6f; }
:root[data-theme="neon"] .panel-title span, :root[data-theme="neon"] .sub-title { color: #b9b6ff; }
:root[data-theme="neon"] .dtab.is-active::before { background: linear-gradient(90deg, #c8f31d, #ff2d6f 60%, #c77dff); }
:root[data-theme="neon"] .btn.primary { box-shadow: 3px 3px 0 #ff2d6f; }

/* ── round 7: theme Cyberpunk, from the holographic stickers: black cards,
   white type, a rainbow-foil accent and clipped corners ── */
:root[data-theme="cyber"] {
  --bg: #08080a; --panel: #101013; --panel-2: #18181c; --line: #26262c; --line-2: #3b3b43;
  --text: #f5f5f7; --muted: #8e8e98; --red: #a8e6ff; --red-rgb: 168, 230, 255; --red-dim: #7a6cff; --on-red: #08080a;
  --bar: #000000; --field: #0b0b0e; --stage: #050506; --dot: #1c1c22; --check-a: #1a1a20; --check-b: #121216;
  --holo: linear-gradient(115deg, #a8e6ff 0%, #c9b0ff 22%, #ffb8e8 42%, #fff2a8 60%, #b8ffd9 78%, #a8e6ff 100%);
}
@keyframes holo-shift { to { background-position: 200% 0; } }
:root[data-theme="cyber"] .btn.primary, :root[data-theme="cyber"] .rail-btn.is-active::after, :root[data-theme="cyber"] .tb-tabs .nav-home.is-active,
:root[data-theme="cyber"] .present-progress i { background: var(--holo); background-size: 200% 100%; border-color: transparent; color: #08080a; }
:root[data-theme="cyber"] .btn.primary:hover { animation: holo-shift 1.6s linear infinite; filter: brightness(.92); }
:root[data-theme="cyber"] .btn.primary:active { filter: brightness(.78); }
:root[data-theme="cyber"] .brand-mark em, :root[data-theme="cyber"] .panel-title span { background: var(--holo); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="cyber"] .dtab.is-active::before { background: var(--holo); }
:root[data-theme="cyber"] .btn, :root[data-theme="cyber"] .tb-link, :root[data-theme="cyber"] .page-bar, :root[data-theme="cyber"] .edit-bar, :root[data-theme="cyber"] .toast, :root[data-theme="cyber"] .st-card {
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
:root[data-theme="cyber"] .panel-title::after { content: ' ▲'; font-size: 10px; color: var(--muted); vertical-align: top; }

/* ── round 7: Páginas rises in (surgir) ── */
@keyframes strip-rise { from { opacity: 0; transform: translateY(26px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes thumb-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.page-strip:not([hidden]) { animation: strip-rise .32s cubic-bezier(.2, .9, .25, 1.15) both; }
.page-strip:not([hidden]) > * { animation: thumb-rise .3s ease-out both; }
.page-strip:not([hidden]) > :nth-child(2) { animation-delay: .03s; } .page-strip:not([hidden]) > :nth-child(3) { animation-delay: .06s; }
.page-strip:not([hidden]) > :nth-child(4) { animation-delay: .09s; } .page-strip:not([hidden]) > :nth-child(5) { animation-delay: .12s; }
.page-strip:not([hidden]) > :nth-child(n+6) { animation-delay: .15s; }
#pbAddMore.is-open, .pg-more-fmt.is-open { background: var(--panel-2); color: var(--red); }

/* ── round 7: Janela ▸ Minimizar keeps only the design ── */
body.is-compact { grid-template-rows: 0 minmax(0, 1fr) 0; }
body.is-compact .topbar, body.is-compact .statusbar, body.is-compact .rail, body.is-compact #leftPanel, body.is-compact #inspector, body.is-compact .edge-toggle { display: none !important; }
body.is-compact .workspace { grid-template-columns: 0 0 minmax(0, 1fr) 0; }
.present .present-side canvas { width: auto; height: auto; max-width: 100%; max-height: 170px; }
@media (min-width: 1101px) { .tb-link .rs-label { display: inline !important; } }

/* ── Frutiger Aero (theme id "tech"): "o futuro que nos foi prometido". Open sky
   with sun and clouds over a green hill, frosted glass windows with white rims,
   glossy gel buttons, bubbles and a clean humanist font ── */
:root[data-theme="tech"] {
  --display: 'Segoe UI', 'Frutiger', 'Myriad Pro', 'Trebuchet MS', 'Helvetica Neue', sans-serif;
  --sans: 'Segoe UI', 'Frutiger', 'Myriad Pro', 'Trebuchet MS', 'Helvetica Neue', sans-serif;
  --mono: 'Segoe UI', 'Frutiger', 'Myriad Pro', 'Trebuchet MS', sans-serif;
  --glass: rgba(255,255,255,.42); --glass-strong: rgba(246,252,255,.72); --glass-rim: rgba(255,255,255,.85);
  --glass-shadow: 0 8px 28px rgba(10,70,140,.22), inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 18px rgba(255,255,255,.35);
  --radius: 10px; --radius-lg: 18px;
}
:root[data-theme="tech"] body {
  background:
    radial-gradient(60% 45% at 12% 4%, rgba(255,255,240,.95) 0%, rgba(255,255,220,.45) 18%, rgba(255,255,255,0) 45%),
    radial-gradient(28% 9% at 22% 24%, rgba(255,255,255,.95), rgba(255,255,255,0) 70%),
    radial-gradient(22% 7% at 30% 21%, rgba(255,255,255,.9), rgba(255,255,255,0) 70%),
    radial-gradient(30% 9% at 78% 16%, rgba(255,255,255,.9), rgba(255,255,255,0) 70%),
    radial-gradient(20% 6% at 88% 12%, rgba(255,255,255,.85), rgba(255,255,255,0) 70%),
    radial-gradient(140% 55% at 30% 118%, #c6f07a 0%, #8fd14a 30%, #5cb22f 48%, rgba(92,178,47,0) 62%),
    radial-gradient(110% 45% at 85% 122%, #a6e35c 0%, #6cbd36 40%, rgba(108,189,54,0) 60%),
    linear-gradient(180deg, #1f7fd6 0%, #4aa9ef 32%, #9bd8ff 62%, #dff4ff 80%, #e9f8e0 100%) fixed;
}
:root[data-theme="tech"] body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 34% 30%, rgba(255,255,255,.95) 0 7%, transparent 9%) 6% 72% / 120px 120px no-repeat,
    radial-gradient(closest-side, rgba(210,240,255,.12) 0 70%, rgba(150,215,255,.35) 86%, rgba(255,255,255,.85) 96%, transparent 100%) 6% 72% / 120px 120px no-repeat,
    radial-gradient(circle at 34% 30%, rgba(255,255,255,.95) 0 7%, transparent 9%) 94% 26% / 170px 170px no-repeat,
    radial-gradient(closest-side, rgba(210,240,255,.12) 0 70%, rgba(150,215,255,.35) 86%, rgba(255,255,255,.85) 96%, transparent 100%) 94% 26% / 170px 170px no-repeat,
    radial-gradient(circle at 34% 30%, rgba(255,255,255,.95) 0 7%, transparent 9%) 72% 86% / 70px 70px no-repeat,
    radial-gradient(closest-side, rgba(210,240,255,.12) 0 70%, rgba(150,215,255,.35) 86%, rgba(255,255,255,.85) 96%, transparent 100%) 72% 86% / 70px 70px no-repeat,
    radial-gradient(circle at 34% 30%, rgba(255,255,255,.95) 0 7%, transparent 9%) 24% 12% / 50px 50px no-repeat,
    radial-gradient(closest-side, rgba(210,240,255,.12) 0 70%, rgba(150,215,255,.35) 86%, rgba(255,255,255,.85) 96%, transparent 100%) 24% 12% / 50px 50px no-repeat,
    conic-gradient(from 200deg at 10% 0%, rgba(255,255,255,0) 0deg, rgba(255,255,255,.18) 8deg, rgba(255,255,255,0) 16deg, rgba(255,255,255,.12) 30deg, rgba(255,255,255,0) 40deg);
  animation: aero-float 14s ease-in-out infinite alternate;
}
@keyframes aero-float { from { transform: translateY(0); } to { transform: translateY(-18px); } }
:root[data-theme="tech"] .grain { display: none; }

/* frosted glass windows with a white rim */
:root[data-theme="tech"] .rail, :root[data-theme="tech"] .panel, :root[data-theme="tech"] .home-side {
  background: var(--glass-strong); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  position: relative; z-index: 1; border-color: var(--glass-rim);
}
:root[data-theme="tech"] .page-bar, :root[data-theme="tech"] .edit-bar, :root[data-theme="tech"] .toast {
  background: var(--glass-strong); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--glass-rim); border-radius: 14px; box-shadow: var(--glass-shadow);
}
/* menus: the blur sits on a layer behind, because a blur on the menu itself
   would make its submenus position from the menu instead of the window */
:root[data-theme="tech"] .ctx-menu { background: transparent; border: 1px solid var(--glass-rim); border-radius: 14px; box-shadow: var(--glass-shadow); isolation: isolate; }
:root[data-theme="tech"] .ctx-menu::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
}
:root[data-theme="tech"] .ctx-sub::before { background: rgba(246,252,255,.96); }
:root[data-theme="tech"] .page-bar { z-index: 6; }
:root[data-theme="tech"] .home-main {
  position: relative; z-index: 1; margin: 14px; border-radius: 22px; border: 1px solid var(--glass-rim);
  background: rgba(255,255,255,.34); -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4); box-shadow: var(--glass-shadow);
}
:root[data-theme="tech"] .dialog { border: 1px solid var(--glass-rim); border-radius: 18px; box-shadow: 0 18px 50px rgba(10,70,140,.35), inset 0 1px 0 #fff; background: linear-gradient(180deg, #ffffff, #eef8ff); }
:root[data-theme="tech"] .dialog::backdrop { background: rgba(20,90,170,.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* the title bar and taskbar, like a glass window of the era */
:root[data-theme="tech"] .topbar {
  background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(228,244,255,.78) 50%, rgba(205,232,252,.72) 51%, rgba(220,240,255,.8) 100%);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.9), 0 2px 12px rgba(10,70,140,.18); position: relative; z-index: 2;
}
:root[data-theme="tech"] .statusbar {
  background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(190,226,250,.7) 50%, rgba(160,210,245,.72) 51%, rgba(200,232,252,.8));
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--glass-rim); position: relative; z-index: 2;
}
:root[data-theme="tech"] .dtab {
  border-radius: 9px 9px 0 0; border: 1px solid rgba(120,180,225,.6); border-bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(200,230,250,.55));
}
:root[data-theme="tech"] .dtab.is-active { background: linear-gradient(180deg, #ffffff, #e3f3ff); box-shadow: inset 0 1px 0 #fff, 0 -2px 8px rgba(10,70,140,.12); }
:root[data-theme="tech"] .dtab.is-active::before { background: linear-gradient(90deg, #1b9be0, #7fd04b); }

/* glossy gel buttons (kept as they were) */
:root[data-theme="tech"] .btn, :root[data-theme="tech"] .chip, :root[data-theme="tech"] .tb-link, :root[data-theme="tech"] .win-btn,
:root[data-theme="tech"] .dtab-add, :root[data-theme="tech"] .seg { border-radius: 10px; }
:root[data-theme="tech"] .btn { background-image: var(--aero-gloss); box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(12,51,82,.18); }
:root[data-theme="tech"] .btn.primary {
  background: var(--aero-gloss), linear-gradient(180deg, #5cc8ff, #1b9be0 55%, #0f7cc2);
  background-blend-mode: soft-light, normal; border-color: #0f7cc2; color: #fff; text-shadow: 0 1px 1px rgba(0,60,110,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 6px rgba(27,155,224,.45);
}
:root[data-theme="tech"] .btn.primary:hover { background: var(--aero-gloss), linear-gradient(180deg, #7ad6ff, #2aa8ea 55%, #1488cf); background-blend-mode: soft-light, normal; }
:root[data-theme="tech"] .btn.primary:active { background: linear-gradient(180deg, #0f7cc2, #1b8fd0); box-shadow: inset 0 2px 4px rgba(0,50,90,.4); }
:root[data-theme="tech"] .rail-btn.is-active { background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(200,236,255,.8)); box-shadow: inset 0 1px 0 #fff, 0 1px 4px rgba(27,120,190,.2); }
/* round orb buttons, like the back/forward and play buttons of the era */
:root[data-theme="tech"] .win-btn, :root[data-theme="tech"] .dtab-add, :root[data-theme="tech"] #undoBtn, :root[data-theme="tech"] #redoBtn {
  border-radius: 50%; width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center;
  background: radial-gradient(ellipse 70% 42% at 50% 22%, rgba(255,255,255,.75) 0%, rgba(255,255,255,.25) 80%, transparent 82%), linear-gradient(180deg, #6cc4ff, #1f86d6 60%, #3fa6ef);
  color: #fff; border: 1px solid #1a74c0; text-shadow: 0 1px 2px rgba(0,50,100,.6); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 2px 5px rgba(10,70,140,.35);
}
:root[data-theme="tech"] .me-btn .avatar { box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(10,70,140,.35); background-image: radial-gradient(circle at 50% 25%, rgba(255,255,255,.8), transparent 50%); }

/* type: clean and friendly, not condensed */
:root[data-theme="tech"] .brand-mark { font-weight: 700; letter-spacing: -.01em; }
:root[data-theme="tech"] .panel-title, :root[data-theme="tech"] .home-title, :root[data-theme="tech"] h1, :root[data-theme="tech"] h2 { font-weight: 300; letter-spacing: -.01em; text-transform: none; }
:root[data-theme="tech"] .brand-mark em, :root[data-theme="tech"] .panel-title span {
  background: linear-gradient(180deg, #4fc3ff, #0f7cc2 60%, #57b82e); -webkit-background-clip: text; background-clip: text; color: transparent;
}
:root[data-theme="tech"] .brand-mark, :root[data-theme="tech"] .panel-title { color: var(--text); }
:root[data-theme="tech"] .present-progress i { background: linear-gradient(90deg, #1b9be0, #7fd04b); }
:root[data-theme="tech"] .st-card, :root[data-theme="tech"] .shape-btn, :root[data-theme="tech"] .qr-opt, :root[data-theme="tech"] .brush-btn, :root[data-theme="tech"] .tool-card {
  border-radius: 12px; background-image: var(--aero-gloss); border-color: rgba(140,198,230,.9);
}
:root[data-theme="tech"] .stage-wrap:not([data-bg=gray]):not([data-bg=light]) {
  background: radial-gradient(circle at 1px 1px, rgba(255,255,255,.75) 1px, transparent 0) 0 0/22px 22px, linear-gradient(180deg, rgba(150,210,245,.55), rgba(214,240,252,.5));
}

:root[data-theme="tech"] .tb-tabs .nav-home {
  border-radius: 9px 9px 0 0; border: 1px solid rgba(120,180,225,.6); border-bottom: 0; color: #1a74c0;
  background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(200,230,250,.55));
}
:root[data-theme="tech"] .tb-tabs .nav-home::after { background: rgba(26,116,192,.45); }
:root[data-theme="tech"] .tb-tabs .nav-home.is-active {
  color: #fff; border-color: #3f9a1f; text-shadow: 0 1px 2px rgba(20,80,10,.6);
  background: radial-gradient(ellipse 80% 40% at 50% 18%, rgba(255,255,255,.75) 0%, rgba(255,255,255,.2) 80%, transparent 82%), linear-gradient(180deg, #a6ec6a, #4fb82a 60%, #7fd04b);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

/* ── round 8: floating windows (Configurações, pincéis, temporizador, texto…) ── */
.float-win {
  position: fixed; z-index: 200; display: flex; flex-direction: column; min-width: 220px; min-height: 120px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
  background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius-lg, 0);
  box-shadow: 0 18px 50px rgba(0,0,0,.55), 4px 4px 0 var(--red-dim); resize: both; overflow: hidden;
  opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .18s ease, transform .22s cubic-bezier(.2,.9,.3,1.15);
}
.float-win.is-in { opacity: 1; transform: none; }
.float-win.is-moving { transition: none; box-shadow: 0 26px 60px rgba(0,0,0,.6), 4px 4px 0 var(--red); }
.fw-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); background: var(--bar); cursor: grab; user-select: none; touch-action: none; }
.float-win.is-moving .fw-head { cursor: grabbing; }
.fw-title { flex: 1; font: 600 13px var(--sans); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-close { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; border-radius: var(--radius); }
.fw-close:hover { color: var(--text); background: var(--panel-2); }
.fw-body { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.float-win.is-settings .st-wrap { margin-top: 0; gap: 24px; }
.float-win.is-settings .st-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* Estender imagem */
.ext-pop { display: grid; gap: 10px; width: min(330px, 80vw); }
.ext-sides { display: grid; grid-template-columns: 1fr 160px 1fr; grid-template-rows: auto 120px auto; gap: 6px; align-items: center; justify-items: center; }
.ext-sides label { display: grid; gap: 3px; font-size: 10px; color: var(--muted); text-align: center; }
.ext-sides input { width: 70px; padding: 5px; text-align: center; }
.ext-top { grid-column: 2; grid-row: 1; } .ext-bottom { grid-column: 2; grid-row: 3; }
.ext-left { grid-column: 1; grid-row: 2; } .ext-right { grid-column: 3; grid-row: 2; }
.ext-prev { grid-column: 2; grid-row: 2; width: 160px; height: 120px; background: repeating-conic-gradient(var(--check-a) 0 25%, var(--check-b) 0 50%) 0 0/12px 12px; border: 1px solid var(--line); }
.ext-pop .ext-size { margin: 0; }
.ext-pop .check { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.ext-pop .btn-row { justify-content: flex-end; }
.edit-pop:has(.ext-pop) { width: auto; }
.save-as .sa-where { border: 0; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.save-as .sa-where .check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 10px; border: 1px solid var(--line); }
.save-as .sa-where .check:has(input:checked) { border-color: var(--red); }
.save-as .sa-where b { display: block; font-size: 13px; }
.save-as .sa-where small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.4; }

/* tooltips with the shortcut written as keys */
.ui-tip {
  position: fixed; z-index: 9999; display: grid; justify-items: center; gap: 6px; max-width: 260px; padding: 8px 10px; pointer-events: none;
  background: #1b1b1f; color: #f2f2f2; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.45);
  font: 600 12px/1.3 var(--sans); text-align: center; animation: tip-in .12s ease-out;
}
.ui-tip-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; font-weight: 400; color: #b9b9c0; font-size: 11px; align-items: center; }
.ui-tip kbd { min-width: 22px; padding: 2px 6px; border-radius: 5px; background: #2c2c33; border: 1px solid #45454f; border-bottom-width: 2px; color: #f2f2f2; font: 600 11px/1.3 var(--sans); text-align: center; }
@keyframes tip-in { from { opacity: 0; transform: translateY(-3px); } }

/* ── text bar (photo 4): font, size, colour, B I U S, aA, align, list, spacing ── */
.eb-btn.is-on { background: rgba(var(--red-rgb), .16); border-color: rgba(var(--red-rgb), .55); color: var(--text); }
.eb-btn.eb-font { min-width: 108px; max-width: 150px; justify-content: space-between; border-color: var(--line-2); }
.eb-btn.eb-font span { overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 400; }
.eb-btn.eb-font::after { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); flex: none; }
.eb-size { display: flex; align-items: center; flex: none; border: 1px solid var(--line-2); margin: 0 2px; }
.eb-size .eb-btn { width: 24px; padding: 0; justify-content: center; font-size: 16px; border: 0; }
.eb-size input { width: 40px; height: 32px; padding: 0 2px; text-align: center; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: none; -moz-appearance: textfield; }
.eb-size input::-webkit-inner-spin-button, .eb-size input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.eb-btn[data-ink] { --ink: #fff; }
[data-style="super"] .eb-size { border-radius: var(--radius); overflow: hidden; }
.font-list { display: grid; gap: 2px; max-height: 300px; overflow: auto; margin-top: 8px; }
.font-opt { text-align: left; padding: 7px 10px; font-size: 17px; background: none; border: 1px solid transparent; color: var(--text); cursor: pointer; }
.font-opt:hover { background: var(--panel-2); border-color: var(--line-2); }
.font-opt.is-active { border-color: var(--red); }
.pop-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.pop-swatches button { width: 26px; height: 26px; border: 1px solid var(--line-2); border-radius: 50%; cursor: pointer; padding: 0; }
/* advanced text settings window */
.is-text-adv .fw-body { display: grid; gap: 12px; }
.ta-prev { width: 100%; height: auto; border: 1px solid var(--line-2); background: var(--panel-2); }
.ta-form { display: grid; gap: 12px; }
.ta-form .num-range + .num-range { margin-top: 0; }
.ta-choice { display: grid; gap: 6px; font-size: 13px; }
.ta-choice > span { font-size: 10px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.ta-choice .chip { min-width: 52px; }
.ta-all { padding-top: 10px; border-top: 1px solid var(--line); }
.ta-btns { justify-content: flex-end; }
.is-text-adv .ta-btns { position: sticky; bottom: -16px; margin: 0 -16px -16px; padding: 10px 16px; background: var(--panel); border-top: 1px solid var(--line); }
/* still too wide (the text bar on a narrow stage): two rows instead of hidden buttons */
.edit-bar.is-wrap { flex-wrap: wrap; justify-content: center; width: max-content; overflow: visible; row-gap: 2px; }
.edit-bar.is-tight .eb-btn:not(:has(span)) { padding: 0 4px; }
.edit-bar.is-tight .eb-btn.eb-font { min-width: 96px; }

/* border style chooser (photo 7) */
.border-styles { display: flex; gap: 6px; margin-bottom: 14px; }
.bs-opt { flex: 1; height: 40px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); cursor: pointer; padding: 0; }
.bs-opt svg { width: 26px; height: 26px; fill: none; stroke: currentColor; }
.bs-opt:hover { border-color: var(--line-2); }
.bs-opt.is-active { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
[data-style="super"] .bs-opt { border-radius: var(--radius); }

/* ── CAMADAS like Photoshop (photo 15) ── */
.lp-top { display: grid; gap: 8px; padding: 10px; margin-bottom: 8px; background: var(--panel-2); border: 1px solid var(--line); }
.lp-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lp-row select.input { padding: 5px 6px; font-size: 12px; min-width: 0; flex: 1; }
.lp-kind { display: flex; align-items: center; gap: 8px; flex: 1; }
.lp-kind span, .lp-lbl { font-size: 9px; letter-spacing: .12em; color: var(--muted); }
.lp-num { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.lp-num input { width: 50px; padding: 4px 2px; text-align: center; font-size: 12px; }
.lp-lockbtn, .lp-act, .lp-eye, .lp-lock, .lp-caret { display: grid; place-items: center; padding: 0; background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer; }
.lp-lockbtn { width: 26px; height: 26px; flex: none; }
.lp-lockbtn svg, .lp-act svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lp-lockbtn:hover:not(:disabled), .lp-act:hover:not(:disabled) { color: var(--text); border-color: var(--line-2); }
.lp-lockbtn.is-on, .lp-act.is-on { color: var(--red); border-color: var(--red); }
.lp-lockbtn:disabled, .lp-act:disabled { opacity: .35; cursor: default; }
.layer-list .layer-item { gap: 6px; padding: 4px 6px; }
.layer-item .lp-eye { width: 24px; height: 24px; }
.layer-item .lp-eye svg, .layer-item .lp-lock svg, .lp-caret svg, .lp-group > svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.layer-item .lp-eye:hover, .layer-item .lp-lock:hover { color: var(--text); }
.layer-item .lp-lock { width: 22px; height: 22px; opacity: .35; }
.layer-item .lp-lock.is-on { opacity: 1; color: var(--red); }
.layer-item:hover .lp-lock { opacity: .8; }
.lp-th { flex: none; display: grid; place-items: center; width: 46px; height: 34px; border: 1px solid var(--line-2);
  background: repeating-conic-gradient(#3a3a3a 0 25%, #2a2a2a 0 50%) 0 0 / 10px 10px; }
.lp-thumb { display: block; }
.layer-item.is-hidden .lp-th { opacity: .4; }
.layer-item.is-grouped { margin-left: 18px; }
.layer-item.is-grouped .nm::before { content: none; }
.layer-item.is-mask .lp-th { outline: 2px dashed var(--red); outline-offset: -3px; }
.lp-group { background: var(--panel); }
.lp-group > svg { color: var(--red); }
.lp-caret { width: 18px; height: 22px; transition: transform .15s; transform: rotate(-90deg); }
.lp-caret.is-open { transform: none; }
.layer-item.is-dragging { opacity: .4; }
.layer-item.drop-above { box-shadow: inset 0 3px 0 var(--red); }
.layer-item.drop-below { box-shadow: inset 0 -3px 0 var(--red); }
.lp-bottom { position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 2px; margin-top: 8px; padding: 6px; background: var(--panel-2); border: 1px solid var(--line); }
.lp-act { width: 30px; height: 30px; }
[data-style="super"] .lp-top, [data-style="super"] .lp-bottom { border-radius: var(--radius); }

/* ── notas e temporizador (photo 5) ── */
.is-timer .fw-body { display: grid; gap: 12px; }
.tm-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line-2); }
.tm-tabs button { padding: 8px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 600 13px var(--sans); cursor: pointer; }
.tm-tabs button.is-active { color: var(--text); border-bottom-color: var(--red); }
.tm-pane { display: grid; gap: 12px; justify-items: center; }
.tm-pane[data-pane="notes"] { justify-items: stretch; }
.tm-pane[hidden] { display: none; }
.tm-page { margin: 0; font-size: 10px; color: var(--muted); }
.tm-notes { resize: vertical; min-height: 120px; font: 13px/1.5 var(--sans); }
.tm-sound { display: flex; align-items: center; gap: 8px; width: 100%; }
.tm-sound select { flex: 1; padding: 5px 6px; font-size: 12px; }
.tm-sound input { width: 70px; accent-color: var(--red); }
.tm-ring { --p: 1; width: 150px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--red) calc(var(--p) * 360deg), var(--line) 0); }
.tm-ring::before { content: ''; grid-area: 1 / 1; width: calc(100% - 14px); aspect-ratio: 1; border-radius: 50%; background: var(--panel); }
.tm-time { grid-area: 1 / 1; z-index: 1; font-size: 34px; font-weight: 700; letter-spacing: .02em; }
.tm-step { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.tm-step .btn { width: 34px; padding: 6px 0; font-size: 16px; }
.tm-ctrl { display: flex; gap: 8px; }
.tm-ctrl .btn { min-width: 52px; font-size: 16px; }
.timer-pill { position: absolute; left: 14px; bottom: 16px; z-index: 150; padding: 6px 14px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--text); font: 700 15px var(--mono); cursor: pointer; box-shadow: 0 8px 22px rgba(0,0,0,.45); border-radius: 999px; }
.timer-pill.is-paused { opacity: .7; }
.timer-pill.is-done { background: var(--red); color: var(--on-red); animation: tm-blink .5s 6 alternate; }
@keyframes tm-blink { to { transform: scale(1.08); } }

/* ── seleção, régua, contagem e caneta: options next to the tool bar ── */
.tool-fly.is-pro { width: 252px; padding: 12px; overflow: auto; display: grid; gap: 10px; align-content: start; }
.tool-fly.is-pro .fly-hint { margin: 0; line-height: 1.5; letter-spacing: .06em; text-transform: none; font-size: 10px; }
.fly-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.fly-chips .fly-opt { width: 36px; height: 36px; }
.fly-chips .fly-opt svg { width: 20px; height: 20px; stroke-width: 1.7; }
.fly-title { margin: 0; font-size: 10px; letter-spacing: .14em; color: var(--red); }
.fly-range { display: grid; gap: 4px; font-size: 12px; }
.fly-range input { width: 100%; accent-color: var(--red); }
.fly-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.fly-acts .btn { padding: 6px 8px; font-size: 11px; }
.tool-fly.is-pro .check { margin: 0; font-size: 12px; }
.tool-fly.is-pro .pop-color { margin-top: 0; font-size: 12px; }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 12px; }
.rule-grid span { display: flex; justify-content: space-between; gap: 6px; padding: 4px 6px; background: var(--panel-2); border: 1px solid var(--line); }
.rule-grid i { font-style: normal; color: var(--muted); }
.rule-scale { display: grid; gap: 6px; }
.rule-scale-row { display: grid; grid-template-columns: 1fr auto 1fr 46px; gap: 4px; align-items: center; font-size: 11px; color: var(--muted); }
.rule-scale-row[hidden] { display: none; }
.rule-scale-row input { padding: 4px; font-size: 12px; min-width: 0; }
.count-row { display: grid; grid-template-columns: 1fr auto 36px; gap: 6px; align-items: center; }
.count-row select { padding: 5px; font-size: 12px; min-width: 0; }
.count-row input[type=color] { width: 36px; height: 30px; padding: 0; border: 1px solid var(--line-2); background: none; }
.tool-fly.is-pro { max-height: calc(100% - 24px); }

/* ── brush settings / presets windows (Alt+B, Alt+Shift+B) ── */
.bw-h { font-size: 9px; letter-spacing: .12em; color: var(--muted); margin: 0 0 6px; }
.bw-tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; max-height: 136px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; }
.bw-tip { aspect-ratio: 1; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 4px; background: var(--panel-2, rgba(127,127,127,.08)); cursor: pointer; transition: border-color .15s, transform .15s; }
.bw-tip canvas { width: 32px; height: 32px; }
.bw-tip:hover { border-color: var(--line-2); transform: translateY(-1px); }
.bw-tip.is-active { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.bw-row { display: grid; grid-template-columns: 96px 1fr 58px 18px; align-items: center; gap: 8px; font-size: 12px; margin: 6px 0; }
.bw-row input[type=range] { width: 100%; accent-color: var(--red); }
.bw-row input[type=number] { width: 58px; padding: 4px 6px; font-size: 11px; }
.bw-row i { font-style: normal; color: var(--muted); font-size: 11px; }
.bw-nums .bw-row { grid-template-columns: 1fr 58px 18px; }
.bw-flip { display: flex; gap: 18px; }
.bw-dialrow { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.bw-dial { width: 120px; height: 120px; flex: none; cursor: grab; touch-action: none; border-radius: 50%; }
.bw-nums { flex: 1; min-width: 0; }
.bw-prev { width: 100%; height: 90px; display: block; border: 1px solid var(--line); border-radius: 6px; background: repeating-conic-gradient(rgba(127,127,127,.08) 0 25%, transparent 0 50%) 0 0 / 14px 14px; margin: 8px 0 10px; }
.brush-wins { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.brush-wins .btn { flex: 1; font-size: 10px; }
.brush-wins kbd { opacity: .6; margin-left: 4px; font-size: 9px; }
.pen-gear { width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: none; color: var(--text); cursor: pointer; border-radius: 50%; transition: transform .3s; }
.pen-gear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.pen-gear:hover { transform: rotate(60deg); color: var(--red); }
.bp-q { width: 100%; margin: 4px 0 8px; }
.bp-list { display: grid; gap: 2px; max-height: 360px; overflow: auto; margin-bottom: 10px; }
.bp-folder { display: flex; align-items: center; gap: 6px; padding: 6px 4px; border: 0; background: none; color: var(--text); font-size: 12px; text-align: left; cursor: pointer; border-radius: 4px; }
.bp-folder:hover { background: rgba(127,127,127,.1); }
.bp-folder svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; flex: none; }
.bp-folder svg:first-child { transform: rotate(-90deg); transition: transform .2s; }
.bp-folder.is-open svg:first-child { transform: none; }
.bp-folder span { flex: 1; }
.bp-folder i { font-style: normal; color: var(--muted); font-size: 10px; }
.bp-item { position: relative; display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 8px; padding: 3px 8px 3px 26px; border: 1px solid transparent; background: none; color: var(--text); font-size: 12px; text-align: left; cursor: pointer; border-radius: 4px; }
.bp-item canvas { width: 110px; height: 25px; }
.bp-item i { font-style: normal; color: var(--muted); font-size: 10px; }
.bp-item:hover { background: rgba(127,127,127,.1); }
.bp-item.is-active { border-color: var(--red); background: rgba(229,20,27,.08); }
.bp-del { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; display: none; place-items: center; border-radius: 50%; background: var(--red); color: #fff; font-size: 12px; }
.bp-item:hover .bp-del { display: grid; }
.bp-item:hover:has(.bp-del) i { visibility: hidden; }

/* ── Controle 3D window ── */
.m3-view { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: radial-gradient(circle at 50% 35%, #232323, #0b0b0b); margin-bottom: 8px; }
.m3-canvas { display: block; width: 100%; aspect-ratio: 600 / 440; cursor: grab; touch-action: none; }
.m3-canvas:active { cursor: grabbing; }
.m3-hint { position: absolute; left: 0; right: 0; bottom: 6px; margin: 0; text-align: center; font-size: 8px; letter-spacing: .12em; color: rgba(255,255,255,.45); pointer-events: none; }
.m3-views { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.m3-views .btn { flex: 1 1 auto; padding: 5px 7px; font-size: 10px; }
.m3-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.m3-color { display: flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.m3-color input { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none; cursor: pointer; }
.m3-mats { margin: 4px 0 8px; }
.m3-sliders .bw-h { margin-top: 10px; }

/* ── Animar window (photos 20–22) ── */
.aw-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 8px; background: rgba(127,127,127,.12); margin-bottom: 12px; }
.aw-tabs button { border: 0; padding: 8px 6px; border-radius: 6px; background: none; color: var(--muted); font: 600 13px var(--font-ui, Inter), sans-serif; cursor: pointer; transition: background .2s, color .2s; }
.aw-tabs button.is-active { background: var(--panel, #1c1c1c); color: var(--text); box-shadow: inset 0 -2px 0 var(--red); }
.aw-h { margin: 14px 0 8px; font: 700 13px var(--font-ui, Inter), sans-serif; color: var(--text); }
.aw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.aw-tile { display: grid; justify-items: center; gap: 4px; padding: 8px 4px 6px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--text); cursor: pointer; transition: border-color .15s, transform .15s; }
.aw-tile:hover { border-color: var(--line-2); transform: translateY(-1px); }
.aw-tile.is-active { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.aw-tile svg { width: 56px; height: 56px; overflow: visible; }
.aw-tile span { font-size: 11px; text-align: center; line-height: 1.2; }
.aw-img { fill: #8b5cf6; } .aw-img2 { fill: #c4b5fd; }
.aw-abc { fill: #a78bfa; font: 700 11px Inter, sans-serif; letter-spacing: .5px; } .aw-abc.big { font-size: 15px; }
.aw-dot { fill: #8b5cf6; }
.aw-move { transform-box: fill-box; transform-origin: center; }
.aw-magic { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.aw-magic:hover { border-color: var(--red); }
.aw-magic strong { display: block; font-size: 14px; } .aw-magic small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.aw-magic-art { position: relative; flex: none; width: 64px; height: 64px; border-radius: 10px; background: linear-gradient(135deg, #6d28d9, #c026d3); display: grid; place-items: center; overflow: hidden; }
.aw-magic-art b { font: 800 22px Inter, sans-serif; color: #fff; animation: awMagic 2.4s ease-in-out infinite; }
.aw-magic-art i { position: absolute; inset: 0; background: radial-gradient(circle at 20% 20%, #fff 0 2px, transparent 3px), radial-gradient(circle at 80% 70%, #fff 0 1.5px, transparent 2.5px); animation: awTwinkle 1.8s linear infinite; }
@keyframes awMagic { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-4px) rotate(4deg); } }
@keyframes awTwinkle { 50% { opacity: .2; } }
.aw-foot { position: sticky; bottom: -12px; margin-top: 14px; padding: 10px 0 2px; background: var(--panel, #161616); }
/* hover demos: one movement per tile */
.aw-tile:hover .aw-move, .aw-tile.is-active .aw-move { animation: var(--aw, awFade) 1.1s cubic-bezier(.2,.8,.2,1) both; }
.a-surgir { --aw: awFade; } .a-elevacao, .a-subir { --aw: awRise; } .a-panorama, .a-deslocar, .a-deriva { --aw: awPan; } .a-quicar, .a-explosao { --aw: awBounce; }
.a-correnteza, .a-bloco, .a-tbloco, .a-teclado { --aw: awWipe; } .a-sopro, .a-pulsar { --aw: awBreath; } .a-debaixo, .a-cair { --aw: awFromBelow; }
.a-tectonico, .a-mesclar { --aw: awShift; } .a-cambalhota, .a-girar, .a-rolar { --aw: awFlip; } .a-neon, .a-piscar { --aw: awFlicker; }
.a-recorte, .a-skate { --aw: awCut; } .a-pisada { --aw: awStomp; } .a-desfoque, .a-sequencia, .a-desembacar { --aw: awBlur; } .a-afastar { --aw: awSpread; } .a-sacudir { --aw: awShake; }
@keyframes awFade { from { opacity: 0; } }
@keyframes awRise { from { opacity: 0; transform: translateY(10px); } }
@keyframes awPan { from { opacity: 0; transform: translateX(-14px); } }
@keyframes awBounce { 0% { transform: scale(.3); opacity: 0; } 55% { transform: scale(1.12); opacity: 1; } 75% { transform: scale(.94); } }
@keyframes awWipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes awBreath { from { opacity: 0; transform: scale(1.4); } }
@keyframes awFromBelow { from { clip-path: inset(0 0 0 0); transform: translateY(14px); opacity: 0; } }
@keyframes awShift { from { opacity: 0; transform: translate(-8px, 6px); filter: blur(2px); } }
@keyframes awFlip { from { opacity: 0; transform: rotate(-360deg) scale(.4); } }
@keyframes awFlicker { 0%, 20%, 40% { opacity: 0; } 10%, 30%, 60%, 100% { opacity: 1; } }
@keyframes awCut { from { opacity: 0; transform: rotate(-20deg) scale(.7) translateX(-6px); } }
@keyframes awStomp { from { opacity: 0; transform: scale(1.7); } 60% { transform: scale(.95); opacity: 1; } }
@keyframes awBlur { from { opacity: 0; filter: blur(6px); } }
@keyframes awSpread { from { opacity: 0; transform: scaleX(1.6); } }
@keyframes awShake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-3px) rotate(-4deg); } 40%, 80% { transform: translateX(3px) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .aw-tile .aw-move, .aw-magic-art b, .aw-magic-art i { animation: none !important; } }

/* ── Suminagashi style (round 8, trimmed in round 9): only the buttons carry
   the marbled ink (made in suminagashi.js from equations); no click bursts,
   paper, stage background, banners or opening drop. ── */
@keyframes sumi-flow { to { background-position: 160px 320px; } }
[data-style="sumi"] .btn.primary, [data-style="sumi"] .rail-btn.is-active b, [data-style="sumi"] .dtab.is-active::before {
  background: var(--sumi-red, var(--red)) 0 0 / 160px 160px; animation: sumi-flow 26s linear infinite; border-color: transparent;
}
[data-style="sumi"] .btn.primary { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
[data-style="sumi"] .btn.primary:hover { animation-duration: 6s; filter: saturate(1.15); }
[data-style="sumi"] .rail-btn.is-active b { -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-style="sumi"] .rail-btn.is-active { box-shadow: none; position: relative; }
[data-style="sumi"] .rail-btn.is-active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 5px; border-radius: 0 6px 6px 0;
  background: var(--sumi-ink, var(--text)) 0 0 / 80px 80px; animation: sumi-flow 14s linear infinite;
}
[data-style="sumi"] .btn, [data-style="sumi"] .chip { border-radius: 2px 8px 3px 9px / 9px 3px 8px 2px; }
/* hover: the ink line under links and tabs runs across */
[data-style="sumi"] .tb-link, [data-style="sumi"] .home-nav button { background-image: linear-gradient(var(--red), var(--red)); background-size: 0 2px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .35s ease; }
[data-style="sumi"] .tb-link:hover, [data-style="sumi"] .home-nav button:hover { background-size: 100% 2px; }
/* the settings preview card */
.st-prev.is-sumi .r i:first-child, .st-prev.is-sumi .m span { background: var(--sumi-red, linear-gradient(115deg, #c3161c 30%, #111 30% 45%, #c3161c 45% 70%, #111 70%)); background-size: 60px 60px; border-radius: 2px 9px 3px 10px; }
.st-prev.is-sumi .m b { font-family: 'DM Serif Display', serif; letter-spacing: .04em; }

/* ── round 9: Suminagashi theme (fluid ink, photo 1): white paper with
   sweeping brush strokes of sumi ink, drawn in suminagashi.js; red only for
   the seal. ── */
:root[data-theme="sumiflow"] {
  --bg: #f4f3ef; --panel: #fbfaf8; --panel-2: #f1efea; --line: #dcd9d2; --line-2: #b9b5ac;
  --text: #121212; --muted: #6b6862; --red: #c4161c; --red-rgb: 196, 22, 28; --red-dim: #ecbcb9; --on-red: #ffffff;
  --accent-hover: #a51016; --accent-press: #7f0c11;
  --bar: #f7f6f3; --field: #ffffff; --stage: #e9e7e1; --dot: #cfcbc2; --check-a: #e4e1da; --check-b: #f4f2ee;
  color-scheme: light;
}
:root[data-theme="sumiflow"] .grain { display: none; }
:root[data-theme="sumiflow"] body { background: var(--sumi-waves, none) center top / 1400px auto repeat-y, var(--bg); }
:root[data-theme="sumiflow"] .home-main { background: var(--sumi-waves, none) right -120px top -40px / 1100px auto no-repeat; }
:root[data-theme="sumiflow"] #stageWrap { background: var(--sumi-waves, none) center / 1600px auto no-repeat, var(--stage); }
:root[data-theme="sumiflow"] .brand-mark em { color: var(--red); }

/* ── round 9: Carimbo style (photo 1): buttons are red seals (hanko) with
   worn, uneven edges; pressing one stamps it. ── */
:root {
  --stamp-edge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 80' preserveAspectRatio='none'%3E%3Cfilter id='r' x='-5%25' y='-5%25' width='110%25' height='110%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.09' numOctaves='3' seed='7' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='5'/%3E%3C/filter%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 22 0 0 0 -17.5'/%3E%3C/filter%3E%3Cmask id='m'%3E%3Crect width='200' height='80' fill='%23fff'/%3E%3Crect width='200' height='80' filter='url(%23s)'/%3E%3C/mask%3E%3Crect x='3' y='3' width='194' height='74' rx='3' filter='url(%23r)' mask='url(%23m)'/%3E%3C/svg%3E");
  --stamp-ring: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 80' preserveAspectRatio='none'%3E%3Cfilter id='r' x='-5%25' y='-5%25' width='110%25' height='110%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.09' numOctaves='3' seed='11' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='5'/%3E%3C/filter%3E%3Crect x='5' y='5' width='190' height='70' rx='3' fill='none' stroke='%23000' stroke-width='7' filter='url(%23r)'/%3E%3C/svg%3E");
}
[data-style="carimbo"] .btn.primary, [data-style="carimbo"] .chip.is-active, [data-style="carimbo"] .rail-btn.is-active b, [data-style="carimbo"] .seg input:checked + span {
  background: var(--red); color: #fff; border-color: transparent; border-radius: 0;
  -webkit-mask: var(--stamp-edge) 0 0 / 100% 100%; mask: var(--stamp-edge) 0 0 / 100% 100%;
  font-family: 'DM Serif Display', serif; letter-spacing: .06em; font-weight: 400;
}
[data-style="carimbo"] .btn:not(.primary):not(.ghost), [data-style="carimbo"] .chip:not(.is-active) {
  position: relative; border-color: transparent; border-radius: 0; color: var(--red); background: transparent;
}
[data-style="carimbo"] .btn:not(.primary):not(.ghost)::after, [data-style="carimbo"] .chip:not(.is-active)::after {
  content: ''; position: absolute; inset: 0; background: var(--red); pointer-events: none;
  -webkit-mask: var(--stamp-ring) 0 0 / 100% 100%; mask: var(--stamp-ring) 0 0 / 100% 100%;
}
[data-style="carimbo"] .rail-btn.is-active b { padding: 2px 6px; }
[data-style="carimbo"] .rail-btn.is-active { box-shadow: none; }
/* pressing: the seal comes down and leaves a little more ink */
@keyframes stamp-down { 0% { transform: scale(1.12) rotate(-2deg); opacity: .6; } 55% { transform: scale(.96) rotate(.5deg); opacity: 1; } 100% { transform: none; } }
[data-style="carimbo"] .btn:active, [data-style="carimbo"] .chip:active { animation: stamp-down .22s ease-out; filter: saturate(1.25) brightness(.92); }
[data-style="carimbo"] .btn.primary:hover, [data-style="carimbo"] .chip:hover { transform: rotate(-1deg); }
.st-prev.is-carimbo .r i:first-child, .st-prev.is-carimbo .m span { background: var(--red, #c4161c); -webkit-mask: var(--stamp-edge) 0 0 / 100% 100%; mask: var(--stamp-edge) 0 0 / 100% 100%; border-radius: 0; }
.st-prev.is-carimbo .m b { font-family: 'DM Serif Display', serif; color: #c4161c; }
@media (prefers-reduced-motion: reduce) {
  [data-style="sumi"] *, [data-style="sumi"] *::before, [data-style="sumi"] *::after, [data-style="carimbo"] .btn, [data-style="carimbo"] .chip { animation-duration: .001s !important; animation-iteration-count: 1 !important; }
}
.reduce-motion .btn, .reduce-motion .chip { animation: none !important; }

/* Export ▸ CADA ELEMENTO: which pieces get a file */
.piece-list { display: grid; gap: 4px; max-height: 150px; overflow: auto; margin: 0 0 10px; padding: 8px; border: 1px solid var(--line, currentColor); }
.piece-list .check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── round 9: × in the top right corner of the side panels ── */
.panel-x {
  position: sticky; top: 0; float: right; z-index: 4; width: 28px; height: 28px; margin: -8px -8px 0 6px; padding: 0;
  display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer;
}
.panel-x:hover { color: var(--text); border-color: var(--red); }
@media (max-width: 760px) { .panel-x { display: none; } }

/* ── round 9: the tools flyout (Contagem, Régua, Caneta…) has a fixed size
   and scrolls inside, instead of breaking its layout ── */
.tool-fly.is-pro { width: 264px; max-height: min(560px, calc(100% - 24px)); overflow: hidden auto; }
.tool-fly.is-pro > * { min-width: 0; }
.count-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.count-row select { width: 100%; text-overflow: ellipsis; }
.toolbar { max-height: calc(100% - 24px); overflow: hidden auto; scrollbar-width: none; }

/* the fold button at the end of the tool bar, and the tab that brings it back */
.tb-btn.tb-hide { height: 26px; background: none; color: var(--muted); border-top: 1px solid var(--line); }
.tb-btn.tb-hide:hover { color: var(--text); border-color: var(--line); border-top-color: var(--line); }
.toolbar-show { left: 14px; top: 14px; width: auto; height: 34px; padding: 0 12px 0 8px; display: flex; align-items: center; gap: 6px; color: var(--muted); font: 600 10px var(--mono); letter-spacing: .12em; }
.toolbar-show:hover { color: var(--red); }
.toolbar-show svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ── round 9: scroll bars with arrows at both ends (photo 10), in the colours
   of the theme. Only where a box sets no scrollbar-width of its own. ── */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: color-mix(in srgb, var(--text) 10%, var(--panel)); }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text) 42%, var(--panel)); border-radius: 7px;
  border: 3px solid transparent; background-clip: padding-box; min-height: 30px;
}
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--text) 60%, var(--panel)); }
::-webkit-scrollbar-thumb:active { background-color: var(--red); }
::-webkit-scrollbar-corner { background: color-mix(in srgb, var(--text) 10%, var(--panel)); }
::-webkit-scrollbar-button:single-button { display: block; width: 14px; height: 14px; background: color-mix(in srgb, var(--text) 10%, var(--panel)) center / 8px 8px no-repeat; }
::-webkit-scrollbar-button:single-button:vertical:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 1.5L7.5 6h-7z' fill='%23888'/%3E%3C/svg%3E"); }
::-webkit-scrollbar-button:single-button:vertical:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 6.5L.5 2h7z' fill='%23888'/%3E%3C/svg%3E"); }
::-webkit-scrollbar-button:single-button:horizontal:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 4L6 .5v7z' fill='%23888'/%3E%3C/svg%3E"); }
::-webkit-scrollbar-button:single-button:horizontal:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M6.5 4L2 7.5v-7z' fill='%23888'/%3E%3C/svg%3E"); }
::-webkit-scrollbar-button:single-button:hover { background-color: color-mix(in srgb, var(--text) 22%, var(--panel)); }
::-webkit-scrollbar-button:vertical:start:increment, ::-webkit-scrollbar-button:vertical:end:decrement,
::-webkit-scrollbar-button:horizontal:start:increment, ::-webkit-scrollbar-button:horizontal:end:decrement { display: none; }
/* thin rows keep a slim bar without arrows */
.el-row::-webkit-scrollbar, .rm-tray-list::-webkit-scrollbar { height: 8px; }
.el-row::-webkit-scrollbar-button, .rm-tray-list::-webkit-scrollbar-button { display: none; }

/* ── round 9: the home (photos 6–9) ── */
.home-hero { margin: -28px -36px 6px; padding: 0 0 4px; }
.hero-band {
  display: grid; justify-items: center; gap: 18px; padding: 44px 24px 30px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--red) 32%, transparent), transparent 60%),
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, #5b3dff 30%, transparent), transparent 60%),
    color-mix(in srgb, var(--panel) 70%, var(--bg));
  border-bottom: 1px solid var(--line);
}
.hero-title {
  margin: 0; text-align: center; font: 700 clamp(30px, 4vw, 48px)/1.1 var(--sans); letter-spacing: -.01em;
  background: linear-gradient(90deg, var(--red), #ff7a45 40%, #a66bff 80%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-pills { display: flex; gap: 8px; }
.hero-pills button {
  display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--panel) 80%, transparent); color: var(--text); font: 600 13px var(--sans); cursor: pointer;
}
.hero-pills button.is-active, .hero-pills button:hover { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.hero-search {
  width: min(800px, 100%); display: flex; align-items: center; gap: 10px; padding: 0 18px; height: 62px;
  border: 1px solid color-mix(in srgb, var(--red) 55%, var(--line-2)); border-radius: 14px; background: var(--field);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 12%, transparent), 0 12px 40px rgba(0,0,0,.25);
}
.hero-search svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.hero-input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font: 15px var(--sans); outline: none; }
.hero-row { margin: 20px 36px 0; }
.hero-ico { display: grid; justify-items: center; gap: 8px; width: 92px; flex: none; padding: 4px 0; background: none; border: 0; color: var(--text); cursor: pointer; }
.hero-ico span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--c); color: #fff; transition: transform .15s ease; box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 35%, transparent); }
.hero-ico.is-first span { color: #222; }
.hero-ico.is-first { position: relative; margin-right: 12px; }
.hero-ico.is-first::after { content: ''; position: absolute; right: -6px; top: 8px; height: 40px; border-right: 1px solid var(--line-2); }
.hero-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hero-ico small { font: 600 12px var(--sans); text-align: center; line-height: 1.25; }
.hero-ico:hover span { transform: translateY(-3px) scale(1.05); }

/* section head: "Ver tudo" on the right (photo 6) */
.home-seeall { margin-left: auto; background: none; border: 0; color: var(--text); font: 700 13px var(--sans); cursor: pointer; padding: 4px 2px; }
.home-seeall:hover { color: var(--red); text-decoration: underline; }
.home-more-btn { display: block; margin: 22px auto 0; padding: 10px 26px; border-radius: 10px; }
.home-card[hidden] { display: none; }

/* rows that scroll sideways, with round arrows (photos 7 and 8) */
.carousel { position: relative; }
.carousel-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 2px 2px 6px; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track > * { scroll-snap-align: start; }
.carousel-arrow {
  position: absolute; top: 50%; z-index: 2; width: 42px; height: 42px; margin-top: -24px; padding: 0; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.carousel-arrow.is-next { right: -14px; }
.carousel-arrow.is-prev { left: -14px; }
.carousel-arrow[hidden] { display: none; }
.carousel-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.carousel-arrow:hover { border-color: var(--red); color: var(--red); }

.pop-card { flex: none; width: 236px; display: grid; gap: 10px; background: none; border: 0; padding: 0; color: var(--text); text-align: left; cursor: pointer; }
.pop-art { height: 168px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--text) 7%, var(--panel)); border: 1px solid var(--line); transition: border-color .15s; }
.pop-card:hover .pop-art { border-color: var(--red); }
.pop-card .preset-frame { box-shadow: 10px 10px 0 color-mix(in srgb, var(--text) 10%, transparent); }
.pop-card b { font: 500 13px var(--sans); }

.cat-row .carousel-track { display: grid; grid-template-rows: 1fr 1fr; grid-auto-flow: column; grid-auto-columns: 226px; }
.cat-card {
  position: relative; overflow: hidden; height: 80px; display: flex; align-items: center; padding: 0 0 0 16px; border: 0; border-radius: 12px;
  background: var(--c); color: #1c1c28; text-align: left; cursor: pointer; transition: transform .15s ease;
}
.cat-card b { position: relative; z-index: 1; max-width: 55%; font: 600 14px/1.2 var(--sans); }
.cat-card:hover { transform: translateY(-2px); }
.cat-art { position: absolute; right: 14px; top: 12px; width: var(--w); height: var(--h); }
.cat-art i { position: absolute; inset: 0; border-radius: 4px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.cat-art i:first-child { transform: rotate(-9deg) translate(-12px, 4px); background: color-mix(in srgb, var(--c) 60%, #7a5cff); opacity: .7; }
.cat-art i:last-child { background: linear-gradient(#fff 0 0) 8px 10px / 60% 4px no-repeat, linear-gradient(#ddd 0 0) 8px 20px / 45% 3px no-repeat, linear-gradient(#ddd 0 0) 8px 28px / 50% 3px no-repeat, #fff; transform: rotate(4deg); }

/* the OBS overlays in the format cards: a screen with a webcam corner and a chat column */
.preset-frame.kind-obs { background: linear-gradient(135deg, #1a1d29, #2c2250); }
.preset-frame.kind-obs i:nth-child(1) { top: auto; position: absolute; left: 8%; bottom: 14%; width: 30%; height: 28%; border: 2px solid #e5141b; border-radius: 3px; background: rgba(0,0,0,.4); }
.preset-frame.kind-obs i:nth-child(2) { position: absolute; right: 6%; top: 8%; width: 20%; height: 70%; border: 2px solid #e5141b; border-radius: 3px; background: rgba(0,0,0,.4); }
.preset-frame.kind-obs i:nth-child(3) { top: auto; opacity: 1; position: absolute; left: 6%; right: 6%; bottom: 4%; height: 7%; background: #e5141b; border-radius: 2px; }
.preset-frame.kind-obs { position: relative; }

@media (max-width: 760px) {
  .home-hero { margin: -16px -16px 6px; }
  .hero-row { margin: 16px 8px 0; }
  .carousel-arrow { display: none; }
}

/* ── round 9: easter egg. Hold the logo: the letters charge, the // spins,
   then a burst and the game window. ── */
.brand-mark { display: inline-block; }
.brand-mark em { display: inline-block; }
.brand.is-charging { user-select: none; -webkit-user-select: none; }
.brand.is-charging .brand-mark { animation: egg-charge 1.4s cubic-bezier(.5, 0, .9, .5) forwards; background: linear-gradient(90deg, var(--red) 0 0) 0 100% / 0 3px no-repeat; }
.brand.is-charging .brand-mark em { animation: egg-spin .35s linear infinite; }
@keyframes egg-charge {
  0% { background-size: 0 3px; transform: none; }
  60% { transform: scale(1.04); }
  85% { transform: scale(1.06) rotate(-1deg); }
  90% { transform: scale(1.06) rotate(1deg); }
  100% { background-size: 100% 3px; transform: scale(1.08); }
}
@keyframes egg-spin { to { transform: rotate(360deg); } }
.brand.is-burst .brand-mark { animation: egg-burst .6s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes egg-burst { 0% { transform: scale(1.08); filter: none; } 40% { transform: scale(1.3); filter: drop-shadow(0 0 12px var(--red)); color: var(--red); } 100% { transform: none; } }
.float-win.is-egg .fw-body { padding: 0; overflow: hidden; display: flex; }
.egg-canvas { flex: 1; width: 100%; height: 100%; display: block; outline: none; cursor: pointer; touch-action: none; }
.reduce-motion .brand.is-charging .brand-mark, .reduce-motion .brand.is-charging .brand-mark em, .reduce-motion .brand.is-burst .brand-mark { animation: none; }
