﻿@import url("./fonts.css");

:root {
  --bg: #090c0f;
  --panel: #11161b;
  --panel-2: #0d1115;
  --panel-3: #171d23;
  --line: #202730;
  --line-soft: #171c22;
  --text: #edf3f8;
  --muted: #a9b6c2;
  --accent: #19a0ff;
  --accent-2: #21c07a;
  --warn: #f0a33a;
  --danger: #ef5b5b;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(25, 160, 255, 0.14), transparent 36%),
    linear-gradient(180deg, #0b0f13, #07090b);
}

/* Public site and account entry */
.landing-page {
  min-height: 100vh;
  background: #090c0f;
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 62px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(18px, 4vw, 64px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 12, 15, 0.94);
  backdrop-filter: blur(12px);
}

.landing-nav,
.landing-auth-actions,
.landing-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.landing-nav {
  justify-content: center;
  gap: 28px;
}

.landing-nav a,
.landing-footer > a:not(.brand) {
  color: var(--muted);
  font-weight: 700;
}

.landing-nav a:hover,
.landing-footer > a:not(.brand):hover {
  color: var(--text);
}

.landing-hero {
  position: relative;
  min-height: calc(100svh - 108px);
  display: grid;
  align-items: center;
  overflow: hidden;
  background: #0d1115 url("../assets/revo-product-preview.png") center / cover no-repeat;
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 8, 0.74);
}

.landing-hero-inner {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0;
}

.landing-kicker,
.landing-section-head > span,
.services-eyebrow {
  color: #79c9ff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.landing-hero h1 {
  max-width: 760px;
  margin: 14px 0 0;
  font-size: clamp(52px, 8vw, 92px);
  line-height: 0.98;
  letter-spacing: 0;
}

.landing-hero p {
  max-width: 650px;
  margin: 24px 0 0;
  color: #d7e0e8;
  font-size: 20px;
  line-height: 1.55;
}

.landing-hero-actions {
  margin-top: 30px;
}

.landing-secondary {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(9, 12, 15, 0.6);
}

.landing-band {
  padding: 78px clamp(20px, 6vw, 96px);
  border-top: 1px solid var(--line-soft);
}

.landing-intro,
.landing-pricing {
  background: #0d1115;
}

.landing-flow {
  background: #090c0f;
}

.landing-section-head {
  width: min(1180px, 100%);
  margin: 0 auto 36px;
}

.landing-section-head h2 {
  max-width: 760px;
  margin: 8px 0 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: 0;
}

.landing-section-head p {
  max-width: 660px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.landing-feature-grid,
.landing-steps,
.landing-price-row {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.landing-feature-grid article {
  min-height: 220px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11161b;
}

.landing-feature-number {
  color: var(--accent);
  font-weight: 800;
}

.landing-feature-grid h3 {
  margin: 38px 0 8px;
  font-size: 20px;
}

.landing-feature-grid p,
.landing-steps span,
.landing-price-row p {
  margin: 0;
  color: var(--muted);
}

.landing-steps {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}

.landing-steps li {
  display: grid;
  grid-template-columns: minmax(160px, 0.4fr) 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.landing-price-row {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 36px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.landing-price-row > div {
  display: grid;
}

.landing-price-row strong {
  font-size: 32px;
}

.landing-price-row span {
  color: var(--muted);
}

.landing-footer {
  min-height: 96px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 20px clamp(20px, 6vw, 96px);
  color: var(--muted);
}

.auth-page {
  background: #090c0f;
}

.auth-page .login-shell {
  display: grid;
  gap: 14px;
}

.auth-page .login-brand {
  width: max-content;
}

.auth-page .login-card {
  border-radius: 8px;
}

.auth-heading h1,
.auth-heading p {
  margin: 0;
}

.auth-heading h1 {
  font-size: 26px;
}

.auth-heading p,
.auth-switch,
.auth-back,
.login-form .field small {
  color: var(--muted);
}

.auth-heading p {
  margin-top: 5px;
}

.auth-switch {
  margin: 0;
  text-align: center;
}

.auth-switch a {
  color: #79c9ff;
  font-weight: 800;
}

.auth-back {
  justify-self: center;
  font-size: 13px;
}

.auth-help-link {
  justify-self: end;
  margin-top: -8px;
  color: #79c9ff;
  font-size: 13px;
  font-weight: 700;
}

.auth-turnstile {
  width: 100%;
  min-height: 65px;
}

.auth-turnstile[hidden] {
  display: none;
  min-height: 0;
}

.auth-legal-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-legal-check input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.auth-legal-check a,
.legal-document a {
  color: #79c9ff;
  font-weight: 700;
}

.landing-footer-links {
  display: flex;
  justify-content: end;
  gap: 18px;
}

.landing-footer-links a {
  color: var(--muted);
  font-weight: 700;
}

.landing-footer-links a:hover {
  color: var(--text);
}

.legal-page {
  min-height: 100vh;
  background: #090c0f;
}

.legal-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
}

.legal-document {
  width: min(860px, calc(100% - 36px));
  margin: 0 auto;
  padding: 54px 0 80px;
}

.legal-document > header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.legal-document h1 {
  margin: 8px 0 10px;
  font-size: 38px;
  letter-spacing: 0;
}

.legal-document h2 {
  margin: 34px 0 10px;
  font-size: 20px;
}

.legal-document p,
.legal-document li {
  color: #c2cdd6;
  line-height: 1.7;
}

.legal-document ul {
  padding-left: 22px;
}

.legal-version {
  color: var(--muted);
  font-size: 12px;
}

.auth-status-card {
  justify-items: stretch;
  text-align: center;
}

.auth-status-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 1px solid rgba(25, 160, 255, 0.42);
  border-radius: 8px;
  background: rgba(25, 160, 255, 0.1);
  color: #79c9ff;
  font-size: 21px;
  font-weight: 900;
}

.auth-inline-success,
.auth-inline-error {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(33, 192, 122, 0.34);
  border-radius: 8px;
  background: rgba(33, 192, 122, 0.08);
  text-align: left;
}

.auth-inline-error {
  border-color: rgba(239, 91, 91, 0.34);
  background: rgba(239, 91, 91, 0.08);
}

.auth-inline-success span,
.auth-inline-error span {
  color: var(--muted);
}

.auth-inline-success .btn {
  justify-self: start;
  margin-top: 8px;
}

/* Signed-in services hub */
.services-page {
  min-height: 100vh;
  background: #090c0f;
}

.services-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.services-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.services-heading h1,
.services-heading p,
.services-summary h2 {
  margin: 0;
}

.services-heading h1 {
  margin-top: 7px;
  font-size: 34px;
  line-height: 1.1;
}

.services-heading p {
  margin-top: 8px;
  color: var(--muted);
}

.services-plan-status {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.services-plan-status span {
  color: var(--muted);
  font-size: 12px;
}

.services-plan-status strong {
  color: #8ee8bb;
}

.services-plan-status strong.inactive {
  color: #ffb4b4;
}

.services-notice {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(240, 163, 58, 0.34);
  border-radius: 8px;
  background: rgba(240, 163, 58, 0.08);
}

.services-notice > div {
  display: grid;
}

.services-notice span {
  color: var(--muted);
  font-size: 13px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.service-tile {
  min-height: 290px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11161b;
}

.service-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.service-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(25, 160, 255, 0.42);
  border-radius: 8px;
  background: rgba(25, 160, 255, 0.12);
  color: #8bd0ff;
  font-size: 18px;
  font-weight: 900;
}

.service-control .service-icon {
  border-color: rgba(33, 192, 122, 0.4);
  background: rgba(33, 192, 122, 0.1);
  color: #8ee8bb;
}

.service-projects .service-icon {
  border-color: rgba(240, 163, 58, 0.42);
  background: rgba(240, 163, 58, 0.1);
  color: #ffc978;
}

/* Project manager */
.projects-page { min-height: 100vh; background: #090c0f; }
.projects-shell { width: min(1280px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 72px; }
.projects-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.projects-heading h1 { margin: 6px 0 0; font-size: 34px; }
.projects-heading p { margin: 7px 0 0; color: var(--muted); }
.projects-workspace { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 560px; margin-top: 22px; border: 1px solid var(--line); border-radius: 8px; background: #0d1115; overflow: hidden; }
.projects-sidebar { padding: 18px 12px; border-right: 1px solid var(--line); background: #0a0e12; }
.projects-sidebar-title { display: flex; justify-content: space-between; padding: 0 8px 12px; color: var(--muted); font-size: 12px; }
.project-work-list { display: grid; gap: 3px; }
.project-work-list button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.project-work-list button:hover { background: #131a20; }
.project-work-list button.active { background: rgba(25, 160, 255, 0.14); color: #8bd0ff; }
.project-work-list button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-work-list button strong { color: var(--muted); font-size: 11px; }
.projects-main { min-width: 0; padding: 18px; }
.projects-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; }
.projects-search { width: min(440px, 100%); display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #090d11; }
.projects-search input { width: 100%; height: 40px; padding: 0; border: 0; background: transparent; color: var(--text); outline: 0; }
.projects-select-all { color: var(--muted); font-size: 12px; white-space: nowrap; }
.projects-bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; padding: 9px 11px; border: 1px solid rgba(25, 160, 255, 0.3); border-radius: 6px; background: rgba(25, 160, 255, 0.08); }
.projects-bulk-bar > div { display: flex; gap: 6px; }
.projects-bulk-bar .btn { min-height: 32px; padding: 6px 10px; }
.project-list { display: grid; gap: 7px; }
.project-row { display: grid; grid-template-columns: 22px 88px minmax(180px, 1fr) minmax(270px, auto) auto; align-items: center; gap: 14px; min-height: 78px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #11171c; }
.project-row:hover { border-color: #2a3945; background: #131a20; }
.project-miniature { aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; border: 1px solid #29343d; border-radius: 4px; background-color: #151b20; background-image: linear-gradient(45deg, #1d252c 25%, transparent 25%), linear-gradient(-45deg, #1d252c 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #1d252c 75%), linear-gradient(-45deg, transparent 75%, #1d252c 75%); background-size: 12px 12px; background-position: 0 0, 0 6px, 6px -6px, -6px 0; color: #8bd0ff; font-weight: 900; }
.project-info { min-width: 0; display: grid; gap: 4px; }
.project-info strong, .project-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-info span, .project-meta span { color: var(--muted); font-size: 11px; }
.project-meta { display: grid; grid-template-columns: repeat(3, minmax(70px, auto)); gap: 16px; }
.project-actions { display: flex; align-items: center; gap: 6px; }
.project-actions > .btn { min-height: 34px; padding: 7px 12px; }
.project-action-menu { position: relative; }
.project-action-menu summary { list-style: none; cursor: pointer; }
.project-action-menu summary::-webkit-details-marker { display: none; }
.project-action-menu > div { position: absolute; z-index: 20; top: calc(100% + 5px); right: 0; width: 150px; padding: 5px; border: 1px solid var(--line); border-radius: 6px; background: #151b20; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.project-action-menu button { width: 100%; padding: 8px 9px; border: 0; border-radius: 4px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.project-action-menu button:hover { background: #202931; }
.project-action-menu button.danger { color: #ff9f9f; }
.projects-empty { min-height: 260px; display: grid; place-content: center; justify-items: center; gap: 5px; color: var(--muted); }
.projects-empty strong { color: var(--text); }
.project-destination-dialog { width: min(500px, calc(100% - 28px)); }
.project-destination-fields { display: grid; gap: 14px; }
.project-destination-fields label { display: grid; gap: 6px; }
.project-destination-fields label > span { color: var(--muted); font-size: 12px; }
.project-destination-fields select { width: 100%; }

@media (max-width: 980px) {
  .services-grid { grid-template-columns: 1fr; }
  .project-row { grid-template-columns: 22px 76px minmax(140px, 1fr) auto; }
  .project-meta { display: none; }
}

@media (max-width: 720px) {
  .projects-shell { width: min(100% - 24px, 1280px); padding-top: 22px; }
  .projects-workspace { grid-template-columns: 1fr; }
  .projects-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .project-work-list { display: flex; overflow-x: auto; }
  .project-work-list button { width: auto; min-width: max-content; }
  .projects-toolbar, .projects-bulk-bar { align-items: stretch; flex-direction: column; }
  .projects-bulk-bar > div { overflow-x: auto; }
  .project-row { grid-template-columns: 20px 64px minmax(0, 1fr); gap: 10px; }
  .project-actions { grid-column: 2 / -1; }
}

.service-state {
  color: #8ee8bb;
  font-size: 12px;
  font-weight: 800;
}

.service-state.locked {
  color: var(--warn);
}

.service-tile h2 {
  margin: 0;
  font-size: 28px;
}

.service-tile p {
  max-width: 480px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.service-tile > .btn {
  justify-self: start;
}

.services-summary {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.services-summary > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.services-summary > header span,
.services-summary > header a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.services-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 0.55fr)) minmax(260px, 1.4fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1115;
}

.services-stats > div {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.services-stats > div:last-child {
  border-right: 0;
}

.services-stats strong {
  font-size: 22px;
}

.services-stats span {
  color: var(--muted);
  font-size: 12px;
}

.services-storage-stat > div:first-child {
  display: grid;
}

.services-storage-track {
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}

.services-storage-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

@media (max-width: 760px) {
  .landing-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 0 14px;
  }
  .landing-nav { display: none; }
  .landing-auth-actions .btn:first-child { display: none; }
  .landing-hero { min-height: calc(100svh - 104px); }
  .landing-hero-inner { width: min(100% - 32px, 1180px); padding: 56px 0; }
  .landing-hero h1 { font-size: 54px; }
  .landing-hero p { font-size: 17px; }
  .landing-feature-grid { grid-template-columns: 1fr; }
  .landing-feature-grid article { min-height: 180px; }
  .landing-steps li { grid-template-columns: 1fr; gap: 6px; }
  .landing-price-row { grid-template-columns: 1fr; gap: 18px; }
  .landing-footer { grid-template-columns: 1fr; justify-items: start; }
  .services-shell { width: min(100% - 28px, 1180px); padding-top: 24px; }
  .services-heading { align-items: start; }
  .services-plan-status { justify-items: start; }
  .services-grid { grid-template-columns: 1fr; }
  .service-tile { min-height: 250px; }
  .services-stats { grid-template-columns: repeat(3, 1fr); }
  .services-stats > div:nth-child(3) { border-right: 0; }
  .services-stats > .services-storage-stat { grid-column: 1 / -1; border-top: 1px solid var(--line); }
}

@media (max-width: 520px) {
  .landing-auth-actions .btn { padding-inline: 10px; }
  .landing-band { padding: 56px 18px; }
  .landing-hero-actions { align-items: stretch; flex-direction: column; width: min(260px, 100%); }
  .services-heading { display: grid; }
  .services-notice { align-items: stretch; flex-direction: column; }
  .services-notice .btn { text-align: center; }
  .services-stats { grid-template-columns: 1fr; }
  .services-stats > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .services-stats > div:nth-child(3) { border-bottom: 1px solid var(--line); }
  .services-stats > .services-storage-stat { grid-column: auto; border-top: 0; border-bottom: 0; }
}

.login-shell {
  width: min(430px, 100%);
}

.login-card {
  display: grid;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 17, 21, 0.92);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand div {
  display: grid;
  gap: 2px;
}

.login-brand strong {
  font-size: 18px;
  font-weight: 800;
}

.login-brand span:not(.brand-mark) {
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form .btn {
  min-height: 40px;
}

.login-test-accounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 4px;
}

.login-test-accounts > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.login-test-accounts button {
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.login-test-accounts button:hover {
  border-color: rgba(25, 160, 255, 0.5);
  background: rgba(25, 160, 255, 0.12);
}

.app-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 50px 1fr;
}

.editor-page {
  height: 100vh;
  grid-template-rows: 50px minmax(0, 1fr);
  overflow: hidden;
}

.admin-page {
  min-height: 100vh;
  background: #090c0f;
}

.profile-page {
  min-height: 100vh;
  background: #090c0f;
}

.profile-shell {
  min-height: 0;
  display: grid;
  gap: 18px;
  padding: 22px;
}

.profile-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 20px;
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(25, 160, 255, 0.18), rgba(33, 192, 122, 0.07)),
    radial-gradient(circle at 100% 0%, rgba(25, 160, 255, 0.12), transparent 30%),
    var(--panel-2);
}

.profile-hero-copy {
  display: grid;
  align-content: end;
  max-width: 760px;
}

.profile-kicker {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  border: 1px solid rgba(25, 160, 255, 0.28);
  border-radius: 999px;
  background: rgba(25, 160, 255, 0.1);
  color: #a9dcff;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.profile-hero h1,
.profile-hero p {
  margin: 0;
}

.profile-hero h1 {
  margin-top: 16px;
  font-size: 36px;
  line-height: 1.1;
}

.profile-hero p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
}

.profile-health-card {
  width: min(340px, 100%);
  display: grid;
  align-content: end;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(9, 12, 15, 0.42);
  padding: 16px;
}

.profile-health-card > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-health-card span,
.profile-health-card strong {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 17, 21, 0.72);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.profile-health-card strong {
  border-color: rgba(33, 192, 122, 0.34);
  color: #a6f3ce;
}

.profile-health-card strong.blocked {
  border-color: rgba(239, 91, 91, 0.34);
  color: #ffd1d1;
}

.profile-health-card small {
  color: var(--muted);
  font-weight: 800;
}

.profile-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.profile-action-card {
  min-height: 132px;
  display: grid;
  align-content: end;
  gap: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  padding: 16px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.profile-action-card:hover {
  border-color: rgba(25, 160, 255, 0.42);
  background: #111820;
  transform: translateY(-1px);
}

.profile-action-card.primary {
  border-color: rgba(25, 160, 255, 0.42);
  background: linear-gradient(135deg, rgba(25, 160, 255, 0.18), rgba(25, 160, 255, 0.05)), var(--panel-2);
}

.profile-action-card span {
  width: max-content;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(25, 160, 255, 0.28);
  border-radius: 999px;
  background: rgba(25, 160, 255, 0.09);
  color: #a9dcff;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
}

.profile-action-card strong {
  font-size: 17px;
}

.profile-action-card small {
  color: var(--muted);
  font-size: 13px;
}

.profile-overview {
  display: grid;
  grid-template-columns: minmax(290px, 0.85fr) minmax(480px, 1.5fr) minmax(300px, 0.95fr);
  gap: 14px;
  align-items: start;
}

.profile-today-panel,
.profile-storage-panel,
.profile-links-panel,
.profile-account-panel {
  grid-column: 1;
}

.profile-work-panel {
  grid-column: 2;
  grid-row: 1 / span 4;
}

.profile-storage-panel {
  grid-column: 3;
}

.profile-links-panel {
  grid-column: 3;
}

.profile-account-panel {
  grid-column: 3;
}

.profile-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 14px;
}

.profile-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-panel h2,
.profile-panel p {
  margin: 0;
}

.profile-panel h2 {
  font-size: 17px;
}

.profile-panel p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.profile-storage-panel header > strong {
  color: #a6f3ce;
  font-size: 14px;
}

.profile-storage-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #05080b;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.profile-storage-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #19a0ff, #21c07a);
  transition: width 180ms ease;
}

.profile-stat-list {
  display: grid;
  gap: 8px;
}

.profile-stat-list div {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(9, 12, 15, 0.42);
  padding: 0 12px;
}

.profile-stat-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-stat-list strong {
  font-size: 22px;
}

.profile-storage-breakdown,
.profile-info-list {
  display: grid;
  gap: 8px;
}

.profile-storage-breakdown div,
.profile-info-list div {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(9, 12, 15, 0.42);
  padding: 0 10px;
}

.profile-storage-breakdown span,
.profile-info-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-storage-breakdown strong,
.profile-info-list strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(9, 12, 15, 0.42);
  padding: 10px;
}

.profile-link-row div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.profile-link-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-link-row span {
  color: var(--muted);
  font-size: 12px;
}

.profile-link-row .btn {
  width: 100%;
}

.profile-productions {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 270px);
  overflow: auto;
  padding-right: 2px;
}

.profile-production-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(260px, auto);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(9, 12, 15, 0.42);
  padding: 10px;
}

.profile-production-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.profile-production-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-production-title small {
  color: var(--muted);
}

.profile-production-counts {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-production-counts span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 17, 21, 0.72);
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
}

.profile-empty {
  display: grid;
  gap: 4px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.profile-empty strong {
  color: var(--text);
}

.admin-shell {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
}

.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.admin-header h1,
.admin-header p {
  margin: 0;
}

.admin-header h1 {
  font-size: 22px;
  font-weight: 700;
}

.admin-header p {
  margin-top: 4px;
  color: var(--muted);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.admin-stats div {
  min-height: 62px;
  display: grid;
  gap: 4px;
  align-content: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px 12px;
}

.admin-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.admin-stats strong {
  font-size: 24px;
  line-height: 1;
}

.admin-tabs {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 4px;
}

.admin-tabs button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

.admin-tabs button.active,
.admin-tabs button:hover {
  background: rgba(25, 160, 255, 0.14);
  color: var(--text);
}

.admin-panel {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
}

.admin-table-head,
.admin-user-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(190px, 1.1fr) minmax(150px, 0.9fr) 100px 100px 68px minmax(430px, auto);
  align-items: center;
  gap: 10px;
}

.admin-table-head {
  min-height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.admin-users-list {
  max-height: calc(100vh - 250px);
  overflow: auto;
}

.admin-user-row {
  min-height: 62px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.admin-user-row:last-child {
  border-bottom: 0;
}

.admin-user-main,
.admin-user-email {
  min-width: 0;
}

.admin-user-main {
  display: grid;
  gap: 2px;
}

.admin-user-plan {
  min-width: 0;
  display: grid;
  gap: 3px;
  justify-items: start;
}

.admin-user-plan small {
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-main strong,
.admin-user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-main small {
  color: var(--muted);
  font-size: 11px;
}

.admin-pill,
.admin-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(25, 160, 255, 0.28);
  border-radius: 999px;
  background: rgba(25, 160, 255, 0.1);
  color: #a9dcff;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 700;
}

.admin-status {
  border-color: rgba(33, 192, 122, 0.28);
  background: rgba(33, 192, 122, 0.1);
  color: #a6f3ce;
}

.admin-status.blocked {
  border-color: rgba(239, 91, 91, 0.34);
  background: rgba(239, 91, 91, 0.12);
  color: #ffd1d1;
}

.admin-sessions {
  color: var(--muted);
  font-weight: 800;
}

.admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.admin-actions .btn {
  min-height: 30px;
  padding: 0 9px;
}

.admin-actions details {
  position: relative;
}

.admin-actions summary {
  list-style: none;
  width: 30px;
  height: 30px;
}

.admin-actions summary::-webkit-details-marker {
  display: none;
}

.admin-actions-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1217;
  box-shadow: var(--shadow);
}

.admin-actions-menu button {
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 10px;
  font-weight: 800;
  cursor: pointer;
}

.admin-actions-menu button:hover {
  background: rgba(25, 160, 255, 0.12);
  color: #8fd0ff;
}

.admin-actions-menu span {
  display: block;
  height: 1px;
  margin: 5px 2px;
  background: var(--line-soft);
}

.admin-empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.admin-section-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 14px;
}

.admin-section-head h2,
.admin-section-head p {
  margin: 0;
}

.admin-section-head h2 {
  font-size: 17px;
}

.admin-section-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.admin-plans-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 302px);
  overflow: auto;
  padding: 12px;
}

.admin-fixed-catalog,
.admin-gateway-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
}

.admin-gateway-status.connected {
  border-color: rgba(33, 192, 122, 0.42);
  background: rgba(33, 192, 122, 0.1);
  color: #a6f3ce;
}

.admin-gateway-status.not-configured {
  border-color: rgba(240, 163, 58, 0.42);
  background: rgba(240, 163, 58, 0.1);
  color: #ffd79a;
}

.admin-invoice-head,
.admin-invoice-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) minmax(150px, 0.9fr) 100px 130px 150px 150px auto;
  align-items: center;
  gap: 10px;
}

.admin-invoice-head {
  min-height: 40px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  padding: 0 14px;
  font-size: 11px;
  font-weight: 800;
}

.admin-invoices-list { max-height: calc(100vh - 300px); overflow: auto; }

.admin-invoice-row {
  min-height: 58px;
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 14px;
}

.admin-invoice-row > div { min-width: 0; display: grid; gap: 2px; }
.admin-invoice-actions .btn { min-height: 28px; padding: 0 9px; }
.admin-invoice-row small,
.admin-invoice-date,
.admin-invoice-payment { color: var(--muted); font-size: 12px; }
.admin-invoice-plan { font-weight: 700; }
.admin-invoice-status {
  width: max-content;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}
.admin-invoice-status.paid { border-color: rgba(33, 192, 122, 0.42); color: #a6f3ce; background: rgba(33, 192, 122, 0.1); }
.admin-invoice-status.pending { border-color: rgba(240, 163, 58, 0.42); color: #ffd79a; background: rgba(240, 163, 58, 0.1); }
.admin-invoice-status.expired,
.admin-invoice-status.canceled { border-color: rgba(239, 91, 91, 0.42); color: #ffb4b4; background: rgba(239, 91, 91, 0.1); }

.admin-plan-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(9, 12, 15, 0.42);
  padding: 12px;
}

.admin-plan-card.inactive {
  opacity: 0.72;
}

.admin-plan-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-plan-main strong,
.admin-plan-main small,
.admin-plan-main p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-plan-main small,
.admin-plan-main p {
  color: var(--muted);
}

.admin-plan-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-plan-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 17, 21, 0.72);
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
}

.user-admin-dialog {
  width: min(680px, calc(100vw - 44px));
}

.user-plan-dialog,
.plan-admin-dialog {
  width: min(720px, calc(100vw - 44px));
}

.user-dialog-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-password-field {
  grid-column: 1 / -1;
}

.plan-dialog-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plan-description-field {
  grid-column: 1 / -1;
}

.billing-page {
  min-height: 100vh;
  background: #090c0f;
}

.billing-shell {
  min-height: 0;
  display: grid;
  gap: 18px;
  padding: 22px;
}

.billing-hero {
  min-height: 170px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(25, 160, 255, 0.16), rgba(33, 192, 122, 0.06)),
    var(--panel-2);
  padding: 24px;
}

.billing-hero h1,
.billing-hero p {
  margin: 0;
}

.billing-hero h1 {
  margin-top: 14px;
  font-size: 34px;
  line-height: 1.1;
}

.billing-hero p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.billing-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(340px, 1fr);
  gap: 14px;
  align-items: start;
}

