:root {
  --bars: linear-gradient(90deg, #c0c0c0 0 14.28%, #ffff00 0 28.57%, #00ffff 0 42.85%, #00ff00 0 57.14%, #ff00ff 0 71.42%, #ff0000 0 85.71%, #0000ff 0);
  --head: 'Archivo', 'Noto Sans SC', sans-serif;
  --body: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Noto Sans SC', monospace;
  --accent: #e5484d;
  --ease: cubic-bezier(.2,.7,.1,1);
  --r: 999px;
}
/* ---- 4 mesas ---- */
[data-desk="limpo"] {
  --bg: #efefed; --bg-deco: radial-gradient(1200px 600px at 80% -10%, #fbe9e4 0, transparent 60%);
  --card: #f7f7f5; --fg: #17171a; --muted: #7c7c84; --line: rgba(0,0,0,.07);
  --btn: linear-gradient(180deg, #fbfbfa, #ededeb); --btn-fg: #55555c;
  --shadow: 0 1px 0 #fff inset, 0 0 0 1px rgba(0,0,0,.04), 0 6px 14px -6px rgba(0,0,0,.18);
  --shadow-press: inset 0 2px 5px rgba(0,0,0,.12);
  --out: #fbfbfa; --label-font: var(--mono);
}
[data-desk="papel"] {
  --bg: #e2d9c4; --bg-deco: repeating-linear-gradient(180deg, transparent 0 31px, rgba(120,95,50,.10) 31px 32px);
  --card: #f4eedd; --fg: #2d2416; --muted: #8b7c62; --line: rgba(80,60,20,.14);
  --btn: #fffcf3; --btn-fg: #5a4c34;
  --shadow: 0 0 0 1px rgba(80,60,20,.10), 0 2px 0 rgba(80,60,20,.08);
  --shadow-press: inset 0 0 0 1px rgba(80,60,20,.25);
  --out: #fffcf3; --label-font: 'Courier New', var(--mono);
}
[data-desk="grafite"] {
  --bg: #2b2d33; --bg-deco: radial-gradient(900px 500px at 90% 110%, rgba(229,72,77,.10) 0, transparent 60%);
  --card: #33363d; --fg: #ececee; --muted: #9a9ca5; --line: rgba(255,255,255,.09);
  --btn: linear-gradient(180deg, #43464e, #383b42); --btn-fg: #c9cad0;
  --shadow: 0 1px 0 rgba(255,255,255,.10) inset, 0 0 0 1px rgba(0,0,0,.35), 0 8px 18px -8px rgba(0,0,0,.6);
  --shadow-press: inset 0 2px 6px rgba(0,0,0,.45);
  --out: #26282d; --label-font: var(--mono);
}
[data-desk="noite"] {
  --bg: #070707; --bg-deco: none;
  --card: #101010; --fg: #f3f3f1; --muted: #8d8d88; --line: rgba(255,255,255,.09);
  --btn: #161616; --btn-fg: #b9b9b4;
  --shadow: 0 0 0 1px rgba(255,255,255,.10);
  --shadow-press: inset 0 0 0 1px rgba(255,255,255,.28);
  --out: #0b0b0b; --label-font: var(--head);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg-deco), var(--bg); background-attachment: fixed; color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; transition: background-color .4s, color .4s; min-height: 100vh; }
body.lock { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.bars { height: 4px; background: var(--bars); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(16px, 3vw, 40px); }
.brand { display: flex; align-items: baseline; gap: 10px; font-family: var(--head); font-weight: 800; letter-spacing: .02em; font-size: 18px; }
.brand small { font-family: var(--label-font); font-weight: 500; font-size: 11px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.nav { display: flex; gap: 22px; font-family: var(--head); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a.on { color: var(--fg); }
.langs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r); background: var(--btn); box-shadow: var(--shadow); }
.langs button { padding: 6px 12px; border-radius: var(--r); font-size: 12px; font-weight: 600; color: var(--btn-fg); }
.langs button.on { background: var(--fg); color: var(--bg); }
.user-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: var(--r); background: var(--btn); box-shadow: var(--shadow); font-size: 12px; color: var(--btn-fg); text-decoration: none; }
.user-pill b { padding: 4px 10px; border-radius: var(--r); background: var(--card); color: var(--fg); font-weight: 600; }
.user-pill:hover b { color: var(--accent); }
.top .langs, .top .nav { margin-left: auto; }
@media (max-width: 620px) { .user-pill span { display: none; } .user-pill { padding-left: 6px; } .top { gap: 10px; } }

.icon-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--btn); box-shadow: var(--shadow); color: var(--btn-fg); font-size: 16px; display: grid; place-items: center; }
.icon-btn:hover { color: var(--accent); }
[hidden] { display: none !important; }

/* views switch */
.views { display: flex; justify-content: center; margin: 18px 0 0; padding: 0 16px; }
.views .seg button { padding: 9px 22px; font-size: 13px; }
.nav a { cursor: pointer; }

/* characters */
.chars-wrap { max-width: 1180px; margin: clamp(24px, 3vw, 40px) auto 60px; padding: 0 clamp(16px, 3vw, 40px); display: grid; gap: 18px; }
.char-picker { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 14px 28px; }
.proj { display: grid; gap: 8px; justify-items: center; }
.proj-name { font-family: var(--label-font); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.proj-chars { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.char-chip { display: inline-flex; align-items: center; gap: 10px; padding: 5px 16px 5px 5px; border-radius: var(--r); background: var(--btn); box-shadow: var(--shadow); text-align: left; transition: transform .15s var(--ease); }
.char-chip:hover { transform: translateY(-1px); }
.char-chip.on { outline: 1.5px solid var(--accent); }
.char-chip.new { opacity: .75; }
.char-av { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--out); font-weight: 700; color: var(--muted); flex: none; box-shadow: inset 0 0 0 1px var(--line); }
.char-av img { width: 100%; height: 100%; object-fit: cover; }
.char-chip-t b { display: block; font-size: 13.5px; line-height: 1.1; }
.char-chip-t small { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.panel.char-detail { padding: 0; overflow: hidden; }
.char-detail > .empty { padding: 28px; text-align: center; }
.char-head { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: stretch; border-bottom: 1px solid var(--line); }
.char-banner { position: relative; min-height: 200px; background: #0000c8; overflow: hidden; }
.char-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.char-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 60%, rgba(0,0,0,.18)); }
.char-meta { display: grid; gap: 10px; align-content: center; padding: 22px 28px; min-width: 0; }
.char-meta > small { font-family: var(--label-font); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.char-meta h2 { font-family: var(--head); font-weight: 800; font-size: clamp(28px, 3.4vw, 40px); line-height: 1; letter-spacing: -.01em; }
.char-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle:disabled { opacity: .45; cursor: default; }
.char-identity summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.char-identity p { font-family: var(--mono); font-size: 12px; line-height: 1.55; margin-top: 6px; color: var(--btn-fg); max-width: 70ch; }
.char-admin { display: flex; gap: 18px; }
.char-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.ctabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r); background: var(--btn); box-shadow: var(--shadow-press); }
.ctabs button { padding: 7px 14px; border-radius: var(--r); font-size: 12.5px; color: var(--btn-fg); }
.ctabs button small { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-left: 3px; }
.ctabs button.on { background: var(--card); color: var(--fg); font-weight: 600; box-shadow: var(--shadow); }
.char-bar .search { margin: 0; flex: 0 1 240px; padding: 9px 14px; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 20px 24px 28px; }
.cgrid:not([data-cat="expr"]) { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cgrid:not([data-cat="expr"]) .ccard { aspect-ratio: 16 / 9; }
.cgroup { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin: 10px 0 0; font-family: var(--label-font); font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.cgroup::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.cgroup:first-child { margin-top: 0; }
.ccard { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #0000c8; box-shadow: 0 0 0 1px var(--line); transition: transform .2s var(--ease), box-shadow .2s; }
.ccard:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line), 0 12px 24px -12px rgba(0,0,0,.55); }
.ccard.used { box-shadow: 0 0 0 2px var(--accent); }
.ccard-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; padding: 0; text-align: left; }
.ccard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ccard-n { position: absolute; top: 8px; left: 8px; min-width: 24px; height: 20px; padding: 0 6px; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; font-family: var(--mono); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; backdrop-filter: blur(4px); }
.ccard.used .ccard-n { background: var(--accent); }
.ccard-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.78)); color: #fff; display: grid; gap: 1px; }
.ccard-cap b { font-size: 12.5px; font-weight: 600; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.ccard-cap small { font-size: 10.5px; opacity: .8; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ccard-slots { position: absolute; left: 6px; right: 6px; bottom: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; pointer-events: none; }
.ccard-cap { transition: opacity .2s; }
.ccard:hover .ccard-cap, .ccard:focus-within .ccard-cap { opacity: 0; }
.ccard:hover .ccard-slots, .ccard:focus-within .ccard-slots { opacity: 1; transform: none; pointer-events: auto; }
.ccard-slots button { padding: 6px 4px; border-radius: 7px; font-size: 10.5px; font-weight: 600; color: #fff; background: rgba(0,0,0,.62); backdrop-filter: blur(4px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard-slots button:hover, .ccard-slots button.def { background: var(--accent); }
.ccard-admin { position: absolute; top: 6px; right: 6px; display: flex; gap: 3px; opacity: 0; transition: opacity .2s; }
.ccard:hover .ccard-admin { opacity: 1; }
.ccard-admin button { width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; display: grid; place-items: center; }
.ccard-admin button:hover { background: var(--accent); }
.ccard.add { display: grid; place-items: center; padding: 12px; text-align: center; background: var(--out); box-shadow: none; border: 1.5px dashed var(--line); cursor: pointer; font-family: var(--label-font); font-size: 11px; color: var(--muted); }
.ccard.add:hover, .ccard.add.over { border-color: var(--accent); color: var(--fg); transform: none; }
.cgrid > .empty { grid-column: 1 / -1; text-align: center; padding: 20px; }
#charChip .tag { cursor: pointer; text-transform: none; letter-spacing: 0; font-family: var(--body); }
.settings-body textarea { border: 0; border-radius: 14px; padding: 12px 14px; background: var(--out); box-shadow: var(--shadow-press); outline: none; font-size: 13px; font-family: var(--mono); resize: vertical; }
.settings-body textarea:focus { outline: 1.5px solid var(--accent); }
@media (hover: none) {
  .ccard-slots { opacity: 1; transform: none; pointer-events: auto; }
  .ccard-cap, .ccard:hover .ccard-cap { opacity: 1; top: 0; bottom: auto; padding: 8px 8px 22px 36px; background: linear-gradient(rgba(0,0,0,.72), transparent); }
  .ccard-cap small { display: none; }
  .ccard-admin { opacity: 1; }
}
@media (max-width: 760px) {
  .char-head { grid-template-columns: 1fr; }
  .char-banner { min-height: 0; aspect-ratio: 16 / 9; }
  .char-meta { padding: 18px; }
  .char-bar { padding: 12px 14px; }
  .char-bar .search { flex: 1 1 100%; }
  .cgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px; }
}

/* ollama */
.llm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 10px; }
.tr-preview { flex: 1 1 100%; font-family: var(--mono); font-size: 12px; color: var(--muted); line-height: 1.5; }
.tr-preview:empty { display: none; }
.out-tools { display: inline-flex; align-items: center; gap: 10px; }
.improve-btn { padding: 4px 10px; border-radius: var(--r); font-family: var(--body); font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--fg); background: var(--btn); box-shadow: var(--shadow); }
.improve-btn:hover { color: var(--accent); }
.improve-btn:disabled { opacity: .6; cursor: progress; }
.out.is-improved { box-shadow: var(--shadow-press), inset 0 0 0 1.5px rgba(229,72,77,.45); }
.settings-body .check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.settings-body .check input { width: auto; padding: 0; box-shadow: none; }
.settings-body .check span { font-family: var(--body); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--fg); }