.billing-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 14px;
}

.billing-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.billing-card header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.billing-card h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.billing-status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(33, 192, 122, 0.34);
  border-radius: 999px;
  background: rgba(33, 192, 122, 0.1);
  color: #a6f3ce;
  padding: 0 10px;
  font-size: 12px;
}

.billing-status[data-status="past_due"],
.billing-status[data-status="canceled"] {
  border-color: rgba(239, 91, 91, 0.34);
  background: rgba(239, 91, 91, 0.12);
  color: #ffd1d1;
}

.billing-current-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.billing-current-main > div {
  min-height: 62px;
  display: grid;
  gap: 4px;
  align-content: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(9, 12, 15, 0.42);
  padding: 10px;
}

.billing-current-main span,
.billing-storage span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.billing-current-main strong {
  font-size: 18px;
}

.billing-storage {
  display: grid;
  gap: 8px;
}

.billing-storage > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.billing-storage strong {
  color: #a6f3ce;
}

.billing-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.billing-steps li,
.billing-note {
  color: var(--muted);
}

.billing-note {
  margin: 0;
  border: 1px solid rgba(25, 160, 255, 0.18);
  border-radius: 8px;
  background: rgba(25, 160, 255, 0.08);
  padding: 10px;
}

.billing-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.billing-plans-card {
  grid-column: 1 / -1;
}

.billing-plan-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.billing-plan-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(9, 12, 15, 0.42);
  padding: 12px;
}

.billing-plan-card.current,
.billing-plan-card.highlighted {
  border-color: rgba(25, 160, 255, 0.42);
  background: rgba(25, 160, 255, 0.08);
}

.billing-plan-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.billing-plan-card span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(25, 160, 255, 0.28);
  border-radius: 999px;
  color: #a9dcff;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
}

.billing-plan-card p,
.billing-plan-card small,
.billing-empty {
  color: var(--muted);
}

.billing-plan-card p {
  margin: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 50px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(9, 12, 15, 0.97);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-weight: 800;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #19a0ff, #21c07a);
  color: #071014;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.nav a,
.link-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.nav a:hover,
.nav a.active,
.link-pill:hover {
  border-color: var(--line-soft);
  background: var(--panel-2);
  color: var(--text);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.link-split-action {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  overflow: visible;
}

.link-split-action > .btn,
.link-split-action .link-options > summary {
  border: 0;
  background: transparent;
  border-radius: 0;
}

.link-split-action > .btn {
  min-height: 30px;
  padding-right: 8px;
}

.link-options {
  position: relative;
}

.link-options > summary {
  list-style: none;
  width: 30px;
  height: 30px;
  color: var(--muted);
}

.link-options > summary::-webkit-details-marker {
  display: none;
}

.link-options[open] > summary,
.link-options > summary:hover {
  color: var(--text);
  background: rgba(25, 160, 255, 0.12);
}

.link-options-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1217;
  box-shadow: var(--shadow);
}

.link-options-menu button {
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 10px;
  font-weight: 800;
  cursor: pointer;
}

.link-options-menu button:hover {
  background: rgba(25, 160, 255, 0.12);
  color: #8fd0ff;
}

.file-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-file-actions {
  max-width: min(720px, 58vw);
}

.control-file-actions {
  max-width: min(520px, 42vw);
}

.topbar .app-nav {
  margin-left: auto;
}

.workspace-nav {
  margin-left: 4px;
}

.library-toggle {
  flex: 0 0 auto;
  width: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  color: var(--text);
}

.library-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.library-toggle span + span {
  margin-top: 4px;
}

.library-toggle[aria-pressed="true"] {
  border-color: rgba(25, 160, 255, 0.55);
  background: rgba(25, 160, 255, 0.14);
}

.top-actions select {
  min-height: 30px;
  max-width: 220px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 9px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-right .app-nav {
  margin-left: 0;
}

.account-menu {
  position: relative;
}

.account-trigger {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 6px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.account-trigger:hover,
.account-menu.open .account-trigger {
  border-color: var(--line);
  background: var(--panel-3);
}

.account-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #19a0ff, #21c07a);
  color: #071014;
  font-size: 12px;
  font-weight: 800;
}

.account-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 700;
}

.account-caret {
  color: var(--muted);
  font-size: 11px;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  min-width: 190px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d1217;
  box-shadow: var(--shadow);
}

.account-dropdown[hidden] {
  display: none;
}

.account-dropdown a,
.account-dropdown button {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  line-height: 34px;
  text-align: left;
  cursor: pointer;
}

.account-dropdown a:hover,
.account-dropdown button:hover {
  background: rgba(25, 160, 255, 0.12);
  color: #8fd0ff;
}

.account-dropdown [data-account-logout] {
  margin-top: 2px;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 7px 7px;
  color: var(--muted);
}

.menu-popover {
  position: relative;
}

.menu-popover > summary {
  list-style: none;
}

.menu-popover > summary::-webkit-details-marker {
  display: none;
}

.menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  min-width: 230px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151a;
  box-shadow: var(--shadow);
  overflow: visible;
}

.topbar .file-actions .menu-list {
  left: 0;
  right: auto;
}

.menu-list .btn {
  justify-content: flex-start;
  width: 100%;
  min-height: 30px;
  border-radius: 6px;
  color: var(--text);
  padding: 0 10px;
}

.menu-list .btn:hover {
  background: #151d24;
}

.menu-list .btn.danger {
  color: #ffd1d1;
}

.menu-separator {
  display: block;
  height: 1px;
  margin: 5px 2px;
  background: var(--line-soft);
}

.menu-submenu {
  position: relative;
}

.menu-submenu-trigger {
  justify-content: space-between !important;
}

.menu-submenu-list {
  position: absolute;
  top: -6px;
  left: calc(100% + 6px);
  z-index: 95;
  min-width: 260px;
  display: none;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151a;
  box-shadow: var(--shadow);
}

.topbar .file-actions .menu-submenu-list {
  max-width: min(360px, calc(100vw - 340px));
}

.menu-submenu:hover .menu-submenu-list,
.menu-submenu:focus-within .menu-submenu-list {
  display: grid;
}

.recent-project-button {
  min-height: 42px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 1px;
}

.recent-project-button strong,
.recent-project-button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-project-button small,
.menu-empty {
  color: var(--muted);
  font-size: 11px;
}

.menu-empty {
  display: block;
  padding: 9px 10px;
}

.file-crumb {
  min-width: 0;
  max-width: min(460px, 38vw);
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b0f13;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 10px;
}

.technical-select,
#editorProductionSelect,
.control-taskbar .production-bar,
.control-taskbar .operation-bar,
.control-taskbar > .library-actions {
  display: none !important;
}

.chip-like {
  min-height: 30px;
  min-width: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b0f13;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.toolbar-menu {
  position: relative;
}

.toolbar-menu > summary {
  list-style: none;
}

.toolbar-menu > summary::-webkit-details-marker {
  display: none;
}

.toolbar-menu-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 75;
  min-width: 190px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151a;
  box-shadow: var(--shadow);
}

.toolbar-menu-list .btn {
  justify-content: flex-start;
  width: 100%;
  min-height: 30px;
}

.corner-split-fields {
  display: contents;
}

.corner-split-fields[hidden] {
  display: none;
}

.ribbon-panel[data-panel="format"] .toolbar-group.button-group:not(.layout-menu-group):has([data-align]),
.ribbon-panel[data-panel="format"] .toolbar-group.button-group:not(.layout-menu-group):has(#bringFront) {
  display: none;
}

.icon-btn,
.tool-btn,
.btn {
  border: 1px solid transparent;
  background: transparent;
  min-height: 30px;
  border-radius: 8px;
  cursor: pointer;
}

.icon-btn,
.tool-btn {
  width: 34px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.icon-btn:hover,
.tool-btn:hover,
.btn:hover {
  background: var(--panel-3);
}

.icon-btn:disabled,
.tool-btn:disabled,
.btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.icon-btn:disabled:hover,
.tool-btn:disabled:hover,
.btn:disabled:hover {
  background: transparent;
}

.tool-btn.active {
  outline: 0;
  border-color: rgba(25, 160, 255, 0.55);
  background: rgba(25, 160, 255, 0.16);
  color: #dff2ff;
}

.icon-btn.active,
.btn.active {
  border-color: var(--accent);
  background: #132232;
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  font-weight: 700;
  white-space: nowrap;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #071014;
}

.btn.good {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #071014;
}

.btn.danger {
  border-color: rgba(239, 91, 91, 0.45);
  color: #ffd1d1;
}

.btn.ghost {
  background: transparent;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span,
.field label,
.field-title,
.toggle-field span {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b0f13;
  color: var(--text);
  padding: 7px 9px;
}

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

.field.compact {
  min-width: 64px;
}

.toggle-field {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b0f13;
  padding: 0 9px;
  white-space: nowrap;
}

.toggle-field input {
  margin: 0;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.toolbar,
.ribbon-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
  overflow-x: auto;
}

.ribbon {
  position: relative;
  z-index: 30;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(13, 17, 21, 0.96);
  min-width: 0;
}

.ribbon-tabs {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 10px;
  border-bottom: 0;
  overflow-x: auto;
}

.ribbon-tab {
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.ribbon-tab.active {
  background: #141a20;
  border-color: var(--line-soft);
  color: var(--text);
}

.ribbon-panel {
  min-height: 70px;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  column-gap: 8px;
  row-gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--line-soft);
  background: #0f1419;
  box-shadow: none;
  /* visible so dropdown menus (Alinhamento/Posicao) are not clipped; the panel
     wraps its content instead of scrolling horizontally */
  overflow: visible;
}

.ribbon-panel.active {
  display: flex;
  overflow: visible;
}

.toolbar-group {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  align-content: flex-start;
  gap: 7px;
  min-height: 48px;
  padding-right: 9px;
  border-right: 1px solid var(--line-soft);
}

.toolbar-group:last-child {
  border-right: 0;
}

.toolbar-group.unavailable {
  opacity: 0.38;
}

.toolbar-group.unavailable,
.toolbar-group.unavailable * {
  cursor: not-allowed;
}

.toolbar .field {
  min-width: 86px;
}

.toolbar .field.wide {
  min-width: 160px;
}

.ribbon-panel .field {
  min-width: 74px;
  height: 48px;
  grid-template-rows: 12px 32px;
  gap: 4px;
  align-content: start;
}

.ribbon-panel .field.wide {
  min-width: 138px;
}

.ribbon-panel .field > span,
.ribbon-panel .toggle-field span {
  font-size: 11px;
  line-height: 12px;
}

.ribbon-panel .text-edit {
  min-width: 240px;
}

.ribbon-panel .field input,
.ribbon-panel .field select,
.ribbon-panel .field textarea,
.ribbon-panel .toggle-field,
.ribbon-panel .btn,
.ribbon-panel .icon-btn {
  min-height: 32px;
}

.ribbon-panel .btn,
.ribbon-panel .icon-btn,
.ribbon-panel .toggle-field,
.ribbon-panel .toolbar-group > input[type="color"] {
  align-self: flex-start;
  margin-top: 16px;
}

.ribbon-panel .toolbar-group.icon-group .icon-btn,
.ribbon-panel #italicBtn,
.ribbon-panel #underlineBtn,
.ribbon-panel #strikeBtn,
.ribbon-panel #upperBtn,
.ribbon-panel #rtlBtn {
  margin-top: 8px;
}

.ribbon-panel input[type="color"] {
  width: 34px;
  height: 32px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b0f13;
}

.ribbon-panel[data-panel="styles"] {
  column-gap: 6px;
}

.ribbon-panel[data-panel="styles"] .toolbar-group {
  gap: 5px;
  padding-right: 8px;
}

.ribbon-panel[data-panel="styles"] .field {
  min-width: 58px;
}

.ribbon-panel[data-panel="styles"] .field:has(input[type="color"]) {
  width: 42px;
  min-width: 42px;
}

.ribbon-panel[data-panel="styles"] .field:has(#fillAngle),
.ribbon-panel[data-panel="styles"] .field:has(#strokeAngle),
.ribbon-panel[data-panel="styles"] .field:has(#strokeWidth) {
  width: 58px;
  min-width: 58px;
}

.ribbon-panel[data-panel="styles"] .field:has(#fillMode),
.ribbon-panel[data-panel="styles"] .field:has(#strokeMode) {
  width: 96px;
  min-width: 96px;
}

.ribbon-panel[data-panel="styles"] .field:has(#strokeAlign) {
  width: 84px;
  min-width: 84px;
}

.ribbon-panel[data-panel="styles"] .field input[type="number"] {
  padding-left: 8px;
  padding-right: 4px;
}

.ribbon-panel[data-panel="styles"] .field input[type="color"] {
  width: 30px;
  height: 32px;
  padding: 3px;
}

.ribbon-panel[data-panel="styles"] .toggle-field {
  padding: 0 8px;
}

.ribbon-panel[data-panel="format"],
.ribbon-panel[data-panel="effects"],
.ribbon-panel[data-panel="animations"] {
  column-gap: 6px;
}

.ribbon-panel[data-panel="format"] .toolbar-group,
.ribbon-panel[data-panel="effects"] .toolbar-group,
.ribbon-panel[data-panel="animations"] .toolbar-group {
  gap: 5px;
  padding-right: 8px;
}

.ribbon-panel[data-panel="format"] .field,
.ribbon-panel[data-panel="effects"] .field,
.ribbon-panel[data-panel="animations"] .field {
  min-width: 58px;
}

.ribbon-panel[data-panel="format"] .field:has(#itemX),
.ribbon-panel[data-panel="format"] .field:has(#itemY),
.ribbon-panel[data-panel="format"] .field:has(#itemW),
.ribbon-panel[data-panel="format"] .field:has(#itemH),
.ribbon-panel[data-panel="format"] .field:has(#rotation),
.ribbon-panel[data-panel="format"] .field:has(#cornerRadius),
.ribbon-panel[data-panel="format"] .field:has(#tickerSpeed),
.ribbon-panel[data-panel="effects"] .field:has(input[type="number"]),
.ribbon-panel[data-panel="animations"] .field:has(#transitionDelay),
.ribbon-panel[data-panel="animations"] .field:has(#transitionDuration) {
  width: 58px;
  min-width: 58px;
}

.ribbon-panel[data-panel="format"] .field:has(#imageSizeMode),
.ribbon-panel[data-panel="format"] .field:has(#tickerDirection),
.ribbon-panel[data-panel="format"] .field:has(#tickerType),
.ribbon-panel[data-panel="animations"] .field:has(#transitionDirection) {
  width: 84px;
  min-width: 84px;
}

.ribbon-panel[data-panel="animations"] .field:has(#transitionAxis) {
  width: 72px;
  min-width: 72px;
}

.ribbon-panel[data-panel="animations"] .field:has(#transitionSlot) {
  width: 50px;
  min-width: 50px;
}

.ribbon-panel[data-panel="animations"] .field:has(#storyboard),
.ribbon-panel[data-panel="animations"] .field:has(#transitionEase) {
  width: 118px;
  min-width: 118px;
}

.ribbon-panel[data-panel="animations"] .field:has(#transition) {
  width: 134px;
  min-width: 134px;
}

.ribbon-panel[data-panel="animations"] .animation-preview-group {
  gap: 6px;
  padding-left: 2px;
}

.ribbon-panel[data-panel="animations"] .animation-preview-group .btn {
  min-width: 62px;
}

.ribbon-panel[data-panel="effects"] .field:has(input[type="color"]) {
  width: 42px;
  min-width: 42px;
}

.ribbon-panel[data-panel="effects"] .field:has(#maskTarget) {
  width: 128px;
  min-width: 128px;
}

.ribbon-panel[data-panel="effects"] .field input[type="color"] {
  width: 30px;
  height: 32px;
  padding: 3px;
}

.ribbon-panel[data-panel="format"] .field input[type="number"],
.ribbon-panel[data-panel="effects"] .field input[type="number"],
.ribbon-panel[data-panel="animations"] .field input[type="number"] {
  padding-left: 8px;
  padding-right: 4px;
}

.ribbon-panel .toolbar-group.button-group {
  align-items: center;
  min-height: 48px;
}

.ribbon-panel .toolbar-group.button-group .btn {
  margin-top: 8px;
  padding: 0 9px;
}

.ribbon-panel[data-panel="format"] .btn,
.ribbon-panel[data-panel="animations"] .btn {
  padding-left: 9px;
  padding-right: 9px;
}

.ribbon-panel textarea {
  min-height: 32px;
  height: 32px;
  resize: none;
  overflow: hidden;
}

.editor-shell {
  min-height: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 310px;
}

.editor-page .editor-shell {
  height: 100%;
  overflow: hidden;
}

.tool-rail {
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--line-soft);
  background: #0b0f13;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.editor-main {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.stage-zone {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
  display: block;
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #080b0e;
  background-size: 56px 56px;
}

.stage-zone::-webkit-scrollbar,
.inspector-scroll::-webkit-scrollbar,
.tool-rail::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.stage-zone::-webkit-scrollbar-track,
.inspector-scroll::-webkit-scrollbar-track,
.tool-rail::-webkit-scrollbar-track {
  background: #10151a;
}

.stage-zone::-webkit-scrollbar-thumb,
.inspector-scroll::-webkit-scrollbar-thumb,
.tool-rail::-webkit-scrollbar-thumb {
  border: 2px solid #10151a;
  border-radius: 999px;
  background: #2c3741;
}

.stage-frame {
  width: fit-content;
  min-width: 0;
  margin: 0 auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px;
  background: #0b0f13;
  box-shadow: none;
}

.stage-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  background:
    linear-gradient(45deg, #222831 25%, transparent 25%),
    linear-gradient(-45deg, #222831 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #222831 75%),
    linear-gradient(-45deg, transparent 75%, #222831 75%),
    #141a20;
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  outline: 1px solid rgba(255, 255, 255, 0.12);
}

.selection-box,
.selection-member-box,
.marquee-box {
  fill: none;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
  shape-rendering: crispEdges;
}

.selection-box {
  stroke: #19a0ff;
  stroke-width: 2;
  stroke-dasharray: 7 6;
}

.selection-member-box {
  stroke: rgba(25, 160, 255, 0.55);
  stroke-width: 1.25;
  stroke-dasharray: 4 5;
}

.marquee-box {
  fill: rgba(25, 160, 255, 0.12);
  stroke: #19a0ff;
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
}

.snap-guide-line,
.snap-distance-line {
  pointer-events: none;
  vector-effect: non-scaling-stroke;
  shape-rendering: crispEdges;
}

.snap-guide-line {
  stroke: rgba(33, 192, 122, 0.9);
  stroke-width: 1.4;
  stroke-dasharray: 8 6;
}

.snap-distance-line {
  stroke: rgba(25, 160, 255, 0.78);
  stroke-width: 1.2;
}

.snap-distance-label {
  pointer-events: none;
  fill: #dff2ff;
  paint-order: stroke;
  stroke: rgba(6, 16, 24, 0.95);
  stroke-width: 5;
  font-size: 22px;
  font-weight: 700;
  vector-effect: non-scaling-stroke;
}

.inline-text-editor {
  position: fixed;
  z-index: 120;
  display: block;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  line-height: 1.18;
  resize: none;
  overflow: hidden;
  transform-origin: center center;
  caret-color: var(--text);
}

.inspector {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--line-soft);
  background: #0b0f13;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.statusbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border-top: 1px solid var(--line-soft);
  background: #0d1115;
  overflow-x: auto;
  color: var(--muted);
}

.statusbar > span {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.inspector-section {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.inspector-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-weight: 800;
}

.layers {
  display: grid;
  gap: 6px;
}

.layer-row {
  display: grid;
  grid-template-columns: 26px 26px 42px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.layer-row.active {
  outline: 0;
  border-color: rgba(25, 160, 255, 0.42);
  background: rgba(25, 160, 255, 0.1);
}

.layer-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.layer-row.dragging {
  opacity: 0.42;
}

.layer-row.drag-over,
.layer-row.drop-after {
  border-color: rgba(25, 160, 255, 0.68);
}

.layer-row.drag-over {
  box-shadow: inset 0 2px 0 #19a0ff;
}

.layer-row.drop-after {
  box-shadow: inset 0 -2px 0 #19a0ff;
}

.layer-drag-handle {
  cursor: grab;
  justify-self: end;
}

.layer-drag-handle:active {
  cursor: grabbing;
}

.layer-drag-ghost {
  position: fixed;
  top: -1000px;
  left: -1000px;
  z-index: 9999;
  box-sizing: border-box;
  border-color: rgba(25, 160, 255, 0.55);
  background: #101820;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  opacity: 0.96;
  pointer-events: none;
}

.layer-kind {
  min-width: 0;
  padding: 3px 5px;
  border-radius: 999px;
  background: #141a20;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.layer-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-btn {
  width: 26px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.mini-btn.active {
  color: var(--text);
  background: #1f2a35;
  border-color: var(--accent);
}

.mini-btn:hover {
  color: var(--text);
  background: var(--panel-3);
}

.panel {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0e1216;
  padding: 10px;
}

.inspector .panel {
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  padding: 10px 0 0;
}

.advanced-panel {
  margin-top: 10px;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.advanced-panel > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 8px;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home {
  min-height: 100%;
  display: grid;
  align-content: start;
  gap: 24px;
  padding: 28px;
}

.home-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.home h1,
.home p {
  margin: 0;
}

.home h1 {
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.03;
}

.home p {
  max-width: 680px;
  color: var(--muted);
  font-size: 16px;
}

.route-card {
  min-height: 240px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.route-card:hover {
  border-color: rgba(25, 160, 255, 0.62);
}

.route-card h2 {
  margin: 0;
  font-size: 24px;
}

.route-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.route-preview {
  min-height: 120px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    #0e1317;
  background-size: 28px 28px;
  overflow: hidden;
  position: relative;
}

.route-preview::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 32%;
  bottom: 20px;
  height: 42px;
  border-radius: 6px;
  background: linear-gradient(90deg, #19a0ff, #21c07a);
}

.control-shell {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.side-list {
  border-right: 1px solid var(--line);
  background: var(--panel-2);
  overflow: auto;
  padding: 14px;
}

.project-list {
  display: grid;
  gap: 8px;
}

.project-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1217;
  color: var(--text);
  padding: 12px;
  cursor: pointer;
}

.project-card.active {
  outline: 2px solid var(--accent);
}

.project-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.project-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.control-main {
  min-width: 0;
  overflow: auto;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  width: fit-content;
}

.live-status::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--danger);
}

.live-status.on::before {
  background: var(--accent-2);
}

.preview-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #222831 25%, transparent 25%),
    linear-gradient(-45deg, #222831 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #222831 75%),
    linear-gradient(-45deg, transparent 75%, #222831 75%),
    #141a20;
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  overflow: hidden;
}

.preview-box svg {
  display: block;
  width: 100%;
  height: auto;
}

.control-page {
  background: #080b0e;
  height: 100vh;
  overflow: hidden;
}

.control-workspace {
  min-height: 0;
  height: calc(100vh - 50px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  overflow: hidden;
}

.control-page.library-collapsed .control-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.control-page.library-collapsed .control-library {
  display: none;
}

.control-taskbar {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border-bottom: 1px solid var(--line-soft);
  background: #090d11;
  padding: 8px 12px;
  overflow: visible;
}

.control-taskbar-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.control-work-name {
  min-width: 0;
  max-width: min(360px, 30vw);
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b0f13;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.taskbar-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b1015;
  padding: 4px;
}

.taskbar-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
  padding: 0 4px 0 6px;
}

.taskbar-spacer {
  flex: 1 1 auto;
  min-width: 16px;
}

.control-library {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  border-right: 1px solid var(--line-soft);
  background: #0b0f13;
  overflow: hidden;
  padding: 12px;
}

.library-titlebar {
  align-items: center;
}

.library-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.control-taskbar .library-actions {
  justify-content: flex-start;
}

.library-actions-toggle {
  min-height: 28px;
  padding: 0 10px;
}

.library-actions-toggle.active {
  border-color: rgba(25, 160, 255, 0.55);
  background: rgba(25, 160, 255, 0.14);
  color: var(--text);
}

.library-actions-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  display: grid;
  min-width: 168px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151a;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.library-actions-menu[hidden] {
  display: none;
}

.library-actions-menu button {
  min-height: 34px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
}

.library-actions-menu button:last-child {
  border-bottom: 0;
}

.library-actions-menu button:hover {
  background: #151d24;
  color: #8fd0ff;
}

.library-actions-menu button.danger {
  color: #ffd1d1;
}

.library-actions-menu button.danger:hover {
  background: rgba(239, 91, 91, 0.14);
  color: #ffe4e4;
}

.library-tools {
  display: grid;
  gap: 6px;
  align-self: start;
  min-height: 0;
}

.library-tools input[type="search"] {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #080c10;
  color: var(--text);
  padding: 6px 9px;
}

.library-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.library-filter button {
  min-width: 0;
  height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #10161b;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  cursor: pointer;
}

.library-filter button.active {
  border-color: rgba(25, 160, 255, 0.55);
  background: rgba(25, 160, 255, 0.15);
  color: var(--text);
}

.library-browser {
  min-height: 0;
  display: grid;
  grid-template-columns: 210px minmax(230px, 1fr);
  gap: 8px;
}

.folder-tree {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #080c10;
  padding: 6px;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
}

.folder-row {
  width: 100%;
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 6px 0 calc(6px + var(--depth, 0) * 10px);
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.folder-row.has-children {
  grid-template-columns: 12px 17px minmax(0, 1fr) auto;
}

.folder-row.editable {
  cursor: grab;
}

.folder-row.dragging {
  opacity: 0.5;
}

.folder-row:hover,
.folder-row.drop-target,
.folder-tree.root-drop-target {
  border-color: var(--line-soft);
  background: #10161b;
  color: var(--text);
}

.folder-tree.root-drop-target {
  box-shadow: inset 0 0 0 1px rgba(25, 160, 255, 0.4);
}

.folder-row.active {
  border-color: rgba(25, 160, 255, 0.55);
  background: rgba(25, 160, 255, 0.12);
  color: var(--text);
}

.folder-disclosure {
  display: none;
  width: 12px;
  height: 24px;
  place-items: center;
  color: var(--muted);
}

.folder-row.has-children .folder-disclosure {
  display: grid;
}

.folder-disclosure.visible {
  cursor: pointer;
}

.folder-disclosure.visible::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 120ms ease;
}

.folder-row.collapsed .folder-disclosure.visible::before {
  transform: rotate(-45deg);
}

.folder-disclosure.visible:hover {
  color: var(--text);
}

.folder-icon {
  position: relative;
  width: 15px;
  height: 12px;
  display: block;
  border: 1px solid currentColor;
  border-radius: 3px;
  opacity: 0.8;
}

.folder-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -4px;
  width: 8px;
  height: 4px;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: #080c10;
}

.folder-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
  font-size: 12px;
}

.folder-count {
  min-width: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 1px 4px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.library-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 2px;
  border-radius: 8px;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
}

.library-grid.drop-target {
  box-shadow: inset 0 0 0 2px rgba(25, 160, 255, 0.35);
  background: rgba(25, 160, 255, 0.035);
}

.library-current {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0d1217;
  padding: 7px 9px;
}

.library-current span {
  color: var(--muted);
  font-size: 12px;
}

.library-pathbar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.library-up {
  min-width: 28px;
  width: 28px;
  height: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #10171d;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.library-up:hover:not(:disabled) {
  border-color: rgba(25, 160, 255, 0.5);
  color: var(--text);
}

.library-up:disabled {
  opacity: 0.42;
  cursor: default;
}

.library-breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

.library-breadcrumbs button {
  min-width: 0;
  max-width: 120px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  padding: 0 5px;
}

.library-breadcrumbs button:hover:not(:disabled) {
  background: #141c23;
  color: #8fd0ff;
}

.library-breadcrumbs button:disabled {
  color: var(--muted);
  cursor: default;
}

.library-crumb-sep,
.library-count-label {
  flex: 0 0 auto;
}

.library-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-areas: "thumb meta";
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0f1419;
  padding: 4px 6px 4px 4px;
  cursor: grab;
}

.library-card:hover {
  border-color: rgba(25, 160, 255, 0.36);
  background: #121920;
}

.library-card.selected {
  border-color: rgba(25, 160, 255, 0.72);
  background: rgba(25, 160, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(25, 160, 255, 0.2);
}

.library-card.drop-target {
  border-color: rgba(33, 192, 122, 0.8);
  background: rgba(33, 192, 122, 0.1);
}

.library-thumb {
  grid-area: thumb;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  overflow: hidden;
  background:
    linear-gradient(45deg, #222831 25%, transparent 25%),
    linear-gradient(-45deg, #222831 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #222831 75%),
    linear-gradient(-45deg, transparent 75%, #222831 75%),
    #141a20;
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.library-thumb svg {
  display: block;
  width: 100%;
  height: auto;
}

.library-image-thumb {
  display: grid;
  place-items: center;
  min-height: 31px;
}

.library-image-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.library-folder-thumb {
  min-height: 31px;
  display: grid;
  place-items: center;
  color: #8fd0ff;
  background: linear-gradient(135deg, #101820, #142535);
}

.library-folder-thumb .folder-icon {
  width: 24px;
  height: 18px;
  opacity: 1;
}

.library-card-folder .library-meta span {
  color: #8fd0ff;
  font-weight: 800;
}

.library-card-image .library-meta span {
  color: #9ee6b8;
  font-weight: 800;
}


.library-sheet-thumb {
  min-height: 31px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #172012, #202018);
}

.library-sheet-thumb span {
  color: #ffd66b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: normal;
}

.library-meta {
  grid-area: meta;
  min-width: 0;
}

.library-meta strong,
.library-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-meta strong {
  font-size: 12px;
}

.library-meta span,
.library-meta small {
  color: var(--muted);
  font-size: 11px;
}

.control-hint {
  color: var(--muted);
  font-size: 12px;
}

.library-meta small {
  display: block;
  margin-top: 1px;
  color: #80c7ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.control-operator {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
  padding: 16px;
}

.board-tabs-shell {
  min-width: 0;
  display: flex;
  align-items: end;
  gap: 5px;
  margin-right: 312px;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 4px;
  overflow: hidden;
}

.board-tabs {
  min-width: 0;
  display: flex;
  align-items: end;
  gap: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.board-tabs::-webkit-scrollbar {
  display: none;
}

.board-tab {
  flex: 0 0 auto;
  min-width: 116px;
  max-width: 210px;
  height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  position: relative;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: #0d1217;
  color: var(--muted);
  padding: 0 5px 0 9px;
  transition: border-color 130ms ease, background 130ms ease, color 130ms ease;
}

.board-tab:hover {
  background: #121920;
  color: var(--text);
}

.board-tab.active {
  border-color: var(--line);
  background: #151d24;
  color: var(--text);
}

.board-tab.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}

.board-tab.drag-hover {
  border-color: rgba(33, 192, 122, 0.75);
  background: rgba(33, 192, 122, 0.15);
  color: #b9f6d4;
  box-shadow: inset 0 0 0 1px rgba(33, 192, 122, 0.18);
}

.board-tab-select,
.board-tab-options,
.board-tab-add {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.board-tab-select {
  min-width: 0;
  height: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-size: 12px;
  font-weight: 750;
  padding: 0;
}

.board-tab-count {
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.board-tab-options {
  width: 23px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  font-size: 16px;
}

.board-tab-options:hover,
.board-tab-add:hover {
  background: #1d2730;
  color: #8fd0ff;
}

.board-tab-add {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #10161b;
  color: var(--muted);
  font-size: 19px;
}

.board-tab-menu {
  z-index: 1100;
  min-width: 150px;
}

.board-tab-empty {
  position: absolute;
  inset: 20px 16px auto;
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  pointer-events: none;
}

.operation-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.operation-bar .taskbar-label {
  padding-right: 2px;
}

.operation-select {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.control-taskbar .operation-select {
  display: flex;
  align-items: center;
  gap: 6px;
}

.operation-select span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
}

.control-taskbar .operation-select span {
  padding-left: 4px;
}

.operation-select select {
  min-width: 0;
  width: min(260px, 24vw);
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0b0f13;
  color: var(--text);
  padding: 5px 8px;
}

.production-bar select,
#editorProductionSelect {
  min-width: 0;
  width: min(230px, 22vw);
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0b0f13;
  color: var(--text);
  padding: 5px 8px;
}

.production-actions {
  position: relative;
}

.operation-bar .btn {
  min-height: 30px;
  min-width: 64px;
  padding: 0 10px;
}

.operation-bar .btn.active {
  border-color: rgba(25, 160, 255, 0.5);
  background: rgba(25, 160, 255, 0.14);
  color: var(--text);
}

.preset-actions {
  position: relative;
}

.preset-actions > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
}

.preset-actions > summary.preset-more {
  min-width: 36px;
  width: 36px;
  padding: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.preset-actions > summary::-webkit-details-marker {
  display: none;
}

.preset-actions-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 70;
  display: grid;
  min-width: 184px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151a;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.preset-actions-menu button {
  min-height: 34px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
}

.preset-actions-menu button:last-child {
  border-bottom: 0;
}

.preset-actions-menu button:hover {
  background: #151d24;
  color: #8fd0ff;
}

.preset-actions-menu button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.preset-actions-menu button.danger {
  color: #ffd1d1;
}

.preset-actions-menu button.danger:hover {
  background: rgba(239, 91, 91, 0.14);
  color: #ffe4e4;
}

.control-monitor {
  position: absolute;
  top: 10px;
  right: 16px;
  z-index: 30;
  width: 292px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 18, 23, 0.97);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  padding: 8px;
}

.monitor-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 2px 4px;
  cursor: pointer;
  text-align: left;
}

.monitor-head:hover {
  background: #131a21;
}

.monitor-chevron {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 160ms ease;
  margin-top: -3px;
}

.control-monitor.preview-collapsed .monitor-chevron {
  transform: rotate(-45deg);
  margin-top: 0;
}

.monitor-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-layer-panel {
  min-width: 0;
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.control-layer-panel .section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

.preview-status,
.layer-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: normal;
}

.control-output-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #222831 25%, transparent 25%),
    linear-gradient(-45deg, #222831 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #222831 75%),
    linear-gradient(-45deg, transparent 75%, #222831 75%),
    #141a20;
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  overflow: hidden;
}

.control-monitor.preview-collapsed .control-output-preview {
  display: none;
}

.live-output-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: transparent;
}

.control-layer-list {
  min-width: 0;
  min-height: 0;
  max-height: 200px;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
}

.control-layer-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #10151a;
  color: var(--text);
  padding: 7px 8px;
  text-align: left;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.control-layer-row:active {
  cursor: grabbing;
}

.control-layer-row.on {
  border-color: rgba(33, 192, 122, 0.58);
  background:
    linear-gradient(90deg, rgba(33, 192, 122, 0.12), transparent 64%),
    #10151a;
}

.control-layer-row.off {
  border-color: rgba(239, 91, 91, 0.34);
}

.control-layer-row.dragging {
  opacity: 0.5;
}

.control-layer-row.drop-before {
  box-shadow: 0 -2px 0 var(--accent);
}

.control-layer-row.drop-after {
  box-shadow: 0 2px 0 var(--accent);
}

.control-layer-index {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: #8fd0ff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.control-layer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.control-layer-state {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
}

.data-tool-card {
  position: absolute;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #10151a;
  overflow: visible;
}

.data-tool-card.score {
  border-color: rgba(25, 160, 255, 0.28);
}

.data-tool-card.timer {
  border-color: rgba(33, 192, 122, 0.28);
}

.data-tool-card.list {
  border-color: rgba(242, 183, 75, 0.32);
}

.data-tool-card.text {
  border-color: rgba(0, 210, 210, 0.32);
}

.data-tool-card.dataList {
  border-color: rgba(181, 119, 255, 0.34);
}

.data-tool-card.steps {
  border-color: rgba(255, 193, 69, 0.38);
}

.data-tool-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 6px 6px 5px 8px;
  border-bottom: 1px solid var(--line-soft);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.data-tool-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.data-tool-body {
  display: grid;
  gap: 6px;
  padding: 6px;
}

.data-tool-row,
.data-tool-timer {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 5px;
}

.data-tool-row {
  grid-template-columns: minmax(54px, 1fr) 24px minmax(28px, auto) 24px;
}

.data-tool-timer {
  grid-template-columns: minmax(54px, 1fr) 28px 28px 28px;
}

.data-tool-steps {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.data-tool-step-meter {
  min-width: 0;
  height: 7px;
  display: flex;
  gap: 3px;
  overflow: hidden;
}

.data-tool-step-meter span {
  min-width: 3px;
  flex: 1 1 0;
  border-radius: 2px;
  background: #252d35;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.data-tool-step-meter span.active {
  background: #f2b74b;
  box-shadow: 0 0 8px rgba(242, 183, 75, 0.3);
}

.data-tool-step-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(54px, 1fr) 30px 30px;
  align-items: center;
  gap: 5px;
}

.data-tool-step-value {
  min-width: 0;
  text-align: center;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.data-tool-list select,
.data-tool-data-list select,
.data-tool-text input {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #0b0f13;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
}

.data-tool-label,
.data-tool-row small,
.data-tool-timer small {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-tool-value,
.data-tool-timer-value {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.data-tool-card button:not(.gc-menu-btn) {
  min-width: 0;
  min-height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #151b21;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
  cursor: pointer;
}

.timer-icon {
  display: block;
  width: 12px;
  height: 12px;
  position: relative;
}

.timer-icon-play {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
  margin-left: 2px;
}

.timer-icon-pause::before,
.timer-icon-pause::after {
  content: "";
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 3px;
  border-radius: 1px;
  background: currentColor;
}

.timer-icon-pause::before {
  left: 2px;
}

.timer-icon-pause::after {
  right: 2px;
}

.timer-icon-stop {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
}

.data-tool-card button:not(.gc-menu-btn):hover:not(:disabled) {
  border-color: var(--accent);
  background: #1b232b;
}

.data-tool-card button:disabled {
  opacity: 0.4;
  cursor: default;
}

.data-tool-card.menu-open .gc-menu {
  display: grid;
}

.control-context-menu {
  position: fixed;
  z-index: 1000;
  display: grid;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151a;
  color: var(--text);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.46);
  overflow: hidden;
}

.control-context-menu[hidden] {
  display: none;
}

.control-context-menu button {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.control-context-menu button:hover {
  background: #151d24;
  color: #8fd0ff;
}

.control-context-menu button.danger {
  color: #ffd1d1;
}

.control-context-menu button.danger:hover {
  background: rgba(239, 91, 91, 0.14);
  color: #ffe4e4;
}

.revo-native-dialog {
  width: min(560px, calc(100vw - 44px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.revo-native-dialog::backdrop {
  background: rgba(0, 0, 0, 0.64);
}

.transfer-progress-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 0;
  overflow: hidden;
}

.transfer-progress-shell {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 24px;
}

.transfer-progress-shell h2 {
  margin: 0 0 5px;
  font-size: 18px;
}

.transfer-progress-shell p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.transfer-progress-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: transfer-progress-spin .75s linear infinite;
}

@keyframes transfer-progress-spin {
  to { transform: rotate(360deg); }
}

.revo-native-shell {
  display: grid;
  grid-template-rows: auto minmax(0, auto) auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d1217;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.revo-native-shell header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 16px;
}

.revo-native-shell h2,
.revo-native-shell p {
  margin: 0;
}

.revo-native-shell h2 {
  font-size: 18px;
}

.revo-native-shell p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.revo-native-body {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.revo-native-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  background: #11161b;
  padding: 12px 16px;
}

.revo-native-actions .btn {
  min-width: 92px;
}

.project-setup-dialog {
  width: min(620px, calc(100vw - 44px));
}

.control-deck {
  --board-grid-size: 16px;
  --board-grid-origin: 12px;
  position: relative;
  min-height: 0;
  display: block;
  margin-right: 312px;
  border-radius: 10px;
  overflow: auto;
  padding: 0;
  transition: background 160ms ease, box-shadow 160ms ease;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
}

.control-deck::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: max(100%, var(--deck-content-width, 100%));
  height: var(--deck-content-height, 220px);
  z-index: 0;
  background-image: radial-gradient(
    circle at var(--board-grid-origin) var(--board-grid-origin),
    rgba(133, 156, 174, 0.34) 1px,
    transparent 1.25px
  );
  background-size: var(--board-grid-size) var(--board-grid-size);
  pointer-events: none;
}

.control-deck .board-card,
.control-deck .deck-empty {
  z-index: 1;
}

.control-deck.deck-drop-target {
  background: rgba(25, 160, 255, 0.06);
  box-shadow: inset 0 0 0 2px rgba(25, 160, 255, 0.45);
}

.control-page.board-locked .control-deck {
  box-shadow: inset 0 0 0 1px rgba(25, 160, 255, 0.18);
}

.control-page.board-locked .gc-head,
.control-page.board-locked .data-tool-head,
.control-page.board-locked .control-layer-row {
  cursor: default;
}

.control-page.board-locked .card-resize {
  display: none;
}

.control-page.operator-mode .topbar,
.control-page.operator-mode .control-taskbar,
.control-page.operator-mode .control-library,
.control-page.operator-mode .control-monitor,
.control-page.operator-mode .control-context-menu,
.control-page.operator-mode .library-context-menu,
.control-page.operator-mode .gc-menu,
.control-page.operator-mode .gc-menu-btn {
  display: none !important;
}

.control-page.operator-mode .control-workspace {
  height: 100vh;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.control-page.operator-mode .control-operator {
  grid-column: 1 / -1;
  padding: 18px;
}

.control-page.operator-mode .control-deck {
  margin-right: 0;
  border: 1px solid var(--line-soft);
  background: #080c10;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

.control-page.operator-mode .board-tabs-shell {
  margin-right: 0;
}

.control-page.operator-mode.board-locked .gc-head,
.control-page.operator-mode.board-locked .data-tool-head,
.control-page.operator-mode.board-locked .control-layer-row {
  cursor: default;
}

.operator-layout-lock {
  display: none;
}

.control-page.operator-mode .operator-layout-lock {
  display: none !important;
}

.control-page.operator-mode .operator-layout-lock:hover,
.control-page.operator-mode .operator-layout-lock:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.operator-lock-symbol {
  width: 12px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 2px;
  position: relative;
}

.operator-lock-symbol::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -8px;
  width: 6px;
  height: 7px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.operator-layout-lock:not(.active) .operator-lock-symbol::before {
  left: 5px;
  transform: rotate(28deg);
  transform-origin: bottom left;
}

.control-page.operator-mode .board-card {
  user-select: none;
}

.board-card.dragging,
.gc-card.dragging {
  opacity: 0.55;
  z-index: 10;
  cursor: grabbing;
}

.board-card.menu-open {
  z-index: 35;
}

.board-card.menu-open .card-resize {
  pointer-events: none;
}

.board-card.drop-before {
  box-shadow: -3px 0 0 var(--accent), inset 0 0 0 1px rgba(25, 160, 255, 0.28);
}

.board-card.drop-after {
  box-shadow: 3px 0 0 var(--accent), inset 0 0 0 1px rgba(25, 160, 255, 0.28);
}

.library-card {
  cursor: grab;
}

.library-card:active {
  cursor: grabbing;
}

.gc-card {
  position: absolute;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(239, 91, 91, 0.38);
  border-radius: 8px;
  background: #0f1419;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: visible;
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.gc-card::before,
.gc-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.gc-card::before {
  background:
    linear-gradient(180deg, rgba(239, 91, 91, 0.16), transparent 62%),
    linear-gradient(145deg, rgba(239, 91, 91, 0.08), transparent 48%);
  opacity: 1;
}

.gc-card::after {
  background:
    linear-gradient(180deg, rgba(33, 192, 122, 0.16), transparent 62%),
    linear-gradient(145deg, rgba(33, 192, 122, 0.08), transparent 48%);
  opacity: 0;
}

.gc-card.on {
  border-color: rgba(33, 192, 122, 0.78);
  box-shadow: 0 0 0 1px rgba(33, 192, 122, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.gc-card.on::before {
  opacity: 0;
}

.gc-card.on::after {
  opacity: 1;
}

.gc-card:hover {
  border-color: rgba(25, 160, 255, 0.46);
}

.gc-toggle {
  align-self: center;
  justify-self: center;
  min-width: 0;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  margin: 0;
  border: 2px solid rgba(239, 91, 91, 0.5);
  border-radius: 14px;
  background: rgba(239, 91, 91, 0.12);
  color: #ffd1d1;
  cursor: pointer;
  transition: border-color 220ms ease, background 220ms ease, color 220ms ease;
}

.gc-toggle:focus-visible,
.gc-menu-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gc-card.on .gc-toggle {
  border-color: rgba(33, 192, 122, 0.85);
  background: #21c07a;
  color: #06110c;
}

.gc-state {
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.gc-card.on .gc-state::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 999px;
  background: currentColor;
}

.gc-menu-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  position: relative;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(8, 11, 14, 0.35);
  color: var(--muted);
  font-size: 0;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
}

.gc-menu-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.gc-menu-btn:hover,
.gc-card.menu-open .gc-menu-btn {
  border-color: var(--line-soft);
  background: #151b21;
  color: var(--text);
}

.gc-menu {
  position: absolute;
  top: 42px;
  right: 8px;
  z-index: 45;
  display: none;
  min-width: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151a;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.gc-card.menu-open .gc-menu {
  display: grid;
}

.gc-menu button {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 9px 10px;
  cursor: pointer;
}

.gc-menu button:hover {
  background: #151d24;
}

.deck-empty {
  grid-column: 1 / -1;
}

.gc-card.placar {
  grid-column: span 2;
  width: auto;
  min-width: 0;
  min-height: 134px;
}

.gc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 5px 4px 10px;
  border-bottom: 1px solid var(--line-soft);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.card-resize {
  position: absolute;
  z-index: 6;
  touch-action: none;
}

.card-resize-e {
  top: 7px;
  bottom: 9px;
  right: 0;
  width: 7px;
  cursor: ew-resize;
}

.card-resize-w {
  top: 7px;
  bottom: 9px;
  left: 0;
  width: 7px;
  cursor: ew-resize;
}

.card-resize-s {
  left: 9px;
  right: 9px;
  bottom: 0;
  height: 7px;
  cursor: ns-resize;
}

.card-resize-se {
  right: 0;
  bottom: 0;
  width: 13px;
  height: 13px;
  cursor: nwse-resize;
}

.card-resize-sw {
  left: 0;
  bottom: 0;
  width: 13px;
  height: 13px;
  cursor: nesw-resize;
}

.card-resize-se::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 8px;
  height: 8px;
  background:
    linear-gradient(135deg, transparent 0 55%, rgba(143, 208, 255, 0.55) 56% 66%, transparent 67%);
  pointer-events: none;
}

.gc-head-title {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
}

.gc-card:not(.placar) .gc-body {
  justify-content: center;
}

.gc-card.placar .gc-toggle {
  flex: 0 0 36%;
  min-width: 96px;
  max-width: 128px;
}

.gc-tools {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-content: center;
  gap: 5px;
  padding: 6px;
  border-left: 1px solid var(--line-soft);
  position: relative;
  z-index: 1;
}

.gc-tool-wide {
  grid-column: 1 / -1;
}

.gc-tools-hint {
  font-size: 10px;
  color: var(--muted);
  padding: 4px;
}

.gc-tool-row {
  display: grid;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #10151a;
  padding: 5px;
}

.gc-tool-label {
  min-width: 0;
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
  text-transform: none;
  letter-spacing: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-tool-control {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(18px, 1fr) 22px;
  align-items: center;
  gap: 4px;
}

.gc-tool-value,
.gc-timer-value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}

.gc-timer-row .gc-tool-label {
  font-size: 9px;
}

.gc-timer-row .gc-timer-value {
  text-align: left;
}

.gc-timer-row .gc-tool-control {
  grid-template-columns: minmax(54px, 1fr) 22px 22px 22px;
}

.gc-tool-row button {
  width: 22px;
  height: 22px;
  min-width: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #151b21;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.gc-tool-row button:hover:not(:disabled) {
  background: #1b232b;
  border-color: var(--accent);
}

.gc-tool-row button:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 640px) {
  .gc-card.placar {
    grid-column: 1 / -1;
  }
}

.conn-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: normal;
  border: 1px solid transparent;
  white-space: nowrap;
}

.conn-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.conn-status.conn-ok {
  color: #21c07a;
  border-color: rgba(33, 192, 122, 0.5);
  background: rgba(33, 192, 122, 0.12);
}

.conn-status.conn-warn {
  color: #f2c94c;
  border-color: rgba(242, 201, 76, 0.5);
  background: rgba(242, 201, 76, 0.12);
}

.conn-status.conn-bad {
  color: #ef5b5b;
  border-color: rgba(239, 91, 91, 0.5);
  background: rgba(239, 91, 91, 0.14);
}

.tools-role-row select {
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #080c10;
  color: var(--text);
  padding: 5px 8px;
}

.tools-hint {
  font-size: 11px;
  color: var(--muted);
  padding: 6px 2px;
}

.control-modal {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1217;
  color: var(--text);
  padding: 0;
}

.control-modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.tool-modal {
  width: min(620px, calc(100vw - 32px));
}

.board-tab-link-dialog {
  width: min(620px, calc(100vw - 32px));
}

.board-tab-link-dialog .modal-shell {
  min-height: 0;
  max-height: calc(100vh - 48px);
}

.board-tab-link-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.board-tab-link-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.tool-modal .modal-shell {
  min-height: 0;
  max-height: calc(100vh - 48px);
}

.tool-modal .modal-head,
.tool-modal .modal-actions {
  padding: 10px 12px;
}

.modal-shell {
  min-height: min(720px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.modal-head,
.modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-actions {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  border-top: 1px solid var(--line-soft);
  border-bottom: 0;
}

.modal-kicker {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
}

.modal-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.modal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}

.tool-modal-body {
  min-height: 0;
  max-height: min(560px, calc(100vh - 178px));
  overflow: auto;
  padding: 10px 12px;
}

.modal-fields,
.modal-preview {
  min-height: 0;
  overflow: auto;
}

.tool-settings {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.tool-steps-editor {
  display: grid;
  gap: 10px;
}

.tool-step-config {
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: end;
}

.tool-step-config-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.tool-step-config-copy strong,
.tool-step-head strong {
  color: var(--text);
  font-size: 12px;
}

.tool-step-config-copy span,
.tool-step-head span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.tool-step-head {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.tool-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tool-config-grid .field:nth-child(3) {
  grid-column: 1 / -1;
}

.tool-binding-section {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0f1419;
  padding: 8px;
}

.tool-binding-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.tool-destination-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
}

.tool-list-items {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
}

.simple-list-editor {
  display: grid;
  gap: 6px;
}

.simple-list-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.simple-list-actions .tool-destination-add {
  width: auto;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.simple-list-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.simple-list-editor textarea {
  width: 100%;
  min-height: 170px;
  max-height: 320px;
  resize: vertical;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #080c10;
  color: var(--text);
  line-height: 1.35;
  padding: 8px;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
}

.child-simple-list-editor textarea {
  min-height: 130px;
}

.tool-data-fields,
.tool-data-items {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
}

.tool-destination-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px;
  align-items: end;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #0b0f13;
  padding: 6px;
}

.tool-data-field-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px;
  align-items: end;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #0b0f13;
  padding: 6px;
}

.tool-list-binding-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: end;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #0b0f13;
  padding: 6px;
}

.tool-data-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #0b0f13;
  padding: 6px;
}

.tool-data-item-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.tool-data-item-row button {
  min-height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #151b21;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
  cursor: pointer;
}

.tool-list-item-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: end;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #0b0f13;
  padding: 6px;
}

.tool-destination-row .field,
.tool-data-field-row .field,
.tool-list-binding-row .field,
.tool-list-item-row .field {
  min-width: 0;
  gap: 4px;
}

.tool-destination-row .field span,
.tool-data-field-row .field span,
.tool-list-binding-row .field span,
.tool-list-item-row .field span {
  font-size: 10px;
  font-weight: 800;
  text-transform: none;
}

.tool-destination-row select,
.tool-data-field-row select,
.tool-data-field-row input,
.tool-list-binding-row select,
.tool-list-item-row input {
  min-height: 30px;
  border-radius: 6px;
  padding: 5px 8px;
}

.data-item-dialog {
  width: min(680px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.data-item-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.save-location-dialog {
  width: min(440px, calc(100vw - 40px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.save-location-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.save-location-shell {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d1217;
  box-shadow: var(--shadow);
  padding: 12px;
}

.save-location-shell header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 16px;
}

.save-location-shell h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.revo-explorer-dialog {
  width: min(1060px, calc(100vw - 44px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.work-open-dialog {
  width: min(460px, calc(100vw - 40px));
}

.work-open-shell {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1015;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.work-open-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.work-open-body .field {
  display: grid;
  gap: 6px;
}

.work-open-body .field span {
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
}

.work-open-body select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151a;
  color: var(--text);
  padding: 8px 10px;
}

.work-open-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.work-open-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  background: #0d1217;
  padding: 12px;
}

.revo-explorer-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.revo-explorer-shell {
  height: min(760px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1015;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.revo-explorer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
  padding: 12px;
}

.revo-explorer-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.revo-explorer-commandbar {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) minmax(180px, 280px);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  background: #0d1217;
  padding: 9px 12px;
}

.revo-explorer-address {
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #080d11;
  padding: 0 10px;
}

.revo-explorer-address span {
  color: var(--muted);
}

.revo-explorer-address strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.revo-explorer-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
}

.revo-explorer-side {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  border-right: 1px solid var(--line-soft);
  background: #0a0f13;
  padding: 10px;
  overflow: auto;
}

.revo-explorer-side-head {
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
  padding: 2px 2px 4px;
}

.revo-explorer-side-action {
  justify-content: center;
  width: 100%;
  min-height: 32px;
  margin-bottom: 4px;
}

.revo-explorer-main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  overflow: hidden;
}

.revo-explorer-toolbar,
.revo-explorer-quickbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  flex-wrap: wrap;
}

.revo-explorer-quickbar .btn {
  min-height: 28px;
}

.revo-explorer-quickbar .btn:disabled {
  opacity: 0.38;
}

.revo-explorer-quick-separator {
  width: 1px;
  height: 22px;
  background: var(--line-soft);
}

.revo-explorer-search {
  flex: 1 1 auto;
  min-height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #080d11;
  color: var(--text);
  padding: 0 10px;
}

.revo-explorer-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
}

.revo-explorer-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-content: start;
  gap: 12px;
  padding: 2px;
  overflow-x: hidden;
}

.revo-explorer-row {
  min-width: 0;
  min-height: 38px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #10161c;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  padding: 6px 8px;
}

.revo-explorer-grid .revo-explorer-row {
  min-height: 116px;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  justify-items: center;
  align-content: center;
  text-align: center;
  gap: 6px;
  padding: 10px 8px;
}

/* GC preview tile: 16:9, whole GC visible over a Revo-themed checker */
.revo-explorer-grid .revo-explorer-row.kind-project .revo-explorer-icon {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(45deg, #222831 25%, transparent 25%),
    linear-gradient(-45deg, #222831 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #222831 75%),
    linear-gradient(-45deg, transparent 75%, #222831 75%),
    #141a20;
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.revo-explorer-grid .revo-explorer-row span {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 2px;
  white-space: normal;
}

.revo-explorer-grid .revo-explorer-row strong,
.revo-explorer-grid .revo-explorer-row small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.revo-explorer-grid .revo-explorer-row > small {
  width: 100%;
}

.revo-explorer-row:hover,
.revo-explorer-row.active {
  border-color: rgba(25, 160, 255, 0.55);
  background: rgba(25, 160, 255, 0.12);
}

.revo-explorer-row.active {
  box-shadow: inset 0 0 0 1px rgba(25, 160, 255, 0.2);
}

.revo-explorer-row strong,
.revo-explorer-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.revo-explorer-row span {
  display: grid;
  gap: 2px;
}

.revo-explorer-row strong {
  font-size: 12px;
}

.revo-explorer-row small {
  color: var(--muted);
  font-size: 11px;
}

.revo-explorer-icon {
  width: 22px;
  text-align: center;
  color: #8fd0ff;
  font-size: 14px;
}

.revo-explorer-row.kind-folder .revo-explorer-icon {
  position: relative;
  width: 28px;
  height: 22px;
}

.revo-explorer-row.kind-folder .revo-explorer-icon::before,
.revo-explorer-row.kind-folder .revo-explorer-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffd76a, #d99b25);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

.revo-explorer-row.kind-folder .revo-explorer-icon::before {
  top: 2px;
  width: 12px;
  height: 6px;
}

.revo-explorer-row.kind-folder .revo-explorer-icon::after {
  top: 7px;
  width: 24px;
  height: 14px;
}

.revo-explorer-grid .revo-explorer-icon {
  width: 54px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #111922;
  font-size: 18px;
}

.revo-explorer-grid .revo-explorer-row.kind-folder .revo-explorer-icon {
  width: 70px;
  height: 44px;
  background: transparent;
}

.revo-explorer-grid .revo-explorer-row.kind-folder .revo-explorer-icon::before {
  left: 8px;
  top: 6px;
  width: 26px;
  height: 11px;
}

.revo-explorer-grid .revo-explorer-row.kind-folder .revo-explorer-icon::after {
  left: 8px;
  top: 15px;
  width: 54px;
  height: 26px;
}

.revo-explorer-icon.project-preview {
  overflow: hidden;
}

.revo-explorer-icon.project-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.revo-explorer-actions {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(220px, 1fr) 190px auto auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  background: #11161b;
  padding: 10px 12px;
}

.revo-explorer-storage {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.revo-explorer-storage > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.revo-explorer-storage span,
.revo-explorer-storage strong {
  min-width: 0;
  font-size: 11px;
  font-weight: 800;
}

.revo-explorer-storage span { color: var(--muted); }
.revo-explorer-storage strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.revo-explorer-storage-bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--panel-3);
  overflow: hidden;
}

.revo-explorer-storage-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.revo-explorer-name {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.revo-explorer-name input,
.revo-explorer-type {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #080d11;
  color: var(--text);
  padding: 0 10px;
}

.revo-explorer-name input {
  min-width: 0;
}

.save-location-dialog .save-location-shell {
  height: min(760px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 0;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
}

.save-location-dialog .save-location-shell > .field {
  margin: 0 12px 10px;
}

.save-location-dialog .save-location-shell > .field input {
  min-height: 34px;
}

.save-location-dialog .save-folder-field {
  display: none;
}

.save-browser-body {
  min-height: 0;
}

.save-location-dialog .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  background: #11161b;
  padding: 10px 12px;
}

.data-item-shell {
  width: 100%;
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d1217;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.data-item-shell .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: #10151a;
}
.data-item-shell .modal-actions .btn:not(.good):not(.primary) {
  border-color: var(--line-soft);
  background: #151b21;
  color: var(--text);
}
.data-item-shell .modal-actions .btn:not(.good):not(.primary):hover {
  border-color: rgba(25, 160, 255, 0.48);
  background: #1b232b;
}
.data-item-shell .modal-actions .btn.good {
  padding-inline: 18px;
}

.data-item-fields {
  min-height: 0;
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  overflow: auto;
}

.data-value-field {
  gap: 4px;
}

.data-value-field > span {
  font-size: 11px;
}

.data-input-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.data-input-row input,
.data-input-row .image-path-field {
  min-width: 0;
}

.data-image-path-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.data-color-field {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 6px;
}

.data-color-field input[type="color"] {
  min-height: 30px;
  padding: 2px;
}








.data-image-picker {
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: stretch;
  margin-top: 4px;
}

.data-image-current {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0a0f14;
  padding: 5px;
}

.data-image-current span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-image-current strong {
  min-height: 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #080c10;
  color: var(--muted);
  font-size: 11px;
}

.data-image-current img {
  width: 100%;
  height: 36px;
  object-fit: contain;
}

.child-list-block {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b0f13;
  padding: 8px;
}

.child-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.child-list-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-list-head span {
  flex: 0 0 auto;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #101820;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  text-transform: none;
}

.child-list-rows,
.child-data-rows {
  display: grid;
  gap: 6px;
}

.child-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: center;
}

.child-list-row input {
  min-height: 30px;
  border-radius: 6px;
  padding: 5px 8px;
}

.child-data-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #10151a;
  padding: 5px;
}

.child-data-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-data-row button {
  min-height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #151b21;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
  cursor: pointer;
}

.data-image-picker .image-picker-upload {
  min-height: 48px;
}

.data-image-picker .image-picker-grid,
.data-image-picker .compact-empty {
  grid-column: 1 / -1;
}

.data-image-picker .image-picker-item {
  flex-basis: 58px;
}

.data-image-picker .image-picker-select span {
  padding: 3px;
  font-size: 9px;
}

.image-path-field {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 54px;
  align-items: center;
  gap: 6px;
}

.image-path-field input {
  min-width: 0;
  min-height: 32px;
  border-radius: 6px;
  padding: 6px 8px;
}

.image-path-field button {
  min-height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #151b21;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
}

.image-path-field button:hover {
  border-color: var(--accent);
  background: #1b232b;
}

.image-path-preview {
  min-width: 0;
  height: 32px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #080c10;
  color: var(--muted);
  font-size: 9px;
}

.image-path-preview.invalid {
  border-color: rgba(255, 91, 91, 0.75);
}

.image-path-preview img {
  width: 100%;
  height: 32px;
  object-fit: contain;
}

.image-path-row {
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.5fr);
}

.data-value-image .image-path-field {
  grid-template-columns: minmax(0, 1fr) auto 58px;
}







.spreadsheet-file:hover,






























.image-browser-dialog {
  width: min(860px, calc(100vw - 54px));
  max-height: calc(100vh - 54px);
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.image-browser-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.image-browser-shell {
  width: 100%;
  max-height: calc(100vh - 54px);
  display: grid;
  grid-template-rows: auto auto minmax(280px, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d1217;
  box-shadow: var(--shadow);
}

.image-browser-bar {
  display: grid;
  grid-template-columns: 32px 32px minmax(0, 1fr) minmax(160px, 220px);
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--line-soft);
  padding: 8px;
}

.image-browser-bar button,
.image-browser-footer button {
  min-height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #151b21;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.image-browser-bar button:hover,
.image-browser-footer button:hover {
  border-color: var(--accent);
  background: #1b232b;
}

.image-browser-path {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #090d11;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-browser-search input {
  width: 100%;
  min-height: 32px;
  border-radius: 6px;
  padding: 6px 8px;
}

.image-browser-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.image-browser-tree {
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--line-soft);
  background: #080c10;
  padding: 8px;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
}

.image-browser-folder {
  width: 100%;
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 6px 0 calc(6px + var(--depth, 0) * 10px);
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.image-browser-folder.has-children {
  grid-template-columns: 12px 17px minmax(0, 1fr) auto;
}

.image-browser-folder:hover,
.image-browser-folder.active {
  border-color: rgba(25, 160, 255, 0.55);
  background: rgba(25, 160, 255, 0.12);
  color: var(--text);
}

.image-browser-disclosure {
  display: none;
  width: 12px;
  height: 24px;
  place-items: center;
  color: var(--muted);
}

.image-browser-folder.has-children .image-browser-disclosure {
  display: grid;
}

.image-browser-disclosure.visible::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.image-browser-folder.collapsed .image-browser-disclosure.visible::before {
  transform: rotate(-45deg);
}

.image-browser-content {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  align-content: start;
  gap: 10px;
  padding: 12px;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
}

.image-browser-item {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #10151a;
  color: var(--text);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.image-browser-item.selected,
.image-browser-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 170, 255, 0.28);
}

.image-browser-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #080c10;
}

.image-browser-item span {
  display: block;
  overflow: hidden;
  padding: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-browser-empty {
  grid-column: 1 / -1;
}

.image-browser-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding: 9px;
}

.image-browser-upload {
  min-height: 32px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
}

.image-browser-upload input {
  display: none;
}

.image-browser-name {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.image-browser-name span {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.image-browser-name input {
  min-height: 32px;
  border-radius: 6px;
  padding: 6px 8px;
}

.tool-destination-remove,
.tool-destination-add {
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #151b21;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.tool-destination-remove:hover,
.tool-destination-add:hover {
  border-color: var(--accent);
  background: #1b232b;
}

.tool-destination-remove:disabled,
.tool-destination-add:disabled {
  opacity: 0.45;
  cursor: default;
}

.tool-destination-add {
  width: 100%;
}

.edit-fields {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.edit-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b0f13;
}

.edit-tabs button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.edit-tabs button.active {
  background: #17212a;
  color: var(--text);
}

.edit-data-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(96px, 0.62fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0f1419;
  padding: 6px;
}

.edit-data-row > span:first-child {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-data-row textarea,
.edit-data-row input[type="text"] {
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #080c10;
  color: var(--text);
  padding: 5px 8px;
}

.text-row textarea {
  height: 34px;
  min-height: 34px;
  resize: vertical;
}

.color-row {
  grid-template-columns: minmax(96px, 0.62fr) 40px minmax(0, 1fr);
}

.color-row input[type="color"] {
  width: 40px;
  min-width: 40px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #080c10;
  padding: 2px;
}

.hex-input {
  font-family: "Segoe UI", system-ui, sans-serif;
  text-transform: none;
}

.image-edit-block {
  display: grid;
  gap: 6px;
}

.image-row {
  width: 100%;
  grid-template-columns: minmax(96px, 0.62fr) minmax(0, 1fr);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.image-thumb {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #080c10;
  color: var(--muted);
  overflow: hidden;
}

.image-thumb img {
  width: 100%;
  height: 54px;
  object-fit: contain;
}

.image-picker {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b0f13;
  padding: 5px;
}

.image-picker-upload {
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.image-picker-upload input {
  display: none;
}

.image-picker-grid {
  display: flex;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
}

.image-picker-item {
  position: relative;
  flex: 0 0 64px;
  min-width: 0;
}

.image-picker-select {
  display: block;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #10151a;
  color: var(--muted);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.image-picker-select.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 170, 255, 0.35);
}

.image-picker-select img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #080c10;
}

.image-picker-select span {
  display: block;
  padding: 3px 4px;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-picker-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: rgba(10, 13, 17, 0.85);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.image-picker-delete:hover {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

.edit-block {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0f1419;
  padding: 8px;
}

.edit-block-title {
  margin-bottom: 6px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.edit-block-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.edit-block-grid .field.wide {
  grid-column: 1 / -1;
}

.edit-block-grid textarea {
  min-height: 54px;
  resize: vertical;
}

.modal-fields .field {
  gap: 4px;
}

.modal-fields .field > span {
  font-size: 11px;
}

.modal-fields .field input,
.modal-fields .field select,
.modal-fields .field textarea {
  min-height: 28px;
  border-radius: 6px;
  padding: 5px 8px;
}

.modal-fields input[type="color"] {
  width: 46px;
  min-width: 46px;
  height: 28px;
  padding: 3px;
}

.modal-fields .color-row input[type="color"] {
  width: 40px;
  min-width: 40px;
  height: 34px;
}

.edit-transform {
  margin-top: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0f1419;
  padding: 8px;
}

.edit-transform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.edit-transform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.btn.mini {
  min-height: 24px;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 11px;
}

.modal-preview .preview-box {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.modal-preview .preview-box:active {
  cursor: grabbing;
}

.preview-viewport {
  width: 100%;
  height: 100%;
  overflow: auto;
  border-radius: 7px;
  overscroll-behavior: contain;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
}

.preview-viewport::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.preview-viewport::-webkit-scrollbar-track {
  background: #10151a;
}

.preview-viewport::-webkit-scrollbar-thumb {
  border: 2px solid #10151a;
  border-radius: 999px;
  background: #2c3741;
}

.preview-zoom-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.preview-zoom-btn,
.preview-zoom-reset,
.preview-zoom-value {
  height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #0b1015;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.preview-zoom-btn {
  width: 32px;
  padding: 0;
}

.preview-zoom-reset {
  padding: 0 10px;
}

.preview-zoom-value {
  min-width: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.preview-zoom-btn:hover:not(:disabled),
.preview-zoom-reset:hover:not(:disabled) {
  border-color: rgba(25, 160, 255, 0.45);
  background: #111923;
}

.preview-zoom-btn:disabled,
.preview-zoom-reset:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

#editPreview,
#editPreview * {
  user-select: none;
  -webkit-user-select: none;
}

.preview-transform-box {
  fill: rgba(25, 160, 255, 0.06);
  stroke: #19a0ff;
  stroke-width: 3;
  stroke-dasharray: 16 10;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
}

.preview-screen-boundary {
  fill: none;
  stroke: rgba(25, 160, 255, 0.2);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.preview-corner-guide {
  fill: none;
  stroke: rgba(25, 160, 255, 0.34);
  stroke-width: 3;
  stroke-linecap: square;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.preview-scale-handle {
  fill: #19a0ff;
  stroke: #061018;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
  cursor: nwse-resize;
}

.preview-scale-handle[data-handle="tr"],
.preview-scale-handle[data-handle="bl"] {
  cursor: nesw-resize;
}

.image-library {
  margin-top: 12px;
}

.image-library-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.image-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
}

.image-asset {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0f1419;
  overflow: hidden;
}

.image-asset img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #080b0e;
}

.image-asset span {
  display: block;
  padding: 5px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-empty {
  padding: 10px;
  font-size: 12px;
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11171d;
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast[data-tone="bad"] {
  border-color: rgba(239, 91, 91, 0.7);
}

.output-page {
  margin: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: transparent;
}

.output-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: block;
  opacity: 0;
  transition: opacity 260ms ease;
}

.output-stage.on {
  opacity: 1;
}

/* Embedded broadcast browsers can suspend short CSS transitions while their
   camera preview is busy. Output animation is controlled by JavaScript, so
   keeping the stage itself immediate avoids a partially faded final frame. */
.embedded-output .output-stage {
  transition: none;
}

.output-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .profile-action-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .profile-overview {
    grid-template-columns: 1fr 1fr;
  }

  .profile-today-panel,
  .profile-storage-panel,
  .profile-links-panel,
  .profile-account-panel,
  .profile-work-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .profile-work-panel {
    grid-column: 1 / -1;
  }

  .editor-shell {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .inspector {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-template-rows: auto;
  }

  .inspector-scroll {
    max-height: 420px;
  }

  .panel-grid,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .control-shell {
    grid-template-columns: 1fr;
  }

  .control-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(260px, 36vh) minmax(0, 1fr);
  }

  .control-taskbar {
    flex-wrap: wrap;
    align-content: start;
  }

  .control-library {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    max-height: 360px;
  }

  .library-browser {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .operation-select select {
    width: min(320px, 48vw);
  }

  .modal-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .side-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .profile-shell {
    padding: 12px;
  }

  .profile-hero {
    display: grid;
    min-height: 0;
    padding: 16px;
  }

  .profile-hero h1 {
    font-size: 28px;
  }

  .profile-health-card {
    width: 100%;
  }

  .profile-action-grid,
  .profile-overview {
    grid-template-columns: 1fr;
  }

  .profile-action-card {
    min-height: 112px;
  }

  .profile-production-row {
    grid-template-columns: 1fr;
  }

  .profile-production-counts {
    justify-content: flex-start;
  }

  .topbar {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    padding: 10px;
  }

  .top-actions {
    margin-left: 0;
    width: 100%;
    overflow-x: auto;
  }

  .topbar-right {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .account-name {
    max-width: 120px;
  }

  .toolbar {
    align-items: flex-start;
  }

  .control-taskbar {
    align-items: stretch;
  }

  .control-taskbar-title,
  .taskbar-group {
    width: 100%;
  }

  .operation-bar {
    align-items: stretch;
  }

  .operation-select {
    flex: 1 1 auto;
  }

  .operation-select select {
    width: 100%;
  }

  .taskbar-spacer {
    display: none;
  }

  .home {
    padding: 18px;
  }

  .home-head {
    grid-template-columns: 1fr;
  }

  .stage-zone {
    padding: 14px;
  }

  .stage-frame {
    min-width: 320px;
  }

  .library-titlebar {
    display: grid;
    align-items: start;
  }

  .library-actions {
    justify-content: flex-start;
  }

  .library-browser {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .folder-tree {
    max-height: 132px;
  }

  .library-card {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .modal-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .control-operator {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .control-monitor {
    position: static;
    width: auto;
    margin-bottom: 12px;
    box-shadow: none;
  }

  .tool-config-grid {
    grid-template-columns: 1fr;
  }

  .control-layer-list {
    max-height: 180px;
  }

  .control-deck {
    margin-right: 0;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }

  .edit-block-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================== Portal / Area do cliente ===================== */
.portal-page {
  background:
    radial-gradient(1100px 480px at 50% -220px, rgba(25, 160, 255, 0.10), transparent 70%),
    var(--bg);
}

.portal-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 60px;
}

.portal-title {
  margin: 6px 0 18px;
  text-align: left;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
}

.portal-account-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 4px 14px;
}

.portal-account-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
}

.portal-account-email {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.portal-grid {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.portal-sidebar {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-2);
  position: sticky;
  top: 14px;
}

.portal-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.portal-nav-item:hover {
  background: var(--panel-3);
  color: var(--text);
}

.portal-nav-item.active {
  background: rgba(25, 160, 255, 0.14);
  border-color: rgba(25, 160, 255, 0.5);
  color: var(--text);
}

.portal-nav-ico {
  width: 22px;
  text-align: center;
  font-size: 14px;
  opacity: 0.9;
}

.portal-nav-danger {
  color: #ffb4b4;
}

.portal-nav-danger:hover {
  background: rgba(239, 91, 91, 0.14);
  color: #ffd7d7;
}

.portal-nav-sep {
  height: 1px;
  margin: 8px 6px;
  background: var(--line-soft);
}

.portal-content {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--panel-3), var(--panel));
  padding: 16px 18px 22px;
  box-shadow: var(--shadow);
}

.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
}

.portal-tabs button {
  flex: 1 1 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.portal-tabs button:hover {
  color: var(--text);
}

.portal-tabs button.active {
  background: var(--panel-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.portal-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 2px 14px;
}

.portal-block-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.portal-section-intro {
  margin: -6px 2px 14px;
  color: var(--muted);
  font-size: 13px;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  border: 1px solid transparent;
}

.portal-badge-ok { color: #7ff0c0; background: rgba(33, 192, 122, 0.14); border-color: rgba(33, 192, 122, 0.5); }
.portal-badge-info { color: #9ad4ff; background: rgba(25, 160, 255, 0.14); border-color: rgba(25, 160, 255, 0.5); }
.portal-badge-warn { color: #ffd79a; background: rgba(240, 163, 58, 0.16); border-color: rgba(240, 163, 58, 0.5); }
.portal-badge-danger { color: #ffb4b4; background: rgba(239, 91, 91, 0.16); border-color: rgba(239, 91, 91, 0.55); }
.portal-badge-muted { color: var(--muted); background: var(--panel-2); border-color: var(--line); }

.portal-subscriber {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}
.portal-subscriber-on { color: var(--accent-2); }
.portal-subscriber-off { color: var(--muted); }
.portal-subscriber::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.portal-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.portal-alert-danger {
  border-color: rgba(239, 91, 91, 0.55);
  background: rgba(239, 91, 91, 0.12);
}

.portal-alert strong { display: block; color: #ffd7d7; }
.portal-alert span { color: #ffb4b4; font-size: 13px; }

.portal-summary-card {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 14px;
  margin-bottom: 14px;
}

.portal-summary-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.portal-summary-line strong { font-size: 16px; font-weight: 700; }
.portal-plan-price { color: var(--muted); font-weight: 700; }

.portal-summary-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.portal-summary-meta span,
.portal-stat-row span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
}

.portal-summary-meta strong { font-size: 14px; }

.portal-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.portal-stat-row > div {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 10px 12px;
}

.portal-stat-row strong { font-size: 20px; font-weight: 700; }

.portal-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.portal-form-grid .field { display: grid; gap: 6px; }
.portal-form-grid .field span {
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
}
.portal-form-grid .field input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 10px;
}
.portal-form-grid .field input:disabled { opacity: 0.7; }

.portal-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.portal-password-form { display: grid; gap: 2px; }

.portal-invoice-list {
  display: grid;
  gap: 8px;
}

.portal-invoice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px 12px;
}

.portal-invoice-row > div { min-width: 0; display: grid; gap: 2px; }
.portal-invoice-row div span { color: var(--muted); font-size: 12px; }
.portal-invoice-value { white-space: nowrap; }

.portal-soon {
  display: grid;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 18px;
  text-align: center;
}
.portal-soon strong { color: var(--text); }
.portal-soon span { color: var(--muted); font-size: 13px; }

.portal-soon-note {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.portal-filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.portal-chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  opacity: 0.7;
}

.portal-storage {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 12px 14px;
  margin-bottom: 4px;
}
.portal-storage-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.portal-storage-head span { font-size: 11px; font-weight: 800; text-transform: none; color: var(--muted); }
.portal-storage-bar { height: 8px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.portal-storage-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.portal-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.portal-link-row strong { display: block; }
.portal-link-row span { color: var(--muted); font-size: 12px; }

.portal-redeem-row { display: flex; gap: 8px; flex-wrap: wrap; }
.portal-redeem-row input {
  flex: 1 1 240px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 12px;
}

.portal-security-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
}
.portal-security-info span { font-size: 11px; font-weight: 800; text-transform: none; color: var(--muted); display: block; }
.portal-security-info strong { font-size: 18px; }
.portal-security-note { max-width: 320px; text-align: right; line-height: 1.35; }

@media (max-width: 780px) {
  .portal-grid { grid-template-columns: 1fr; }
  .portal-sidebar { position: static; grid-auto-flow: row; }
  .portal-link-row { grid-template-columns: 1fr; }
}

/* ===================== Planos (estilo Precos) ===================== */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  padding: 16px 16px 18px;
}

.plan-card.highlighted {
  border-color: rgba(25, 160, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(25, 160, 255, 0.25), 0 12px 30px rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, rgba(25, 160, 255, 0.08), var(--panel-2));
}

.plan-card.selected {
  border-color: rgba(33, 192, 122, 0.7);
  box-shadow: 0 0 0 1px rgba(33, 192, 122, 0.3);
}

.plan-flag {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #04121f;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.plan-card-head strong { font-size: 18px; font-weight: 700; }
.plan-current-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
  color: var(--accent-2);
  border: 1px solid rgba(33, 192, 122, 0.5);
  border-radius: 999px;
  padding: 2px 8px;
}

.plan-price { display: flex; align-items: baseline; gap: 4px; }
.plan-price b { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.plan-price span { color: var(--muted); font-size: 13px; }

.plan-desc { color: var(--muted); font-size: 13px; margin: 0; }

.plan-features {
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line-soft);
}
.plan-features li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text);
}
.plan-features li::before {
  content: "âœ“";
  position: absolute;
  left: 0;
  color: var(--accent-2);
  font-weight: 700;
}

.plan-choose { margin-top: auto; width: 100%; }
.plan-discount {
  width: max-content;
  border: 1px solid rgba(33, 192, 122, 0.36);
  border-radius: 999px;
  background: rgba(33, 192, 122, 0.1);
  color: #9ef1c8;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
}

/* ===================== Modal de assinatura ===================== */
.sub-modal {
  width: min(880px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}
.sub-modal::backdrop { background: rgba(0, 0, 0, 0.62); }

.sub-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 40px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel-3), var(--panel));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.sub-step-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  color: var(--accent);
  border: 1px solid rgba(25, 160, 255, 0.45);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 6px;
}
.sub-head h2 { margin: 0; font-size: 20px; font-weight: 700; }

.sub-body {
  padding: 18px 16px;
  overflow: auto;
}

.sub-plan-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.sub-payer-document {
  max-width: 360px;
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
}
.sub-payer-document > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.sub-payer-document input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 10px;
}
.sub-payer-document small { color: var(--muted); font-size: 11px; }

.sub-coupon { margin-top: 16px; text-align: center; }
.sub-coupon > span { color: var(--muted); font-size: 13px; }
.sub-coupon-row { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.sub-coupon-row input {
  flex: 0 1 320px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 12px;
}

.sub-payment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: start;
}
.sub-hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.sub-methods { display: grid; gap: 10px; }
.sub-method {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 12px 14px;
  cursor: pointer;
}
.sub-method span { font-weight: 800; }
.sub-method small { color: var(--muted); font-size: 11px; text-transform: none; font-weight: 800; }
.sub-method input:checked ~ span { color: var(--accent); }
.sub-method:has(input:checked) { border-color: rgba(25, 160, 255, 0.55); }
.sub-method.disabled { opacity: 0.55; cursor: not-allowed; }

.sub-cart {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  padding: 14px;
}
.sub-cart h3 { margin: 0 0 10px; font-size: 14px; }
.sub-cart > strong { display: block; font-size: 16px; margin-bottom: 10px; }
.sub-cart-line { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); border-top: 1px solid var(--line-soft); }
.sub-cart-line.total { color: var(--text); font-weight: 700; font-size: 16px; }
.sub-cart-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

.sub-pix { display: grid; gap: 12px; max-width: 620px; }
.sub-pix-value { margin: 0; font-size: 15px; }
.sub-pix-steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text); }
.sub-pix-note { margin: 0; color: var(--muted); font-size: 13px; }
.sub-soon { margin: 4px 0 0; color: var(--warn); font-size: 12px; }
.sub-pix-payment {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 14px;
}
.sub-pix-qr {
  width: 190px;
  aspect-ratio: 1;
  border: 8px solid #fff;
  border-radius: 6px;
  background: #fff;
  image-rendering: auto;
}
.sub-pix-copy { min-width: 0; }
.sub-pix-copy textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d11;
  color: var(--text);
  padding: 8px 10px;
}

.sub-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel-2);
}
.sub-actions-spacer { flex: 1 1 auto; }

@media (max-width: 640px) {
  .sub-payment-grid { grid-template-columns: 1fr; }
  .sub-pix-payment { grid-template-columns: 1fr; }
  .sub-pix-qr { width: min(190px, 100%); }
}

/* Fontes compartilhadas para listas com dados. */
.tool-source-help {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.tool-source-list { display: grid; gap: 6px; margin-bottom: 10px; }
.tool-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel-2);
}
.tool-source-row > div { min-width: 0; display: grid; gap: 2px; }
.tool-source-row strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-source-row span { color: var(--muted); font-size: 11px; }
.tool-source-row > button:not(.tool-destination-remove),
.shared-source-actions > button:not(.tool-destination-add),
.source-config-head > button {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12px;
}
.tool-source-row > .btn,
.shared-source-actions > .btn,
.shared-source-paste > .btn,
.source-config-head > .btn {
  border-color: var(--line-soft);
  background: #11171d;
  color: var(--text);
}
.tool-source-row > .btn:hover,
.shared-source-actions > .btn:hover,
.shared-source-paste > .btn:hover,
.source-config-head > .btn:hover {
  border-color: rgba(25, 160, 255, 0.48);
  background: #17212a;
}
.shared-source-actions > .btn.primary,
.shared-source-paste > .btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #071014;
}
.shared-source-actions > .btn.primary:hover,
.shared-source-paste > .btn.primary:hover {
  background: #43b3ff;
}
.source-editor-fields { gap: 14px; }
.source-config-block {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
  display: grid;
  gap: 8px;
}
.source-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.source-config-head strong { font-size: 13px; }
.source-column-list, .source-destination-list { display: grid; gap: 8px; }
.source-column-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
}
.source-column-row input,
.shared-source-row input,
.shared-source-paste textarea {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #0b0f13;
  color: var(--text);
}
.source-column-row input:focus,
.shared-source-row input:focus,
.shared-source-paste textarea:focus {
  outline: 0;
  border-color: rgba(25, 160, 255, 0.7);
  box-shadow: 0 0 0 2px rgba(25, 160, 255, 0.12);
}
.source-column-row input,
.source-column-row button { min-height: 34px; }
.source-column-row button {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #151b21;
  color: var(--text);
}
.source-column-row button:hover { border-color: var(--accent); background: #1b232b; }
.source-destination-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel-2);
}
.source-destination-row > .tool-destination-remove { align-self: end; }
.source-mapping-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.source-field-mapping span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shared-source-block {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel-2);
}
.shared-source-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.shared-source-head > div { min-width: 0; display: grid; gap: 2px; }
.shared-source-head strong { font-size: 14px; }
.shared-source-head span { font-size: 11px; color: var(--muted); }
.shared-source-count { flex: none; }
.shared-source-table { display: grid; gap: 5px; }
.shared-source-row {
  display: grid;
  grid-template-columns: repeat(var(--source-columns, 2), minmax(0, 1fr)) 30px;
  gap: 6px;
  align-items: center;
}
.shared-source-row input { min-width: 0; min-height: 32px; padding: 5px 8px; }
.shared-source-header { color: var(--muted); font-size: 11px; font-weight: 700; padding: 0 2px; }
.shared-source-actions { display: flex; align-items: center; gap: 8px; }
.shared-source-paste { display: grid; gap: 7px; padding-top: 2px; }
.shared-source-paste textarea { min-height: 88px; resize: vertical; padding: 8px 9px; }
.shared-source-paste button { justify-self: start; min-height: 30px; padding: 4px 10px; }

@media (max-width: 720px) {
  .source-mapping-list { grid-template-columns: 1fr; }
  .tool-source-row { grid-template-columns: minmax(0, 1fr) auto; }
  .tool-source-row .tool-destination-remove { grid-column: 2; }
}

/* ===================== Polimento de produto ===================== */
button, a, input, select, textarea, summary { letter-spacing: 0; }
button, .btn, .icon-btn, .portal-nav-item, .admin-tabs button {
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 100ms ease;
}
button:not(:disabled):active, .btn:not(:disabled):active, .icon-btn:not(:disabled):active { transform: translateY(1px); }

@media (max-width: 720px) {
  .tool-step-config {
    grid-template-columns: 1fr;
  }

  .tool-step-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .data-tool-step-controls {
    grid-template-columns: 34px minmax(52px, 1fr) 34px 34px;
  }
}
:where(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.portal-page { background: var(--bg); }
.portal-shell { width: min(1160px, calc(100vw - 40px)); padding: 28px 0 48px; }
.portal-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.portal-heading p { max-width: 480px; margin: 0 0 2px; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: right; }
.portal-eyebrow { display: block; margin-bottom: 4px; color: var(--accent); font-size: 11px; font-weight: 800; }
.portal-title { margin: 0; font-size: 26px; }
.portal-account-head {
  min-height: 48px; align-items: center; margin: 0 0 14px; padding: 10px 14px;
  border: 1px solid var(--line-soft); border-radius: 8px; background: var(--panel-2);
}
.portal-account-email { margin-right: auto; font-size: 16px; }
.portal-grid { grid-template-columns: 220px minmax(0, 1fr); gap: 12px; }
.portal-sidebar, .portal-content { border-radius: 8px; box-shadow: none; }
.portal-sidebar { padding: 8px; background: var(--panel); }
.portal-nav-item { min-height: 40px; padding: 0 10px; border-radius: 6px; font-size: 13px; }
.portal-nav-ico {
  display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line);
  border-radius: 5px; background: var(--panel-2); color: var(--muted); font-size: 10px; font-weight: 900;
}
.portal-nav-item.active .portal-nav-ico { border-color: rgba(25,160,255,.55); background: rgba(25,160,255,.16); color: #a9dcff; }
.portal-content { min-height: 430px; padding: 14px 16px 18px; background: var(--panel); }
.portal-section:not([hidden]), .portal-tabpane:not([hidden]) { animation: revo-content-in 160ms ease-out; }
@keyframes revo-content-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.portal-summary-card, .portal-stat-row > div, .portal-storage, .portal-link-row,
.portal-security-info, .portal-invoice-row { border-radius: 7px; background: #0d1318; }
.portal-stat-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.portal-stat-row > div { padding: 10px; }
.portal-stat-row strong { font-size: 18px; }
.plan-price b { letter-spacing: 0; }

.sub-modal { width: min(760px, calc(100vw - 28px)); }
.sub-modal::backdrop { background: rgba(0,0,0,.74); backdrop-filter: blur(2px); }
.sub-shell {
  grid-template-rows: auto auto minmax(0, 1fr) auto; max-height: min(760px, calc(100vh - 28px));
  border-radius: 8px; background: var(--panel);
}
.sub-head { padding: 14px 18px 10px; border-bottom: 0; }
.sub-step-tag { margin-bottom: 4px; padding: 0; border: 0; border-radius: 0; color: var(--muted); font-size: 10px; }
.sub-head h2 { font-size: 19px; }
.sub-progress {
  display: grid; grid-template-columns: max-content minmax(24px, 1fr) max-content; align-items: center;
  gap: 10px; margin: 0 18px; padding: 8px 0 12px; border-bottom: 1px solid var(--line-soft);
}
.sub-progress span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.sub-progress b {
  display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line);
  border-radius: 50%; background: var(--panel-2); font-size: 10px;
}
.sub-progress span.active, .sub-progress span.complete { color: var(--text); }
.sub-progress span.active b, .sub-progress span.complete b {
  border-color: var(--accent); background: rgba(25,160,255,.16); color: #b9e4ff;
}
.sub-progress i { height: 1px; background: var(--line); }
.sub-body { padding: 14px 18px 18px; }
.sub-intro { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.sub-plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.plan-card-compact { min-height: 174px; gap: 7px; padding: 13px; border-radius: 7px; }
.plan-card-compact .plan-card-head strong { font-size: 14px; }
.plan-card-compact .plan-price b { font-size: 20px; }
.plan-card-compact .plan-flag {
  position: static; order: -1; width: max-content; transform: none; padding: 2px 7px; font-size: 9px;
}
.plan-modal-note { min-height: 30px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.plan-card-compact .plan-choose { min-height: 32px; padding: 5px 8px; font-size: 11px; }
.sub-payer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(180px, 1fr); gap: 10px; margin-top: 14px; }
.sub-payer-document { max-width: none; margin: 0; }
.sub-payer-document input { min-height: 38px; }
.sub-privacy-note, .sub-pix-help { display: block; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.sub-pix { max-width: none; gap: 10px; }
.sub-pix-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sub-pix-heading > div { display: grid; gap: 2px; }
.sub-pix-heading > div span { color: var(--muted); font-size: 10px; font-weight: 800; }
.sub-pix-heading > div strong { font-size: 20px; }
.sub-pix-payment {
  grid-template-columns: 170px minmax(0, 1fr); gap: 18px; padding: 14px;
  border-radius: 7px; background: #0d1318;
}
.sub-pix-visual { display: grid; justify-items: center; gap: 8px; }
.sub-pix-visual span { color: var(--muted); font-size: 10px; line-height: 1.35; text-align: center; }
.sub-pix-qr { width: 170px; border-width: 7px; border-radius: 4px; }
.sub-pix-copy textarea {
  min-height: 88px; resize: none; font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px; line-height: 1.45;
}
.sub-pix-copy .portal-actions-row { margin-top: 10px; }
.sub-actions { padding: 10px 18px; background: #0d1318; }

.admin-billing-panel { overflow-x: auto; scrollbar-gutter: stable; }
.admin-billing-panel .admin-section-head, .admin-billing-panel .admin-invoice-head,
.admin-billing-panel .admin-invoice-row { min-width: 900px; }
.admin-invoices-list { max-height: calc(100vh - 330px); }

@media (max-width: 780px) {
  .topbar .app-nav { display: none; }
  .topbar-right { width: auto; margin-left: auto; flex-wrap: nowrap; }
  .portal-shell { width: min(100% - 20px, 1160px); padding-top: 16px; }
  .portal-heading { align-items: start; margin-bottom: 12px; }
  .portal-heading p { display: none; }
  .portal-title { font-size: 22px; }
  .portal-grid { grid-template-columns: 1fr; }
  .portal-sidebar { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 6px; scrollbar-width: none; }
  .portal-sidebar::-webkit-scrollbar { display: none; }
  .portal-nav-item { flex: 0 0 auto; width: auto; padding: 0 10px; white-space: nowrap; }
  .portal-nav-sep { display: none; }
  .portal-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sub-plan-grid { grid-template-columns: 1fr; }
  .plan-card-compact { min-height: 0; }
  .sub-payer-grid { grid-template-columns: 1fr; }
  .sub-pix-heading { align-items: start; }
}

@media (max-width: 760px) {
  .control-page { height: auto; min-height: 100vh; overflow: auto; }
  .control-workspace {
    height: auto;
    min-height: calc(100vh - 56px);
    grid-template-rows: auto auto auto;
    overflow: visible;
  }
  .control-taskbar { position: relative; align-items: center; }
  .control-library { max-height: none; min-height: 300px; overflow: visible; }
  .control-operator { display: flex; flex-direction: column; overflow: visible; padding: 12px 16px 20px; }
  .control-deck {
    order: 1;
    flex: 0 0 auto;
    width: 100%;
    min-height: var(--deck-content-height, 220px);
    margin: 0 0 12px;
    overflow: auto;
  }
  .control-monitor { order: 2; margin: 0; }
}

@media (max-width: 540px) {
  .portal-account-head { align-items: flex-start; }
  .portal-account-email { flex-basis: 100%; overflow-wrap: anywhere; }
  .portal-content { padding: 12px; }
  .portal-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .portal-tabs button { flex: 0 0 auto; }
  .portal-summary-meta { grid-template-columns: 1fr 1fr; }
  .portal-invoice-row { grid-template-columns: 1fr auto; }
  .portal-invoice-value { grid-column: 1 / -1; }
  .sub-modal { width: calc(100vw - 12px); }
  .sub-shell { max-height: calc(100vh - 12px); }
  .sub-progress { margin-inline: 12px; }
  .sub-progress span { font-size: 10px; }
  .sub-head, .sub-body, .sub-actions { padding-inline: 12px; }
  .sub-pix-payment { grid-template-columns: 1fr; }
  .sub-pix-qr { width: min(170px, 100%); }
  .sub-pix-copy .portal-actions-row { display: grid; }
  .sub-pix-copy .portal-actions-row > * { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important; animation-duration: .01ms !important;
    animation-iteration-count: 1 !important; transition-duration: .01ms !important;
  }
}

/* Mobile uses the same saved workspace and adds viewport-aware navigation. */
.mobile-layers-toggle,
.mobile-delete-selection,
.mobile-close-layers { display: none; }

.mobile-layer-actions { display: flex; align-items: center; gap: 6px; }

@media (max-width: 900px), (pointer: coarse) and (max-width: 1100px) {
  .control-page {
    width: 100%;
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .control-page .topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    min-height: 52px;
    padding: 8px 12px;
  }

  .control-page .topbar-right {
    width: auto;
    margin-left: auto;
  }

  .control-page .control-workspace,
  .control-page.library-collapsed .control-workspace {
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 52px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    overflow: visible;
  }

  .control-taskbar {
    position: sticky;
    top: 52px;
    z-index: 70;
    min-height: 52px;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    overflow-x: auto;
    overflow-y: visible;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .control-taskbar::-webkit-scrollbar { display: none; }
  .control-taskbar > * { flex: 0 0 auto; }
  .control-taskbar .library-toggle {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #10161c;
    box-shadow: 8px 0 12px #090d11;
  }
  .control-taskbar-title,
  .control-taskbar .taskbar-group { width: auto; }
  .control-taskbar .operation-bar { flex-wrap: nowrap; }
  .control-taskbar .operation-select select { width: 180px; }
  .control-work-name { max-width: 150px; }
  .taskbar-spacer { display: none; }

  .control-library {
    width: 100%;
    max-height: none;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    overflow: visible;
    padding: 12px;
  }

  .library-browser {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .folder-tree { max-height: 164px; }
  .library-grid { min-height: 0; }

  .control-operator {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 12px;
  }

  .board-tabs-shell,
  .control-page.operator-mode .board-tabs-shell {
    order: 0;
    width: 100%;
    flex: 0 0 auto;
    margin-right: 0;
  }

  .board-tab {
    min-width: 108px;
    max-width: 170px;
  }

  .control-deck,
  .control-page.operator-mode .control-deck {
    order: 1;
    width: 100%;
    min-height: var(--deck-content-height, 220px);
    display: block;
    margin: 0;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y;
  }

  .control-deck .board-card {
    position: absolute;
    min-height: 0;
  }
  .control-deck .data-tool-card { min-height: 74px; }
  .control-page.board-locked .control-deck .card-resize { display: none !important; }
  .control-deck .gc-head,
  .control-deck .data-tool-head { cursor: grab; touch-action: none; }
  .control-deck .gc-toggle {
    width: clamp(70px, 23vw, 94px) !important;
    height: clamp(70px, 23vw, 94px) !important;
    margin: 10px;
  }

  /* Nas docas estreitas, o operador preserva a composicao configurada no
     painel e apenas a reduz proporcionalmente. */
  .control-page.operator-mode .control-deck {
    display: block;
    min-height: 0;
    padding: 8px;
    overflow: auto;
  }

  .control-page.operator-mode {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .control-page.operator-mode .control-workspace {
    height: 100dvh;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }

  .control-page.operator-mode .control-operator {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .control-page.operator-mode .control-deck {
    flex: 1 1 auto;
    height: auto;
    max-height: none;
  }

  .control-page.operator-mode .control-deck .board-card {
    position: absolute;
  }

  .control-page.operator-mode .operator-layout-lock {
    top: 7px;
    right: 7px;
  }

  .control-monitor {
    order: 2;
    position: static;
    width: 100%;
    margin: 12px 0 0;
    box-shadow: none;
  }
  .control-output-preview { width: min(100%, 560px); margin-inline: auto; }
  .control-layer-list { max-height: 260px; }

  .control-modal,
  .revo-native-dialog {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: calc(100dvh - 16px);
    margin: auto;
  }
  .control-modal .modal-shell,
  .revo-native-shell { max-height: calc(100dvh - 16px); }

  .editor-page {
    width: 100%;
    height: 100dvh;
    overflow: hidden;
  }
  .editor-page .topbar {
    min-height: 50px;
    flex-wrap: nowrap;
    padding: 7px 9px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .editor-page .topbar::-webkit-scrollbar { display: none; }
  .editor-page .brand { flex: 0 0 auto; }
  .editor-page .editor-file-actions {
    flex: 0 0 auto;
    min-width: 0;
  }
  .editor-page .file-crumb { max-width: 130px; }
  .editor-page .topbar-right {
    width: auto;
    display: flex;
    flex: 0 0 auto;
    margin-left: auto;
  }
  .editor-page .topbar-right .app-nav { display: none; }
  .editor-page .account-trigger { min-height: 36px; padding: 4px 7px; }
  .editor-page .account-name { max-width: 112px; }

  .editor-page .editor-shell {
    height: calc(100dvh - 50px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 48px minmax(0, 1fr);
    overflow: hidden;
  }
  .editor-page .tool-rail {
    grid-row: 1;
    min-width: 0;
    min-height: 48px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 6px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 6px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .editor-page .tool-rail::-webkit-scrollbar { display: none; }
  .editor-page .tool-btn { flex: 0 0 36px; width: 36px; height: 36px; }
  .editor-page .editor-main {
    grid-row: 2;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .editor-page .ribbon { min-width: 0; }
  .editor-page .ribbon-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .editor-page .ribbon-tabs::-webkit-scrollbar { display: none; }
  .editor-page .ribbon-tab { flex: 0 0 auto; min-width: 82px; }
  .editor-page .ribbon-panel.active {
    max-height: 108px;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }
  .editor-page .ribbon-panel.active > .toolbar-group { flex: 0 0 auto; }
  .editor-page .stage-zone {
    min-width: 0;
    min-height: 0;
    padding: 8px;
    scroll-padding: 8px;
    touch-action: none;
  }
  .editor-page .stage-frame {
    min-width: 0;
    padding: 4px;
  }
  .editor-page .stage-canvas { touch-action: none; }

  .control-page:not(.board-locked) .card-resize-e,
  .control-page:not(.board-locked) .card-resize-w { width: 15px; }
  .control-page:not(.board-locked) .card-resize-s { height: 15px; }
  .control-page:not(.board-locked) .card-resize-se,
  .control-page:not(.board-locked) .card-resize-sw { width: 24px; height: 24px; }
  .editor-page .statusbar {
    min-height: 44px;
    padding: 5px 8px;
    gap: 7px;
    scrollbar-width: none;
  }
  .editor-page .statusbar::-webkit-scrollbar { display: none; }
  .editor-page .statusbar .icon-btn,
  .editor-page .statusbar .btn { min-height: 34px; }
  .mobile-layers-toggle {
    display: inline-flex;
    position: sticky;
    right: 0;
    margin-left: auto;
    background: #151b21;
    box-shadow: -8px 0 12px #0d1115;
  }
  .mobile-delete-selection {
    display: inline-flex;
    flex: 0 0 auto;
    position: fixed;
    z-index: 92;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(62px, calc(env(safe-area-inset-bottom) + 54px));
    min-height: 42px !important;
    padding-inline: 15px;
    border-color: #d24c55;
    background: #9f2730;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  }
  .mobile-delete-selection:disabled { display: none; }
  .mobile-close-layers {
    display: inline-grid;
    place-items: center;
  }
  .editor-page .inspector {
    display: none;
    position: fixed;
    z-index: 95;
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-height: min(52dvh, 460px);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .65);
  }
  .editor-page.mobile-inspector-open .inspector { display: grid; }
  .editor-page .inspector-scroll { max-height: min(52dvh, 460px); }
}

@media (max-width: 520px) {
  .control-page .topbar .brand span:last-child { display: none; }
  .control-taskbar { top: 50px; }
  .control-deck .board-card { min-width: 0; }
  .control-deck .gc-head-title,
  .control-deck .data-tool-head strong { font-size: 11px; }
  .control-deck .data-tool-row { grid-template-columns: minmax(42px, 1fr) 30px minmax(24px, auto) 30px; }
  .control-deck .data-tool-card button:not(.gc-menu-btn) { min-height: 32px; }

  .editor-page .brand span:last-child,
  .editor-page .file-crumb,
  .editor-page .technical-select { display: none; }
  .editor-page .field.wide { min-width: 150px; }
  .editor-page .ribbon-panel.active { max-height: 100px; }
}

/* ===========================================================================
   Lancador de GCs na barra lateral do Controle + dialogo do Acervo
   A lateral deixou de ser explorador de arquivos: durante a operacao ela serve
   so para achar um GC e joga-lo no painel. O explorador completo (pastas,
   imagens, planilhas) foi para o dialogo #assetsDialog.
   =========================================================================== */

.control-library {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.gc-launcher-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.gc-launcher-head input {
  width: 100%;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #080c10;
  color: var(--text);
  padding: 0 9px;
  font-size: 12px;
}

.gc-launcher-head input:focus {
  outline: none;
  border-color: #19a0ff;
}

.gc-launcher-head .btn {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #121820;
  color: var(--text);
}

.gc-launcher-head .btn:hover {
  border-color: #2b3742;
  background: #161d26;
}

.gc-launcher-folders {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.gc-launcher-folders[hidden] {
  display: none;
}

.gc-launcher-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #0f1419;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.gc-launcher-chip:hover:not(:disabled) {
  border-color: #2b3742;
  color: var(--text);
}

.gc-launcher-chip.active {
  background: #19a0ff;
  border-color: transparent;
  color: #071019;
  font-weight: 700;
}

.gc-launcher-chip b {
  font-weight: 700;
  opacity: 0.6;
}

.gc-launcher-chip:disabled {
  opacity: 0.35;
  cursor: default;
}

.gc-launcher {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  align-content: start;
  padding-right: 2px;
  scrollbar-color: #2c3741 #10151a;
  scrollbar-width: thin;
}

.gc-launcher .empty {
  grid-column: 1 / -1;
}

.gc-launcher-card {
  display: grid;
  grid-template-rows: auto auto;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0f1419;
  padding: 6px;
  cursor: grab;
}

.gc-launcher-card:hover {
  border-color: #2b3742;
  background: #131a22;
}

.gc-launcher-card.selected {
  border-color: #19a0ff;
  box-shadow: inset 0 0 0 1px rgba(25, 160, 255, 0.35);
}

.gc-launcher-card:focus-visible {
  outline: 2px solid #19a0ff;
  outline-offset: 1px;
}

/* A previa e o que faz reconhecer o GC: 16:9 de verdade, nao um selo de 52px. */
.gc-launcher-thumb {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(45deg, #222831 25%, transparent 25%),
    linear-gradient(-45deg, #222831 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #222831 75%),
    linear-gradient(-45deg, transparent 75%, #222831 75%),
    #141a20;
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.gc-launcher-thumb svg {
  display: block;
  width: 100%;
  height: 100%;
}

.gc-launcher-card strong {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-launcher-foot {
  font-size: 11px;
  color: var(--muted);
  padding-top: 2px;
}

/* --- Dialogo do Acervo: reaproveita o explorador completo ----------------- */

.assets-dialog {
  width: min(1040px, calc(100vw - 44px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.assets-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.assets-shell {
  height: min(720px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1015;
  padding: 16px;
}

.assets-shell .library-browser {
  min-height: 0;
  grid-template-columns: 230px minmax(0, 1fr);
}

.assets-shell .library-tools {
  display: grid;
  gap: 8px;
}

.assets-shell .library-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assets-shell .library-filter button {
  padding: 0 14px;
}


/* ===========================================================================
   Clareza no cadastro e na ligacao das listas
   O modelo nao mudou (um campo por destino). O que mudou e a leitura: os campos
   do item ficam agrupados pelo GC, o rotulo perde a repeticao do nome do GC, e
   cada campo diz o que aceita.
   =========================================================================== */

.item-group {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0c1116;
  align-self: start;
}

.item-group > summary {
  border-radius: 7px 7px 0 0;
}

.item-group:not([open]) > summary {
  border-radius: 7px;
}

.item-group + .item-group {
  margin-top: 8px;
}

.item-group > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
  background: #11171d;
  border-bottom: 1px solid transparent;
  user-select: none;
}

.item-group[open] > summary {
  border-bottom-color: var(--line-soft);
}

.item-group > summary::-webkit-details-marker {
  display: none;
}

/* seta propria, para o mesmo desenho em qualquer navegador */
.item-group > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid var(--muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
  flex: none;
}

.item-group[open] > summary::before {
  transform: rotate(90deg);
}

@media (prefers-reduced-motion: reduce) {
  .item-group > summary::before { transition: none; }
}

.item-group > summary:hover {
  background: #141b22;
}

.item-group > summary:focus-visible {
  outline: 2px solid #19a0ff;
  outline-offset: -2px;
}

.item-group-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.item-group-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}

.item-group-fields {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

/* etiqueta do tipo do campo, ao lado do rotulo */
.field-kind {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: #161d25;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

/* aviso de valor repetido: explica por que o cadastro parece maior do que e */
.field-dup {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: #f0a63c;
  background: rgba(240, 166, 60, 0.12);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ligacao: titulo com contagem e uma linha de explicacao */
.tool-binding-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.tool-binding-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.tool-binding-hint {
  margin: 2px 0 8px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 62ch;
}

.dest-kind {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: #161d25;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  white-space: nowrap;
}

.dest-kind:empty {
  display: none;
}