.act.improve-act { width: 100%; height: 44px; margin-top: 14px; font-size: 13px; color: var(--fg); background: var(--btn); box-shadow: var(--shadow), inset 0 0 0 1.5px rgba(229,72,77,.55); }
.act.improve-act:hover { color: var(--accent); }
.act.improve-act:disabled { opacity: .7; cursor: progress; transform: none; }
.ai-tag { padding: 3px 9px; border-radius: var(--r); font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: #fff; background: var(--accent); }

/* references */
.refs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ref-slot { display: grid; gap: 6px; align-content: start; transition: opacity .2s; }
.ref-slot.off { opacity: .45; }
.ref-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; }
.ref-head small { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.ref-drop { min-height: 92px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; padding: 8px; border-radius: 14px; border: 1.5px dashed var(--line); background: var(--out); cursor: pointer; transition: border-color .2s, background .2s; }
.ref-drop:hover, .ref-drop:focus-visible, .ref-drop.over { border-color: var(--accent); outline: none; }
.ref-drop.over { background: rgba(229,72,77,.08); }
.ref-slot.has .ref-drop { justify-content: flex-start; }
.ref-add { font-family: var(--label-font); font-size: 11px; color: var(--muted); padding: 4px 6px; text-align: center; }
.ref-th { position: relative; width: 66px; height: 66px; border-radius: 10px; overflow: hidden; background: #111; box-shadow: 0 0 0 1px var(--line); flex: none; }
.ref-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-th.busy { display: grid; place-items: center; background: var(--btn); }
.ref-th .x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; line-height: 1; display: grid; place-items: center; }
.ref-th .x:hover { background: var(--accent); }
.ref-tip { font-size: 11px; color: var(--muted); line-height: 1.35; }

/* generate */
.gen { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.gen-opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg.small button { padding: 6px 12px; font-size: 12px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: var(--r); background: var(--btn); box-shadow: var(--shadow); font-size: 12px; color: var(--btn-fg); }
.toggle i { width: 28px; height: 16px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; box-shadow: var(--shadow-press); }
.toggle i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.toggle[aria-pressed="true"] { color: var(--fg); }
.toggle[aria-pressed="true"] i { background: var(--accent); }
.toggle[aria-pressed="true"] i::after { transform: translateX(12px); }
.act.gen-btn { height: 50px; font-size: 14px; background: var(--accent); color: #fff; box-shadow: 0 10px 22px -10px rgba(229,72,77,.8); }
.act.gen-btn:hover { color: #fff; }
.act.gen-btn.confirm { background: #111; color: #fff; animation: pulse 1s ease-in-out infinite alternate; }
[data-desk="noite"] .act.gen-btn.confirm, [data-desk="grafite"] .act.gen-btn.confirm { background: #fff; color: #111; }
.act.gen-btn:disabled { background: var(--btn); color: var(--muted); box-shadow: var(--shadow); cursor: default; transform: none; font-weight: 500; font-size: 13px; }
@keyframes pulse { to { box-shadow: 0 0 0 6px rgba(229,72,77,.25); } }

/* results */
.results-wrap { max-width: 1280px; margin: -30px auto 60px; padding: 0 clamp(16px, 3vw, 40px); }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.job { text-align: left; padding: 8px; border-radius: 16px; transition: background .2s, transform .2s var(--ease); }
.job:hover { background: var(--btn); box-shadow: var(--shadow); transform: translateY(-2px); }
.job-media { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--out); box-shadow: inset 0 0 0 1px var(--line); }
.job-media img, .job-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.job-media .play { position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; display: grid; place-items: center; }
.job-meta { display: grid; gap: 2px; margin-top: 8px; }
.job-meta b { font-size: 13px; }
.job-meta small { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.job-run, .job-fail { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; padding: 12px; font-size: 12px; color: var(--muted); }
.job-run { background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.12) 50%, transparent 70%) var(--out); background-size: 250% 100%; animation: shimmer 1.6s linear infinite; }
.job-run b { color: var(--fg); font-weight: 600; }
.job-fail { color: var(--accent); }
.job-fail small { color: var(--muted); font-size: 11px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -150% 0; } }

/* viewer + settings */
.sheet.viewer-sheet { width: min(1200px, 100%); }
.viewer-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; padding: 0 24px 24px; }
.viewer-media { min-height: 0; display: grid; gap: 10px; align-content: center; overflow-y: auto; border-radius: 14px; background: #000; place-items: center; }
.viewer-media img, .viewer-media video { max-width: 100%; max-height: calc(86vh - 120px); object-fit: contain; display: block; }
.viewer-media .job-run, .viewer-media .job-fail { position: static; min-height: 300px; }
.viewer-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.out.small { font-size: 12.5px; min-height: 0; flex: 1; overflow-y: auto; padding: 14px; }
.viewer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.viewer-actions .act { display: grid; place-items: center; text-decoration: none; height: 40px; font-size: 12px; }
.act.danger:hover { color: var(--accent); }
.sheet.settings-sheet { width: min(520px, 100%); height: auto; }
.settings-body { display: grid; gap: 16px; padding: 4px 24px 24px; }
.settings-body label { display: grid; gap: 6px; }
.settings-body label span { font-family: var(--label-font); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.settings-body input { border: 0; border-radius: 14px; padding: 12px 14px; background: var(--out); box-shadow: var(--shadow-press); outline: none; font-size: 14px; }
.settings-body input:focus { outline: 1.5px solid var(--accent); }
.settings-body small { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.settings-actions { display: flex; gap: 10px; }
.settings-actions .act { flex: 1; }
@media (max-width: 800px) {
  .viewer-body { grid-template-columns: 1fr; overflow-y: auto; padding: 0 16px 16px; }
  .viewer-media img, .viewer-media video { max-height: 55vh; }
  .results-wrap { margin-top: -40px; }
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

/* login */
.login-wrap { min-height: calc(100vh - 90px); display: grid; place-content: center; gap: 18px; padding: 24px 16px 60px; }
.login-card { width: min(400px, calc(100vw - 32px)); display: grid; gap: 14px; }
.login-card h1 { font-family: var(--head); font-weight: 800; font-size: 26px; line-height: 1.1; letter-spacing: -.01em; }
.login-hint { font-size: 13px; color: var(--muted); }
.login-error { padding: 10px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--accent); background: rgba(229,72,77,.10); box-shadow: inset 0 0 0 1px rgba(229,72,77,.35); }
.login-card label { display: grid; gap: 6px; }
.login-card label span { font-family: var(--label-font); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.login-card input { border: 0; border-radius: 14px; padding: 12px 14px; background: var(--out); box-shadow: var(--shadow-press); outline: none; font-size: 15px; }
.login-card input:focus { outline: 1.5px solid var(--accent); }
.login-card .act { margin-top: 6px; }
.login-page .foot { padding: 0; }

/* hero */
.hero { text-align: center; padding: clamp(28px, 5vw, 56px) 16px 10px; }
.hero h1 { font-family: var(--head); font-weight: 800; font-size: clamp(26px, 4vw, 44px); line-height: 1.08; letter-spacing: -.015em; max-width: 20ch; margin: 0 auto; text-wrap: balance; }
.hero p { font-family: var(--label-font); color: var(--muted); font-size: 13px; margin-top: 12px; }

/* desk switcher (each button previews its own desk via data-desk) */
.desks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 880px; margin: 22px auto 0; padding: 0 16px; }
.desk { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 18px; border-radius: var(--r); background: var(--btn); box-shadow: var(--shadow); font-family: var(--label-font); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--btn-fg); transition: transform .2s var(--ease), box-shadow .2s; position: relative; }
.desk:hover { transform: translateY(-1px); }
.desk:active { box-shadow: var(--shadow-press); transform: none; }
.desk .sw { width: 16px; height: 16px; border-radius: 5px; box-shadow: 0 0 0 1px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.4); flex: none; }
.desk.on { outline: 1.5px solid var(--accent); color: var(--fg); font-weight: 600; }
.desk.on::after { content: '✓'; position: absolute; right: 18px; color: var(--accent); font-size: 13px; }

/* layout */
.wrap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; max-width: 1280px; margin: clamp(28px, 4vw, 48px) auto 60px; padding: 0 clamp(16px, 3vw, 40px); align-items: start; }
.panel { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: clamp(18px, 2.4vw, 28px); }
.group + .group { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.glabel { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--label-font); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.row2 { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: end; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: var(--r); background: var(--btn); box-shadow: var(--shadow); color: var(--btn-fg); font-size: 13px; transition: transform .15s var(--ease), color .15s; }
.chip:hover { transform: translateY(-1px); color: var(--fg); }
.chip.on { box-shadow: var(--shadow-press); outline: 1.5px solid var(--accent); color: var(--fg); font-weight: 600; }
.seg { display: inline-flex; padding: 4px; border-radius: var(--r); background: var(--btn); box-shadow: var(--shadow-press); }
.seg button { padding: 8px 18px; border-radius: var(--r); font-size: 13px; color: var(--btn-fg); }
.seg button.on { background: var(--card); color: var(--fg); font-weight: 600; box-shadow: var(--shadow); }
.subject { width: 100%; min-height: 76px; resize: vertical; border: 0; border-radius: 16px; padding: 14px 16px; background: var(--out); box-shadow: var(--shadow-press); outline: none; font-size: 14px; }
.subject:focus { outline: 1.5px solid var(--accent); }

/* looks button */
.looks-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 18px; border-radius: 18px; background: var(--btn); box-shadow: var(--shadow); color: var(--fg); font-weight: 600; font-size: 14px; text-align: left; transition: transform .15s var(--ease); }
.looks-btn:hover { transform: translateY(-1px); }
.looks-btn .mini { display: grid; grid-template-columns: repeat(4, 22px); gap: 4px; flex: none; }
.looks-btn .mini i { height: 22px; border-radius: 5px; }
.looks-btn small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* axes */
.axes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.axis { display: grid; gap: 6px; padding: 8px 10px 10px; border-radius: 14px; transition: background .2s; }
.axis:hover { background: var(--btn); }
.axis-name { font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; }
.axis-name em { font-style: normal; font-family: var(--label-font); font-size: 10px; color: var(--muted); letter-spacing: .1em; }
.slot { display: flex; flex-wrap: wrap; gap: 6px; min-height: 34px; align-items: center; padding: 5px; border-radius: 12px; border: 1.5px dashed var(--line); text-align: left; width: 100%; }
.slot:hover { border-color: var(--accent); }
.slot .add { font-family: var(--label-font); font-size: 11px; color: var(--muted); padding: 0 6px; letter-spacing: .06em; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 3px; border-radius: var(--r); background: var(--btn); box-shadow: var(--shadow); font-size: 12px; font-weight: 600; max-width: 100%; }
.tag .th { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; flex: none; position: relative; }
.tag .th .thumb-art { font-size: 0; }
.tag span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag .x { color: var(--muted); padding: 0 5px; font-weight: 400; }
.tag .x:hover { color: var(--accent); }

/* output */
.side { position: sticky; top: 18px; display: grid; gap: 16px; }
.out { font-family: var(--mono); font-size: 13.5px; line-height: 1.65; background: var(--out); border-radius: 16px; padding: 18px; min-height: 220px; box-shadow: var(--shadow-press); white-space: pre-wrap; word-break: break-word; }
.out .ph { color: var(--muted); }
.out b { font-weight: 500; color: var(--fg); background: linear-gradient(transparent 62%, rgba(229,72,77,.22) 0); }
.meta { display: flex; justify-content: space-between; gap: 10px; font-family: var(--label-font); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 10px 2px 0; }
.actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.act { height: 44px; border-radius: var(--r); background: var(--btn); box-shadow: var(--shadow); color: var(--btn-fg); font-size: 13px; font-weight: 600; transition: transform .15s var(--ease); }
.act:hover { transform: translateY(-1px); color: var(--fg); }
.act:active { box-shadow: var(--shadow-press); transform: none; }
.act.primary { background: var(--fg); color: var(--bg); box-shadow: 0 8px 18px -8px rgba(0,0,0,.45); }
.linkbtn { font-family: var(--label-font); font-size: 11px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.linkbtn:hover { color: var(--accent); }
.presets { display: grid; gap: 8px; }
.preset { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--btn); box-shadow: var(--shadow); font-size: 13px; text-align: left; color: var(--btn-fg); }
.preset span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset .x { color: var(--muted); padding: 0 4px; }
.empty { font-size: 13px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 100; transform: translate(-50%, 20px); opacity: 0; padding: 10px 18px; border-radius: var(--r); background: var(--fg); color: var(--bg); font-size: 13px; font-weight: 600; transition: .3s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast { max-width: min(560px, calc(100vw - 32px)); text-align: center; line-height: 1.4; border-radius: 16px; }
.foot { text-align: center; font-family: var(--label-font); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 0 16px 40px; }

/* modal (looks + axis picker) */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.modal.open { opacity: 1; pointer-events: auto; }
.sheet { width: min(1080px, 100%); height: min(86vh, 900px); display: flex; flex-direction: column; background: var(--card); border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5), var(--shadow); transform: translateY(14px) scale(.98); transition: transform .3s var(--ease); overflow: hidden; }
.modal.open .sheet { transform: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 24px 16px; }
.sheet-head h2 { font-family: var(--label-font); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.sheet-head p { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 2px; }
.done { padding: 9px 18px; border-radius: var(--r); background: var(--btn); box-shadow: var(--shadow); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fg); flex: none; }
.search { margin: 0 24px 6px; padding: 12px 16px; border: 0; border-radius: 14px; background: var(--out); box-shadow: var(--shadow-press); outline: none; font-size: 14px; }
.search:focus { outline: 1.5px solid var(--accent); }
.grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; align-content: start; padding: 16px 24px 24px; overflow-y: auto; }
.card { text-align: left; padding: 8px; border-radius: 16px; transition: background .2s, transform .2s var(--ease); position: relative; }
.card:hover { background: var(--btn); box-shadow: var(--shadow); transform: translateY(-2px); }
.card.on { outline: 2px solid var(--accent); background: var(--btn); }
.card.on::after { content: '✓'; position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; display: grid; place-items: center; }
.badge { position: absolute; left: 14px; top: 14px; padding: 3px 8px; border-radius: var(--r); background: rgba(0,0,0,.6); color: #fff; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; backdrop-filter: blur(4px); }
.card b { display: block; font-size: 13.5px; font-weight: 600; margin-top: 9px; line-height: 1.25; }
.card p { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #111; box-shadow: 0 0 0 1px var(--line); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb-art { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-family: var(--mono); font-weight: 700; font-size: clamp(15px, 1.6vw, 20px); letter-spacing: .04em; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.thumb-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.thumb-art .lbl { position: relative; }
.thumb-art .sphere { width: 56%; aspect-ratio: 1; border-radius: 50%; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-top: 1px solid var(--line); font-family: var(--label-font); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.quad { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--line); }
.quad i { position: relative; overflow: hidden; }
.card code { font-family: var(--mono); font-size: 11px; color: var(--muted); }

@media (max-width: 1000px) {
  .wrap { grid-template-columns: 1fr; }
  .side { position: static; }
  .nav { display: none; }
}
@media (max-width: 620px) {
  .desks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand small { display: none; }
  .axes { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .actions { grid-template-columns: 1fr 1fr; }
  .actions .primary { grid-column: 1 / -1; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 14px 18px; gap: 8px; }
  .sheet-head, .sheet-foot { padding-inline: 16px; }
  .search { margin-inline: 16px; }
  .sheet { height: 92vh; }
}

/* ===== shell v2 (VVHUB) ===== */
[data-desk="limpo"], [data-desk="papel"] { --key: #5f7d00; --tr: #00808c; --ok: #1a8a4a; }
[data-desk="grafite"], [data-desk="noite"] { --key: #c8f03c; --tr: #35dfe8; --ok: #3ce08a; }
body { font-size: 14px; }
.top.shell { gap: 16px; padding: 10px clamp(14px, 2vw, 28px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; background: var(--bg); }
.logo img { height: 30px; width: auto; display: block; }
.logo .logo-light { display: none; }
[data-desk="limpo"] .logo .logo-dark, [data-desk="papel"] .logo .logo-dark { display: none; }
[data-desk="limpo"] .logo .logo-light, [data-desk="papel"] .logo .logo-light { display: block; }
.tabs { display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--btn); box-shadow: var(--shadow-press); margin: 0 auto; }
.tabs button { display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--btn-fg); white-space: nowrap; }
.tabs button i { font-size: 16px; }
.tabs button.on { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.tabs button.on i { color: var(--accent); }
.top-right { display: flex; align-items: center; gap: 8px; }
.top.shell .langs { margin-left: 0; }
.desks.mini { display: flex; gap: 5px; max-width: none; margin: 0; padding: 0; }
.desks.mini .desk { width: 22px; height: 22px; padding: 0; border-radius: 7px; box-shadow: 0 0 0 1px var(--line); }
.desks.mini .desk.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.desks.mini .desk.on::after { content: none; }
.icon-btn i { font-size: 17px; }
.panel { border-radius: 14px; border: 1px solid var(--line); }
.wrap, .chars-wrap { margin-top: 18px; }
.soon-wrap { max-width: 560px; margin: 60px auto; padding: 0 16px; }
.soon { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 36px 28px; }
.soon > i { font-size: 34px; color: var(--accent); }
.soon h2 { font-family: var(--head); font-weight: 800; font-size: 26px; }
.soon p { color: var(--muted); }
.soon .act { display: grid; place-items: center; padding: 0 22px; text-decoration: none; }
.statusbar { width: min(1280px, calc(100% - 2 * clamp(16px, 3vw, 40px))); margin: 0 auto 14px; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; font-size: 12px; color: var(--muted); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); }
.statusbar b { color: var(--fg); font-weight: 600; }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; margin-right: 6px; }
.sdot.off { background: var(--muted); }
.sright { margin-left: auto; }
.spin { border: 0; background: url(brand/ball.png) center / cover; width: 26px; height: 26px; }
.foot { padding-bottom: 24px; }
.login-page .logo img { height: 34px; }
@media (max-width: 1150px) {
  .top.shell { flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; overflow-x: auto; margin: 0; }
  .top-right { margin-left: auto; }
}

/* ===== níveis de acesso ===== */
.rtag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-family: var(--mono); font-size: 10px; font-style: normal; font-weight: 700; letter-spacing: .04em; box-shadow: inset 0 0 0 1px var(--line); color: var(--btn-fg); }
.rtag.r-admin { color: #fff; background: var(--accent); box-shadow: none; }
.rtag.r-vip { color: var(--key); box-shadow: inset 0 0 0 1px var(--key); }
.rtag.r-free { color: var(--tr); box-shadow: inset 0 0 0 1px var(--tr); }
.user-pill .rtag { margin-left: 4px; }
.actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.actions .act { font-size: 12px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#quality button:disabled { opacity: .35; cursor: not-allowed; }
[data-role="free"] #refsGroup, [data-role="free"] #resultsWrap, [data-role="free"] .gen-opts, [data-role="free"] #trRow, [data-role="free"] #improve { display: none !important; }
.sheet.users-sheet { width: min(1280px, 100%); }
.users-body { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0; }
.utable-wrap { overflow-x: auto; padding: 0 0 20px 24px; }
.utable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.utable th { text-align: left; font-family: var(--label-font); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.utable td { padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.utable td.num { font-family: var(--mono); }
.utable tr[data-urow] { cursor: pointer; }
.utable tr[data-urow]:hover td { background: var(--btn); }
.utable tr.on td { background: var(--btn); box-shadow: inset 0 -1.5px 0 var(--accent); }
.utable small { color: var(--muted); }
.utable .paused { color: var(--accent); font-weight: 600; }
.users-form { border-left: 1px solid var(--line); align-content: start; }
.users-form h3 { font-family: var(--head); font-weight: 800; font-size: 18px; }
.uf-grid { display: grid; gap: 12px; }
.settings-body select { border: 0; border-radius: 14px; padding: 12px 14px; background: var(--out); box-shadow: var(--shadow-press); outline: none; font: inherit; font-size: 14px; color: var(--fg); }
.settings-body input[readonly] { opacity: .6; }
@media (max-width: 860px) {
  .users-body { grid-template-columns: 1fr; }
  .users-form { border-left: 0; border-top: 1px solid var(--line); }
  .utable-wrap { padding: 0 16px 12px; }
  .actions { grid-template-columns: 1fr 1fr; }
}

/* ===== editar ===== */
.m-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 9px; background: var(--btn); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 600; color: var(--btn-fg); text-decoration: none; }
.m-btn i { font-size: 15px; }
.m-btn.on { color: var(--fg); box-shadow: var(--shadow-press); outline: 1.5px solid var(--accent); }
.m-btn:disabled { opacity: .5; cursor: default; }
.m-btn small { font-family: var(--mono); font-size: 9.5px; font-weight: 500; color: var(--muted); }
.m-pb { padding: 12px 14px; }
.m-lab { font-family: var(--label-font); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.m-pb > .m-lab:first-child { margin-top: 0; }
.m-in { width: 100%; border: 0; border-radius: 10px; padding: 10px 12px; background: var(--out); box-shadow: var(--shadow-press); font-size: 13px; outline: none; resize: vertical; }
.m-in:focus { outline: 1.5px solid var(--accent); }
.m-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.m-chip { padding: 6px 11px; border-radius: 8px; font-size: 12px; background: var(--out); box-shadow: inset 0 0 0 1px var(--line); color: var(--btn-fg); }
.m-chip.on { color: var(--fg); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--accent); }
.m-cta { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; width: 100%; border-radius: 11px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .03em; }
.m-cta.confirm { background: var(--fg); color: var(--bg); }
.m-cta:disabled { background: var(--btn); color: var(--muted); font-weight: 500; box-shadow: var(--shadow); cursor: default; }
.ed-wrap { max-width: 1480px; margin: 18px auto 30px; padding: 0 clamp(14px, 2vw, 28px); display: grid; gap: 12px; }
.panel.ed-modes { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; }
.panel.ed-empty { padding: 18px; }
.ed-drop { min-height: 300px; flex-direction: column; gap: 8px; text-align: center; color: var(--muted); }
.ed-drop i { font-size: 40px; color: var(--accent); }
.ed-drop b { font-size: 17px; color: var(--fg); }
.ed-grid { display: grid; grid-template-columns: 56px minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
.ed-grid.no-tools { grid-template-columns: minmax(0, 1fr) 340px; }
.panel.ed-tools { display: grid; gap: 6px; justify-items: center; padding: 8px; }
.ed-tools button { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; color: var(--btn-fg); background: var(--btn); box-shadow: var(--shadow); }
.ed-tools button.on { color: #fff; background: var(--accent); }
.ed-tools hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
#edSize { writing-mode: vertical-lr; direction: rtl; width: 22px; height: 120px; accent-color: var(--accent); }
.panel.ed-canvas-panel, .panel.ed-side, #edVersWrap { padding: 0; overflow: hidden; }
.ed-bar { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.ed-bar > i { font-size: 17px; color: var(--muted); }
.ed-bar .sp { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 400; font-size: 12px; color: var(--muted); }
.ed-stage { position: relative; background: repeating-conic-gradient(#1a1a1a 0 25%, #222 0 50%) 0 0 / 22px 22px; max-height: 72vh; margin: 0 auto; }
.ed-stage img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; }
.ed-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; cursor: crosshair; touch-action: none; }
.ed-busy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; }
.ed-busy .spin { width: 42px; height: 42px; }
.ed-hint, .ed-cost { font-size: 12px; color: var(--muted); line-height: 1.45; }
.ed-cost { margin: 14px 0 8px; }
.ed-ref { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; background: var(--out); box-shadow: inset 0 0 0 1px var(--line); }
.ed-ref img { width: 64px; height: 44px; border-radius: 8px; object-fit: cover; }
.ed-charbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-inv { margin-top: 14px; }
.ed-vers { display: flex; gap: 10px; overflow-x: auto; padding: 12px 14px; }
.ed-ver { flex: none; width: 150px; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); position: relative; background: var(--out); padding: 0; }
.ed-ver.on { box-shadow: 0 0 0 2px var(--accent); }
.ed-ver img, .ed-ver-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: grid; place-items: center; color: var(--accent); font-weight: 700; }
.ed-ver > span:last-child { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; font-family: var(--mono); font-size: 10.5px; }
@media (max-width: 1050px) {
  .ed-grid, .ed-grid.no-tools { grid-template-columns: 1fr; }
  .panel.ed-tools { display: flex; flex-wrap: wrap; justify-content: flex-start; }
  .ed-tools hr { display: none; }
  #edSize { writing-mode: horizontal-tb; direction: ltr; width: 120px; height: 22px; }
}

.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.foot-links a { color: var(--muted); text-decoration: none; opacity: .75; transition: opacity .2s, color .2s; }
.foot-links a:hover { opacity: 1; color: var(--fg); }
