/* ===========================================================
   VOLTLAB · Engineering Suite — design system
=========================================================== */
:root {
  /* Surfaces */
  --bg-0: oklch(13% 0.012 240);
  --bg-1: oklch(17% 0.012 240);
  --bg-2: oklch(20% 0.013 240);
  --bg-3: oklch(24% 0.014 240);
  --bg-elev: oklch(22% 0.014 240);

  /* Text */
  --fg: oklch(96% 0.005 240);
  --fg-dim: oklch(72% 0.012 240);
  --fg-mute: oklch(55% 0.012 240);
  --fg-faint: oklch(40% 0.012 240);

  /* Borders */
  --border: oklch(28% 0.012 240);
  --border-2: oklch(34% 0.014 240);
  --border-3: oklch(45% 0.016 240);

  /* Status */
  --ok: oklch(80% 0.16 150);
  --warn: oklch(80% 0.16 75);
  --danger: oklch(70% 0.20 25);

  /* Accent (overridden by JS) */
  --accent: oklch(72% 0.18 245);
  --accent-2: oklch(82% 0.14 200);
  --accent-soft: oklch(72% 0.18 245 / 0.12);
  --accent-glow: oklch(72% 0.22 245 / 0.35);

  /* Type */
  --ff-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --ff-body: "IBM Plex Sans", system-ui, sans-serif;
  --ff-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  /* Spacing scale */
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 12px;
  --r-4: 16px;
  --r-5: 20px;
  --r-pill: 999px;
}

[data-density="compact"] {
  --pad-card: 16px;
  --pad-panel: 18px;
  --gap-grid: 14px;
}
:root, [data-density="comfortable"] {
  --pad-card: 22px;
  --pad-panel: 26px;
  --gap-grid: 20px;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--ff-body);
  background: var(--bg-0);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.005em;
  overflow: hidden;
}

button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font-family: inherit; color: inherit; background: transparent; border: 0; outline: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); color: var(--fg); }

.mono { font-family: var(--ff-mono); font-feature-settings: "tnum","zero"; letter-spacing: 0; }
.dim  { color: var(--fg-mute); }
.small { font-size: 11px; }
.readout {
  font-family: var(--ff-mono);
  font-feature-settings: "tnum","zero";
  letter-spacing: -0.01em;
}
[data-mono="off"] .readout { font-family: var(--ff-display); }

/* ===========================================================
   BUTTONS
=========================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  font-size: 13px; font-weight: 500;
  border-radius: var(--r-2);
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  transition: all .18s ease;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn:hover { border-color: var(--border-3); background: var(--bg-3); }
.btn-primary {
  background: var(--accent);
  color: oklch(15% 0.02 240);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -10px var(--accent-glow);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 0 0 1px var(--accent), 0 12px 30px -8px var(--accent-glow); }
.btn-ghost { background: transparent; border-color: var(--border-2); color: var(--fg-dim); }
.btn-ghost:hover { color: var(--fg); border-color: var(--border-3); background: var(--bg-2); }
.btn-block { width: 100%; justify-content: center; padding: 13px 16px; }
.btn-link {
  padding: 0; background: transparent; border: 0;
  color: var(--fg-dim); font-size: 12px; gap: 4px;
}
.btn-link:hover { color: var(--accent); }

.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  background: var(--bg-1);
  transition: all .18s ease;
}
.icon-btn:hover { color: var(--fg); border-color: var(--border-2); background: var(--bg-2); }
.dot-mark {
  position: absolute; top: 8px; right: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ===========================================================
   STATUS / PILLS / CHIPS
=========================================================== */
.status-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fg-faint);
  position: relative;
  margin-right: 8px;
  flex: 0 0 6px;
}
.status-dot.status-ok { background: var(--ok); box-shadow: 0 0 8px oklch(80% 0.18 150 / 0.5); }
.status-dot.status-warn { background: var(--warn); box-shadow: 0 0 8px oklch(80% 0.18 75 / 0.5); }
.status-ok > .status-dot, .status-dot.status-ok::after,
.status-ok .status-dot { background: var(--ok); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 500;
  font-family: var(--ff-mono); letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--fg-dim);
}
.pill-ok { color: var(--ok); border-color: oklch(80% 0.16 150 / 0.35); background: oklch(80% 0.16 150 / 0.08); }
.pill-warn { color: var(--warn); border-color: oklch(80% 0.16 75 / 0.35); background: oklch(80% 0.16 75 / 0.08); }

.status-chip {
  display: inline-flex; align-items: center;
  padding: 4px 12px 4px 8px;
  font-size: 10px; letter-spacing: 0.12em;
  font-family: var(--ff-mono); text-transform: uppercase;
  border: 1px solid var(--border-2);
  border-radius: var(--r-pill);
  color: var(--ok);
  background: oklch(80% 0.16 150 / 0.06);
}

/* ===========================================================
   LANDING / LOGIN
=========================================================== */
.landing {
  position: relative;
  min-height: 100vh;
  min-width: 1280px;
  height: 100vh;
  overflow: auto;
  background: radial-gradient(120% 80% at 50% -10%, oklch(22% 0.04 245 / 0.4), transparent 60%),
              radial-gradient(80% 60% at 100% 100%, oklch(22% 0.04 200 / 0.25), transparent 60%),
              var(--bg-0);
  display: flex; flex-direction: column;
  color: var(--fg);
}
.landing-bg {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  color: var(--accent);
}
.circuitry { position: absolute; inset: 0; width: 100%; height: 100%; }
.landing-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(70% 50% at 50% 50%, transparent 40%, oklch(13% 0.012 240 / 0.7) 100%);
}
.landing-orb {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
  pointer-events: none;
}
.landing-orb-a { background: var(--accent); top: -200px; left: -200px; }
.landing-orb-b { background: var(--accent-2); bottom: -300px; right: -200px; opacity: 0.25; }

.landing-top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 56px;
  border-bottom: 1px solid oklch(28% 0.012 240 / 0.5);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 10px var(--accent-glow));
}
.brand-logo svg { display: block; }
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: oklch(13% 0.012 240);
  border: 1px solid var(--border-2);
  display: grid; place-items: center;
  position: relative;
}
.brand-mark::before {
  content: ""; position: absolute; inset: 4px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  box-shadow: inset 0 0 6px var(--accent-glow);
}
.brand-mark span {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 1px;
  box-shadow: 0 0 8px var(--accent-glow);
}
.brand-name {
  font-family: var(--ff-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 13px;
  color: var(--fg);
}
.brand-name em { font-style: normal; color: var(--fg-mute); font-weight: 500; }
.brand-dot { color: var(--accent); }

.landing-nav { display: flex; gap: 28px; }
.landing-nav a {
  font-size: 13px;
  color: var(--fg-dim);
  position: relative;
  transition: color .2s;
}
.landing-nav a:hover { color: var(--fg); }
.landing-meta {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  display: flex; align-items: center;
}

.landing-grid {
  position: relative; z-index: 2;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr minmax(420px, 480px);
  gap: 80px;
  padding: 80px 56px 60px;
  align-items: center;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.landing-hero { max-width: 760px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 28px;
  text-transform: uppercase;
}
.hero-tag-line {
  width: 28px; height: 1px; background: var(--accent);
  display: inline-block;
}
.hero-title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  text-wrap: pretty;
}
.hero-title em {
  font-style: normal;
  color: var(--fg-dim);
  font-weight: 300;
}
.hero-emph {
  color: var(--accent);
  position: relative;
  font-weight: 600;
}
.hero-sub {
  font-size: 17px;
  color: var(--fg-dim);
  max-width: 520px;
  margin: 0 0 44px;
  line-height: 1.6;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
  max-width: 580px;
}
.hero-stats > div {
  background: oklch(15% 0.012 240 / 0.6);
  backdrop-filter: blur(6px);
  padding: 22px 24px;
  display: flex; flex-direction: column; gap: 4px;
}
.hero-stats b {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.hero-stats span {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

/* Login card */
.login-card {
  display: flex; justify-content: flex-end;
}
.login-frame {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, oklch(18% 0.014 240 / 0.85), oklch(15% 0.012 240 / 0.85));
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-2);
  border-radius: var(--r-3);
  padding: 40px 36px 28px;
  box-shadow: 0 30px 80px -20px oklch(10% 0.01 240 / 0.6), inset 0 1px 0 oklch(100% 0 0 / 0.04);
}
.login-corner {
  position: absolute;
  width: 12px; height: 12px;
  border-color: var(--accent);
}
.login-corner-tl { top: -1px; left: -1px; border-top: 1px solid; border-left: 1px solid; }
.login-corner-tr { top: -1px; right: -1px; border-top: 1px solid; border-right: 1px solid; }
.login-corner-bl { bottom: -1px; left: -1px; border-bottom: 1px solid; border-left: 1px solid; }
.login-corner-br { bottom: -1px; right: -1px; border-bottom: 1px solid; border-right: 1px solid; }

.login-eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 12px;
}
.login-head h2 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.login-head p {
  color: var(--fg-mute);
  font-size: 13px;
  margin: 0 0 28px;
}

.login-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.field-input {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  height: 44px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  transition: border-color .2s, box-shadow .2s;
}
.field-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-input svg { color: var(--fg-mute); flex: 0 0 16px; }
.field-input input {
  flex: 1; height: 100%;
  font-size: 14px;
  letter-spacing: 0.01em;
}
.field-action {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: var(--fg-mute);
  border-radius: var(--r-2);
}
.field-action:hover { color: var(--fg); background: var(--bg-2); }

.login-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 14px;
  font-size: 12px;
}
.login-error {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--danger);
  background: oklch(70% 0.20 25 / 0.10);
  border: 1px solid oklch(70% 0.20 25 / 0.40);
}
.login-error::before {
  content: "!";
  flex: 0 0 16px;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 11px;
  color: var(--bg-0);
  background: var(--danger);
}
.checkbox {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg-dim);
  cursor: pointer;
}
.checkbox input { display: none; }
.checkbox span {
  width: 14px; height: 14px;
  border-radius: 3px;
  background: var(--bg-0);
  border: 1px solid var(--border-2);
  position: relative;
  flex: 0 0 14px;
  display: inline-block;
}
.checkbox input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox input:checked + span::after {
  content: ""; position: absolute;
  width: 5px; height: 8px;
  border: 1.5px solid oklch(15% 0.02 240);
  border-top: 0; border-left: 0;
  top: 1px; left: 4px;
  transform: rotate(45deg);
}
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }

.login-sep {
  position: relative;
  margin: 6px 0;
  text-align: center;
}
.login-sep::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px solid var(--border);
}
.login-sep span {
  position: relative;
  padding: 0 12px;
  background: oklch(16% 0.012 240);
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  text-transform: uppercase;
}

.login-foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
  text-transform: uppercase;
}

.landing-foot {
  position: relative; z-index: 2;
  padding: 18px 56px;
  border-top: 1px solid oklch(28% 0.012 240 / 0.5);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.06em;
}
.foot-meta { display: flex; gap: 12px; }
.dot-sep { color: var(--fg-faint); }

/* ===========================================================
   APP SHELL
=========================================================== */
.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  min-width: 1280px;
  background: var(--bg-0);
  background-image: radial-gradient(120% 60% at 0% 0%, oklch(22% 0.03 245 / 0.25), transparent 60%);
}
body { min-width: 0; }
html, body { overflow-x: auto; }

/* SIDEBAR */
.sidebar {
  background: oklch(15% 0.012 240);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 22px 18px 18px;
  overflow: hidden;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 6px 22px;
  border-bottom: 1px solid var(--border);
}

.sidebar-search {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 12px;
  padding: 0 12px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  color: var(--fg-mute);
  background: var(--bg-0);
}
.sidebar-search input {
  flex: 1; font-size: 12px;
}
.sidebar-search input::placeholder { color: var(--fg-mute); }
.sidebar-search kbd {
  font-family: var(--ff-mono);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  color: var(--fg-dim);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  margin: 8px -4px 8px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

.nav-section { margin-bottom: 12px; }
.nav-section-title {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--fg-mute);
  text-transform: uppercase;
  padding: 12px 8px 6px;
}

.nav-item {
  position: relative;
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-2);
  color: var(--fg-dim);
  font-size: 13px;
  text-align: left;
  transition: all .15s ease;
}
.nav-item > svg { flex: 0 0 16px; color: var(--fg-mute); }
.nav-item > span:first-of-type { flex: 1; }
.nav-item:hover { background: var(--bg-2); color: var(--fg); }
.nav-item:hover > svg { color: var(--fg-dim); }
.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--fg);
}
.nav-item.is-active > svg { color: var(--accent); }
.nav-active-mark {
  position: absolute; left: -18px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.nav-badge {
  font-family: var(--ff-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: oklch(15% 0.02 240);
  font-weight: 600;
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 6px;
  display: flex; flex-direction: column; gap: 10px;
}
.sys-card {
  padding: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.sys-row {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  text-transform: uppercase;
}
.sys-row-meta { color: var(--fg-mute); margin-top: 6px; }
.sys-bar {
  margin-top: 8px;
  height: 3px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
}
.sys-bar > span {
  display: block; height: 100%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  transition: all .15s;
}
.sidebar-user:hover { background: var(--bg-2); border-color: var(--border-2); }
.avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-2);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid oklch(72% 0.18 245 / 0.4);
  display: grid; place-items: center;
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: 0 0 32px;
}
.avatar-meta {
  flex: 1; display: flex; flex-direction: column; line-height: 1.2;
  text-align: left;
}
.avatar-meta b { font-size: 12px; color: var(--fg); }
.avatar-meta em {
  font-style: normal;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
  text-transform: uppercase;
}

/* ===========================================================
   MAIN
=========================================================== */
.main {
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.app-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 26px 38px 24px;
  border-bottom: 1px solid var(--border);
  background: oklch(14% 0.012 240 / 0.6);
  backdrop-filter: blur(12px);
}
.crumbs {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.crumb-sep { color: var(--fg-faint); }
.crumb.is-last { color: var(--fg-dim); }
.app-eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.app-title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
  white-space: nowrap;
}
.app-header-r {
  display: flex; align-items: center; gap: 10px;
}
.app-header-l { min-width: 0; flex: 1; }
.app-header-r { flex: 0 0 auto; }

.main-scroll {
  flex: 1;
  overflow: auto;
  padding: 28px 38px 60px;
}
.main-scroll::-webkit-scrollbar { width: 8px; }
.main-scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* ===========================================================
   PANEL primitive
=========================================================== */
.panel {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--pad-panel);
  position: relative;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 18px;
  gap: 16px;
}
.panel-eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--fg-mute);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.panel-head h3 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--fg);
}

/* ===========================================================
   DASHBOARD
=========================================================== */
.dashboard { display: flex; flex-direction: column; gap: var(--gap-grid); }

.d-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-3);
  border: 1px solid var(--border);
  background: linear-gradient(120deg, oklch(20% 0.025 245 / 0.6), oklch(16% 0.012 240) 70%);
  padding: 40px 44px;
  isolation: isolate;
  min-height: 220px;
}
.d-hero-bg {
  position: absolute; inset: 0;
  z-index: 0;
  color: var(--accent);
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 30%, black);
          mask-image: linear-gradient(90deg, transparent, black 30%, black);
}
.d-hero-content { position: relative; z-index: 1; max-width: 720px; }
.d-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.d-hero-title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 10px;
}
.d-hero-title em { font-style: normal; color: var(--fg-dim); font-weight: 300; }
.d-hero-sub {
  font-size: 14px;
  color: var(--fg-dim);
  margin: 0 0 26px;
}
.d-hero-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}

/* KPI strip */
.d-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-grid);
}
.kpi {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}
.kpi-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.kpi-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.kpi-delta {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  color: var(--fg-dim);
}
.kpi-delta.is-up { color: var(--ok); background: oklch(80% 0.16 150 / 0.08); }
.kpi-delta.is-down { color: var(--warn); background: oklch(80% 0.16 75 / 0.08); }
.kpi-value {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 8px;
}
.kpi-value .readout {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.kpi-unit {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--fg-mute);
}
.kpi-spark { width: 100%; height: 36px; display: block; }

/* Dashboard grid */
.d-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--gap-grid);
}
.panel-recent { grid-row: span 2; }
.panel-chart { grid-column: 1; }
.panel-notes { grid-column: 2; }

/* Recent table */
.recent-table { display: flex; flex-direction: column; }
.rt-head, .rt-row {
  display: grid;
  grid-template-columns: 80px 1.2fr 1.4fr 1.5fr 100px;
  align-items: center;
  gap: 12px;
  padding: 12px 6px;
}
.rt-head {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.rt-row {
  border-bottom: 1px solid oklch(28% 0.012 240 / 0.4);
  font-size: 13px;
  transition: background .15s;
}
.rt-row:hover { background: var(--bg-2); }
.rt-row:last-child { border-bottom: 0; }

/* Quick grid */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.quick-card {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--bg-0);
  transition: all .18s;
  text-align: left;
}
.quick-card:hover {
  background: var(--bg-2);
  border-color: var(--border-2);
  transform: translateX(2px);
}
.quick-card:hover .quick-icon {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.quick-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-2);
  border: 1px solid var(--border-2);
  display: grid; place-items: center;
  color: var(--fg-dim);
  flex: 0 0 38px;
  transition: all .2s;
}
.quick-meta { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.quick-meta b { font-size: 13px; font-weight: 500; color: var(--fg); }
.quick-meta em {
  font-style: normal;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.quick-card > svg:last-child { color: var(--fg-mute); }

/* Chart */
.legend {
  display: flex; gap: 16px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 2px; display: inline-block; }
.lg-a { background: var(--accent); }
.lg-b { background: var(--accent-2); }
.lg-c { background: var(--warn); }
.chart-wrap { width: 100%; }
.chart-svg { width: 100%; height: 240px; display: block; }

/* Notice list */
.notice-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.notice-list li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.notice-list li > .status-dot { margin-top: 6px; }
.notice-list b { font-size: 13px; color: var(--fg); display: block; }
.notice-list em {
  font-style: normal;
  font-size: 12px;
  color: var(--fg-mute);
  display: block;
  margin-top: 2px;
  line-height: 1.5;
}

/* ===========================================================
   CALCULATORS GRID
=========================================================== */
.calculators { display: flex; flex-direction: column; gap: 22px; }

/* Header row */
.catalog-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.catalog-head-l { min-width: 0; }
.catalog-eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.catalog-title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--fg);
  white-space: nowrap;
}
.catalog-search {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  height: 44px;
  width: 340px;
  max-width: 100%;
  border: 1px solid var(--border-2);
  border-radius: var(--r-2);
  background: var(--bg-1);
  color: var(--fg-mute);
  transition: border-color .18s, box-shadow .18s;
}
.catalog-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  color: var(--accent);
}
.catalog-search input {
  flex: 1; font-size: 13px; color: var(--fg);
  background: transparent; border: 0; outline: 0;
}
.catalog-search input::placeholder { color: var(--fg-mute); }
.catalog-search-clear {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--fg-mute); font-size: 16px; line-height: 1;
  background: var(--bg-2);
  transition: all .15s;
}
.catalog-search-clear:hover { color: var(--fg); background: var(--bg-3); }

/* Category tabs */
.catalog-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.cat-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg-dim);
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--bg-1);
  transition: all .16s ease;
}
.cat-tab:hover { color: var(--fg); border-color: var(--border-3); transform: translateY(-1px); }
.cat-tab-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cat, var(--accent));
  box-shadow: 0 0 8px var(--cat, var(--accent));
}
.cat-tab-count {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--fg-mute);
  background: var(--bg-3);
  padding: 1px 7px;
  border-radius: var(--r-pill);
  min-width: 20px; text-align: center;
}
.cat-tab.is-active {
  color: var(--fg);
  background: var(--cat-soft, var(--accent-soft));
  border-color: var(--cat, var(--accent));
}
.cat-tab.is-active .cat-tab-count {
  background: var(--cat, var(--accent));
  color: oklch(16% 0.02 240);
  font-weight: 600;
}

/* Grid */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-grid);
}
.calc-card {
  position: relative;
  display: flex; flex-direction: column;
  text-align: left;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 22px;
  overflow: hidden;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
  min-height: 232px;
}
/* category accent bar on the left */
.calc-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cat, var(--accent));
  opacity: 0.5;
  transition: opacity .22s, width .22s;
}
.calc-card:hover {
  border-color: var(--cat, var(--accent));
  transform: translateY(-3px);
  box-shadow: 0 20px 44px -22px var(--cat, var(--accent-glow));
}
.calc-card:hover::before { opacity: 1; width: 4px; }
.calc-card:hover .calc-card-icon {
  color: oklch(16% 0.02 240);
  background: var(--cat, var(--accent));
  border-color: var(--cat, var(--accent));
  box-shadow: 0 0 18px -2px var(--cat, var(--accent-glow));
}
.calc-card-glow {
  position: absolute; inset: 0;
  background: radial-gradient(70% 55% at 100% 0%, var(--cat-soft, var(--accent-soft)), transparent 72%);
  opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.calc-card:hover .calc-card-glow { opacity: 1; }

.calc-card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.calc-card-icon {
  width: 46px; height: 46px;
  border-radius: var(--r-3);
  border: 1px solid var(--border-2);
  display: grid; place-items: center;
  color: var(--cat, var(--accent));
  background: var(--cat-soft, var(--accent-soft));
  transition: all .22s;
}
.calc-card-tag {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-2);
  background: var(--bg-0);
}
.calc-card-body { flex: 1; }
.calc-card-body h4 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--fg);
}
.calc-card-body p {
  font-size: 13px;
  color: var(--fg-dim);
  margin: 0;
  line-height: 1.55;
  text-wrap: pretty;
}
.calc-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  gap: 12px;
}
.calc-card-norm {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.calc-card-cta {
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cat, var(--accent));
  opacity: 0.65;
  transition: all .22s;
}
.calc-card:hover .calc-card-cta { opacity: 1; gap: 9px; }

/* Empty state */
.catalog-empty {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 56px 32px;
  gap: 8px;
  border: 1px dashed var(--border-2);
  border-radius: var(--r-3);
}
.catalog-empty-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-2);
  color: var(--fg-mute);
  border: 1px solid var(--border-2);
  margin-bottom: 6px;
}
.catalog-empty h4 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 17px;
  margin: 0;
  color: var(--fg);
}
.catalog-empty p {
  font-size: 13px;
  color: var(--fg-mute);
  margin: 0;
}

/* ===========================================================
   ELETRODUTO CALCULATOR
=========================================================== */
.eletroduto { display: flex; flex-direction: column; gap: var(--gap-grid); }
.el-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--gap-grid);
  align-items: start;
}

/* Inputs */
.form-row {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}
.form-row-2 { grid-template-columns: 1fr 1fr; }

.field-block { display: flex; flex-direction: column; gap: 10px; }
.field-block > label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--fg-mute);
  text-transform: uppercase;
}

.seg {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--bg-0);
  padding: 4px;
  gap: 2px;
}
.seg button {
  flex: 1;
  padding: 9px 10px;
  font-size: 12px;
  color: var(--fg-mute);
  border-radius: 6px;
  transition: all .15s;
}
.seg button:hover { color: var(--fg-dim); }
.seg button.is-active {
  background: var(--bg-2);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--border-2);
}

/* Conductor table */
.cond-table {
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
  margin-bottom: 18px;
}
.ct-head, .ct-row {
  display: grid;
  grid-template-columns: 36px 1.2fr 1.2fr 1fr 1fr 32px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}
.ct-head {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  text-transform: uppercase;
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
}
.ct-row {
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.ct-row:last-of-type { border-bottom: 0; }
.ct-row select {
  width: 100%; padding: 8px 10px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.ct-row select:focus { border-color: var(--accent); }
.qty {
  display: flex; align-items: center; gap: 6px;
}
.qty button {
  width: 26px; height: 26px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-0);
  color: var(--fg-dim);
  display: grid; place-items: center;
  font-size: 14px;
}
.qty button:hover { color: var(--accent); border-color: var(--accent); }
.qty .mono { min-width: 24px; text-align: center; font-size: 13px; }
.ct-remove {
  width: 24px; height: 24px;
  border-radius: 50%;
  color: var(--fg-mute);
  font-size: 18px;
  line-height: 1;
  display: grid; place-items: center;
}
.ct-remove:hover { background: oklch(70% 0.20 25 / 0.15); color: var(--danger); }
.ct-add {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px;
  font-size: 12px;
  color: var(--fg-dim);
  border-top: 1px dashed var(--border-2);
  background: oklch(15% 0.012 240 / 0.4);
  transition: all .15s;
}
.ct-add:hover { color: var(--accent); background: var(--accent-soft); }

/* Summary */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
}
.summary-grid > div {
  background: var(--bg-0);
  padding: 16px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.summary-grid span {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.summary-grid b {
  font-family: var(--ff-mono);
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--fg);
  font-weight: 500;
}
.summary-grid em {
  font-style: normal;
  font-size: 11px;
  color: var(--fg-mute);
  margin-left: 4px;
}

/* RESULT panel */
.el-result {
  background: linear-gradient(180deg, oklch(18% 0.02 245 / 0.6), oklch(15% 0.012 240));
  position: sticky;
  top: 0;
}
.result-hero {
  position: relative;
  border: 1px solid var(--accent);
  border-radius: var(--r-3);
  padding: 28px 24px 22px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 50%, var(--accent-soft) 100%), var(--bg-0);
  text-align: center;
  overflow: hidden;
}
.result-corner { position: absolute; width: 14px; height: 14px; border-color: var(--accent); }
.result-corner-tl { top: 6px; left: 6px; border-top: 1.5px solid; border-left: 1.5px solid; }
.result-corner-tr { top: 6px; right: 6px; border-top: 1.5px solid; border-right: 1.5px solid; }
.result-corner-bl { bottom: 6px; left: 6px; border-bottom: 1.5px solid; border-left: 1.5px solid; }
.result-corner-br { bottom: 6px; right: 6px; border-bottom: 1.5px solid; border-right: 1.5px solid; }

.result-eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.result-value {
  display: inline-flex; align-items: baseline; gap: 6px;
  margin-bottom: 6px;
}
.result-value .readout {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 62px;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1;
  text-shadow: 0 0 28px var(--accent-glow);
}
.result-value em {
  font-style: normal;
  font-family: var(--ff-mono);
  font-size: 14px;
  color: var(--accent);
}
.result-meta {
  display: flex; justify-content: center; gap: 18px;
  margin: 12px 0 22px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.result-meta b { color: var(--fg); font-weight: 500; }

.conduit-svg {
  width: 220px; height: 220px;
  margin: 0 auto 18px;
  display: block;
}

.result-bar { padding: 0 6px 4px; }
.result-bar-track {
  position: relative;
  height: 6px;
  background: var(--bg-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-bottom: 8px;
}
.bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: var(--r-pill);
  transition: width .4s ease;
}
.bar-ok { background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.bar-warn { background: var(--warn); box-shadow: 0 0 12px oklch(80% 0.18 75 / 0.5); }
.bar-limit {
  position: absolute; top: -2px; bottom: -2px;
  width: 1.5px;
  background: var(--fg);
  opacity: 0.8;
}
.result-bar-meta {
  display: flex; justify-content: space-between;
  font-size: 11px;
  font-family: var(--ff-mono);
  letter-spacing: 0.05em;
}
.result-bar-meta .readout { font-size: 13px; color: var(--fg); }

.result-status {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.result-status.status-ok {
  background: oklch(80% 0.16 150 / 0.1);
  color: var(--ok);
  border: 1px solid oklch(80% 0.16 150 / 0.3);
}
.result-status.status-ok .status-dot { background: var(--ok); box-shadow: 0 0 8px oklch(80% 0.18 150 / 0.6); }
.result-status.status-warn {
  background: oklch(80% 0.16 75 / 0.1);
  color: var(--warn);
  border: 1px solid oklch(80% 0.16 75 / 0.3);
}
.result-status.status-warn .status-dot { background: var(--warn); box-shadow: 0 0 8px oklch(80% 0.18 75 / 0.6); }

.result-actions {
  display: flex; gap: 10px;
  margin-top: 18px;
}
.result-actions .btn { flex: 1; justify-content: center; }

/* Reference table */
.ref-table {
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
}
.ref-head, .ref-row {
  display: grid;
  grid-template-columns: 90px 1fr 1fr 100px 1.4fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.ref-head {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  text-transform: uppercase;
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
}
.ref-row {
  font-size: 13px;
  border-bottom: 1px solid oklch(28% 0.012 240 / 0.5);
  transition: background .15s;
}
.ref-row:last-child { border-bottom: 0; }
.ref-row.is-sel {
  background: var(--accent-soft);
  position: relative;
}
.ref-row.is-sel::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--accent);
}
.ref-util {
  display: flex; align-items: center; gap: 10px;
}
.util-bar {
  flex: 1; height: 4px;
  background: var(--bg-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.util-bar > span {
  display: block; height: 100%;
  background: var(--accent);
  transition: width .3s;
}
.ref-util .mono { font-size: 11px; min-width: 36px; text-align: right; color: var(--fg-dim); }

/* ===========================================================
   PLACEHOLDER VIEW
=========================================================== */
.placeholder-panel {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 60px 40px;
  gap: 12px;
}
.ph-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  border: 1px solid oklch(72% 0.18 245 / 0.3);
  margin-bottom: 6px;
  box-shadow: 0 0 30px var(--accent-glow);
}
.placeholder-panel h3 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 22px;
  margin: 0;
}
.placeholder-panel p {
  max-width: 460px;
  color: var(--fg-dim);
  margin: 0;
}

/* ===========================================================
   VL CALC MODULES (Corrente, Queda, Dimensionamento)
=========================================================== */
.vl-field { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.vl-field-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.vl-field-hint {
  font-size: 10px;
  color: var(--fg-faint);
  text-transform: none;
  letter-spacing: 0;
}
.vl-input {
  display: flex; align-items: center;
  padding: 0 14px;
  height: 44px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  transition: all .18s;
}
.vl-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.vl-input select {
  flex: 1; height: 100%;
  font-size: 14px;
  font-family: var(--ff-mono);
  color: var(--fg);
  background: transparent;
  border: 0; outline: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 18px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 9px) 50%, calc(100% - 5px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  background-color: transparent;
  color: var(--fg);
}
.vl-input select option { background: var(--bg-1); color: var(--fg); }
.vl-input input {
  flex: 1; height: 100%;
  font-size: 14px;
  font-family: var(--ff-mono);
  color: var(--fg);
  background: transparent;
  border: 0; outline: 0;
}
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.06em;
  padding-left: 8px;
  border-left: 1px solid var(--border-2);
  margin-left: 8px;
}

.vl-quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 24px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
}
.vl-quick-stats > div {
  background: var(--bg-0);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.vl-quick-stats span {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.vl-quick-stats b {
  font-family: var(--ff-mono);
  font-size: 15px;
  color: var(--fg);
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* VL result-big — used by Corrente & Queda & Dim */
.vl-result-big {
  position: relative;
  border: 1px solid var(--accent);
  border-radius: var(--r-3);
  padding: 32px 24px 26px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 50%, var(--accent-soft) 100%), var(--bg-0);
  text-align: center;
  overflow: hidden;
  margin-bottom: 18px;
}
.vl-result-corner { position: absolute; width: 14px; height: 14px; border-color: var(--accent); }
.vl-result-corner-tl { top: 6px; left: 6px; border-top: 1.5px solid; border-left: 1.5px solid; }
.vl-result-corner-tr { top: 6px; right: 6px; border-top: 1.5px solid; border-right: 1.5px solid; }
.vl-result-corner-bl { bottom: 6px; left: 6px; border-bottom: 1.5px solid; border-left: 1.5px solid; }
.vl-result-corner-br { bottom: 6px; right: 6px; border-bottom: 1.5px solid; border-right: 1.5px solid; }
.vl-result-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.vl-result-row {
  display: inline-flex; align-items: baseline; gap: 6px;
}
.vl-result-val {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 64px;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1;
  text-shadow: 0 0 28px var(--accent-glow);
}
.vl-result-row em {
  font-style: normal;
  font-family: var(--ff-mono);
  font-size: 14px;
  color: var(--accent);
}
.vl-result-warn { border-color: var(--warn); }
.vl-result-warn .vl-result-corner { border-color: var(--warn); }
.vl-result-warn .vl-result-label { color: var(--warn); }
.vl-result-warn .vl-result-val { text-shadow: 0 0 28px oklch(80% 0.18 75 / 0.5); }
.vl-result-danger { border-color: var(--danger); }
.vl-result-danger .vl-result-corner { border-color: var(--danger); }
.vl-result-danger .vl-result-label { color: var(--danger); }
.vl-result-danger .vl-result-val { text-shadow: 0 0 28px oklch(70% 0.20 25 / 0.5); }

/* mini metric */
.vl-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
  margin-bottom: 18px;
}
.vl-metric {
  background: var(--bg-0);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.vl-metric-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.vl-metric-value {
  display: flex; align-items: baseline; gap: 4px;
}
.vl-metric-value .readout {
  font-family: var(--ff-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.vl-metric-value em {
  font-style: normal;
  font-size: 11px;
  color: var(--fg-mute);
}
.vl-metric.vl-metric-ok .readout { color: var(--ok); }
.vl-metric.vl-metric-warn .readout { color: var(--warn); }
.vl-metric.vl-metric-danger .readout { color: var(--danger); }

/* banner */
.vl-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-2);
  font-size: 12px;
  margin-bottom: 18px;
  border: 1px solid;
}
.vl-banner-ok    { color: var(--ok);    background: oklch(80% 0.16 150 / 0.08); border-color: oklch(80% 0.16 150 / 0.3); }
.vl-banner-warn  { color: var(--warn);  background: oklch(80% 0.16 75 / 0.08);  border-color: oklch(80% 0.16 75 / 0.3); }
.vl-banner-danger{ color: var(--danger);background: oklch(70% 0.20 25 / 0.08);  border-color: oklch(70% 0.20 25 / 0.3); }
.vl-banner-info  { color: var(--accent);background: var(--accent-soft);         border-color: oklch(72% 0.18 245 / 0.3); }

/* memory */
.vl-memory {
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-2);
}
.vl-memory-eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--fg-mute);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.vl-mem-step {
  display: flex; gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid oklch(28% 0.012 240 / 0.4);
}
.vl-mem-step:last-child { border-bottom: 0; }
.vl-mem-step-head {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 64px;
}
.vl-mem-step-n {
  font-family: var(--ff-mono);
  font-size: 18px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.vl-mem-step-title {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.vl-mem-step-body {
  flex: 1;
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.6;
  font-family: var(--ff-body);
}
.vl-mem-step-body.is-formula {
  font-family: var(--ff-mono);
  font-size: 15px;
  color: var(--fg);
  padding: 12px 14px;
  background: var(--bg-0);
  border-radius: var(--r-2);
  border-left: 2px solid var(--accent);
  letter-spacing: 0.01em;
}
.vl-mem-step-body .readout {
  font-family: var(--ff-mono);
  color: var(--fg);
  font-weight: 500;
}

/* bar (for queda) */
.vl-bar-wrap {
  padding: 0 4px 4px;
  margin-bottom: 12px;
}
.vl-bar-track {
  position: relative;
  height: 6px;
  background: var(--bg-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-bottom: 8px;
}
.vl-bar-track .bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: var(--r-pill);
  transition: width .4s ease;
}
.vl-bar-track .bar-limit {
  position: absolute; top: -2px; bottom: -2px;
  width: 1.5px;
  background: var(--fg);
  opacity: 0.8;
}

/* info card variant for limit display */
.vl-info-card {
  height: 50px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.vl-info-card .readout {
  font-family: var(--ff-mono);
  font-size: 24px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.vl-info-card em {
  font-style: normal;
  font-size: 11px;
  color: var(--fg-mute);
  line-height: 1.4;
}

/* taxa de ocupação — update for new fields */
.ct-head, .ct-row {
  grid-template-columns: 36px 1.1fr 1fr 1.2fr 1.4fr 32px !important;
}
/* Custom dropdown for ct-row (taxa de ocupação) — replaces native <select> visual */
.vl-dd {
  position: relative;
  width: 100%;
}
.vl-dd-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 8px 10px 8px 12px;
  background: var(--bg-0);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--ff-mono);
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  gap: 6px;
}
.vl-dd-trigger:hover { border-color: var(--border-2); }
.vl-dd.is-open .vl-dd-trigger { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.vl-dd-chev {
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--fg-mute);
  border-bottom: 1.5px solid var(--fg-mute);
  transform: translateY(-2px) rotate(45deg);
  transition: transform .15s;
}
.vl-dd.is-open .vl-dd-chev { transform: translateY(2px) rotate(-135deg); }
.vl-dd-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 4px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 12px 28px -10px oklch(8% 0.01 240 / 0.7);
}
.vl-dd-opt {
  padding: 7px 10px;
  font-size: 12px;
  font-family: var(--ff-mono);
  color: var(--fg-dim);
  border-radius: 4px;
  cursor: pointer;
  transition: all .12s;
}
.vl-dd-opt:hover { background: var(--bg-2); color: var(--fg); }
.vl-dd-opt.is-sel { background: var(--accent-soft); color: var(--accent); }

/* ===========================================================
   FP / CAPACITOR module
=========================================================== */
.vl-fp-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
  padding: 22px 18px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
}
.vl-fp-side { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vl-fp-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.vl-fp-meter { position: relative; width: 96px; height: 96px; }
.vl-fp-dial { width: 100%; height: 100%; }
.vl-fp-val {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  font-family: var(--ff-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.vl-fp-arrow {
  font-family: var(--ff-mono);
  font-size: 28px;
  color: var(--accent);
  font-weight: 300;
}
.vl-mini-grid-3 { grid-template-columns: repeat(3, 1fr); }

.vl-cap-suggestion {
  margin: 8px 0 18px;
  padding: 18px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.vl-cap-eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.vl-cap-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  justify-content: space-between;
}
.vl-cap-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.vl-cap-step {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--accent);
  border-radius: var(--r-2);
  min-width: 70px;
  box-shadow: 0 0 16px var(--accent-glow);
}
.vl-cap-step-icon { color: var(--accent); margin-bottom: 4px; }
.vl-cap-step .readout {
  font-family: var(--ff-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.vl-cap-step em {
  font-style: normal;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.vl-cap-formula {
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--ff-mono);
  font-size: 13px;
  color: var(--fg-dim);
  text-align: right;
}
.vl-cap-formula b {
  font-size: 22px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.vl-cap-formula em {
  font-style: normal;
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.06em;
}

.vl-fp-table {
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
}
.vl-fp-tr {
  display: grid;
  grid-template-columns: 1.4fr 80px 1fr 1fr 1fr;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid oklch(28% 0.012 240 / 0.5);
  font-size: 13px;
}
.vl-fp-tr:last-child { border-bottom: 0; }
.vl-fp-th {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  text-transform: uppercase;
  background: var(--bg-0);
}
.vl-fp-after {
  background: var(--accent-soft);
  padding: 6px 10px;
  border-radius: 4px;
}
.vl-fp-after b { color: var(--fg); font-weight: 500; }
.vl-fp-good { color: var(--ok); }

/* ===========================================================
   QUADROS & DIAGRAMAS
=========================================================== */
.vl-quadros { display: flex; flex-direction: column; gap: var(--gap-grid); }
.vl-quadros-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--gap-grid);
  align-items: start;
}

/* Stats strip on top of canvas */
.vl-quadros-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-bottom: 18px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
}
.vl-quadros-stats > div {
  background: var(--bg-0);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.vl-quadros-stats span {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.vl-quadros-stats b {
  font-family: var(--ff-mono);
  font-size: 17px;
  color: var(--fg);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.vl-quadros-stats em {
  font-style: normal;
  font-size: 11px;
  color: var(--fg-mute);
  margin-left: 4px;
}

/* Canvas grid */
.vl-canvas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.vl-canvas-empty {
  padding: 64px 40px;
  text-align: center;
  border: 1px dashed var(--border-2);
  border-radius: var(--r-3);
}
.vl-canvas-empty-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  margin: 0 auto 16px;
  border: 1px solid oklch(72% 0.18 245 / 0.3);
}
.vl-canvas-empty h4 {
  font-family: var(--ff-display);
  font-size: 18px;
  margin: 0 0 6px;
  color: var(--fg);
}
.vl-canvas-empty p {
  font-size: 13px;
  color: var(--fg-dim);
  margin: 0;
  max-width: 320px;
  margin-inline: auto;
}

.vl-canvas-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  min-height: 200px;
  background: transparent;
  border: 1.5px dashed var(--border-2);
  border-radius: var(--r-3);
  color: var(--fg-mute);
  font-size: 13px;
  font-family: var(--ff-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all .2s;
}
.vl-canvas-add:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Motor card */
.vl-motor-card {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-3);
  padding: 14px;
  cursor: pointer;
  transition: all .2s ease;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 200px;
}
.vl-motor-card:hover { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg-1) 100%); }
.vl-motor-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 16px 40px -16px var(--accent-glow);
}
.vl-motor-card.is-empty { border-style: dashed; }

.vl-motor-card-head {
  display: flex; justify-content: space-between; align-items: center;
}
.vl-motor-card-id { display: flex; align-items: center; gap: 8px; }
.vl-motor-card-num {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
}
.vl-pill-mini {
  font-family: var(--ff-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--fg-mute);
}
.vl-pill-mini.is-ok { color: var(--ok); border-color: oklch(80% 0.16 150 / 0.3); background: oklch(80% 0.16 150 / 0.08); }
.vl-pill-mini.is-warn { color: var(--warn); border-color: oklch(80% 0.16 75 / 0.3); background: oklch(80% 0.16 75 / 0.08); }

.vl-motor-card-del {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--fg-mute);
  transition: all .15s;
}
.vl-motor-card-del:hover { color: var(--danger); background: oklch(70% 0.20 25 / 0.12); }

.vl-quadro-svg {
  width: 100%;
  height: auto;
  display: block;
}

.vl-motor-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  text-align: center;
}
.vl-motor-empty-icon {
  color: var(--fg-mute);
  opacity: 0.5;
}
.vl-motor-empty-text {
  font-size: 12px;
  color: var(--fg-mute);
  max-width: 220px;
}

/* CONFIG PANEL (right) */
.vl-config-panel {
  position: sticky;
  top: 0;
  align-self: start;
}
.vl-config-empty {
  padding: 40px 20px;
  text-align: center;
}
.vl-config-empty-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg-0);
  color: var(--fg-mute);
  display: grid; place-items: center;
  border: 1px solid var(--border);
  margin: 0 auto 14px;
}
.vl-config-empty h4 {
  font-family: var(--ff-display);
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--fg);
}
.vl-config-empty p {
  font-size: 12px;
  color: var(--fg-mute);
  margin: 0;
  line-height: 1.5;
}

.vl-config-eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.vl-config-head h3 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin: 0;
}
.vl-config-body {
  margin-top: 20px;
  display: flex; flex-direction: column; gap: 6px;
}

.seg-stack {
  flex-direction: column;
  padding: 6px;
  gap: 4px;
}
.seg-stack button {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 12px 14px;
  gap: 2px;
  text-align: left;
}
.seg-stack button b {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-dim);
  font-family: var(--ff-body);
}
.seg-stack button em {
  font-style: normal;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
}
.seg-stack button.is-active b { color: var(--fg); }
.seg-stack button.is-active em { color: var(--accent); }

.vl-stat-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 8px 0 16px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
}
.vl-stat-strip > div {
  background: var(--bg-0);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.vl-stat-strip span {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.vl-stat-strip b {
  font-family: var(--ff-mono);
  font-size: 14px;
  color: var(--fg);
  font-weight: 500;
}
.vl-stat-strip em {
  font-style: normal;
  font-size: 10px;
  color: var(--fg-mute);
  margin-left: 3px;
}

.vl-comp-list {
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
  margin-bottom: 14px;
}
.vl-comp-list-head {
  padding: 10px 14px;
  background: var(--bg-0);
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--fg-mute);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.vl-comp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid oklch(28% 0.012 240 / 0.5);
}
.vl-comp-row:last-child { border-bottom: 0; }
.vl-comp-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--r-2);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid oklch(72% 0.18 245 / 0.25);
  flex: 0 0 28px;
}
.vl-comp-meta { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.vl-comp-tag {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.vl-comp-type {
  font-size: 11px;
  color: var(--fg-mute);
}
.vl-comp-code {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--fg);
  letter-spacing: 0.01em;
  background: var(--bg-0);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ref table for motors */
.vl-motor-ref .ref-head,
.vl-motor-ref .ref-row {
  grid-template-columns: 90px 1fr 1fr 1.2fr 1.2fr;
}

/* ===========================================================
   PROJETO COMPARTILHADO — sync rows + barra global + toast
=========================================================== */
.vl-psync {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin: 4px 0 18px;
  padding: 10px 12px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.vl-psync-head { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.vl-psync-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.12em;
  color: var(--accent); text-transform: uppercase; flex-shrink: 0;
}
.vl-psync-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.vl-psync-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; color: var(--fg-mute);
  padding: 2px 8px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--bg-1);
  font-family: var(--ff-mono);
}
.vl-psync-chip.is-on { color: var(--fg-dim); border-color: var(--border-2); }
.vl-psync-chip b { color: var(--accent); font-weight: 600; }
.vl-psync-btns { display: flex; gap: 6px; flex-shrink: 0; }
.vl-psync-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; font-size: 11px; font-weight: 500;
  border-radius: var(--r-2); border: 1px solid var(--border-2);
  background: var(--bg-2); color: var(--fg-dim);
  transition: all .15s;
}
.vl-psync-btn:hover:not(:disabled) { color: var(--fg); border-color: var(--border-3); background: var(--bg-3); }
.vl-psync-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.vl-psync-btn.is-push {
  background: var(--accent-soft); border-color: oklch(72% 0.18 245 / 0.4); color: var(--accent);
}
.vl-psync-btn.is-push:hover { background: oklch(72% 0.18 245 / 0.2); }

/* Barra global */
.vl-projbar { position: fixed; right: 22px; bottom: 22px; z-index: 9990; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.vl-projbar-fab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--r-pill);
  background: var(--bg-2); border: 1px solid var(--border-2);
  color: var(--fg-dim); font-size: 12px; font-weight: 500;
  box-shadow: 0 10px 30px -12px oklch(8% 0.01 240 / 0.8);
  transition: all .16s;
}
.vl-projbar-fab:hover { color: var(--fg); border-color: var(--accent); }
.vl-projbar-count {
  font-family: var(--ff-mono); font-size: 10px; font-weight: 700;
  background: var(--accent); color: oklch(16% 0.02 240);
  border-radius: var(--r-pill); padding: 1px 7px; min-width: 18px; text-align: center;
}
.vl-projbar-fab-chev { display: inline-flex; color: var(--fg-mute); transition: transform .2s; }
.vl-projbar.is-open .vl-projbar-fab-chev { transform: rotate(180deg); }

.vl-projbar-panel {
  width: 300px;
  background: var(--bg-1); border: 1px solid var(--border-2);
  border-radius: var(--r-3); overflow: hidden;
  box-shadow: 0 24px 60px -20px oklch(8% 0.01 240 / 0.85);
  animation: fadeUp .2s ease;
}
.vl-projbar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.vl-projbar-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--accent); text-transform: uppercase;
}
.vl-projbar-head-actions { display: flex; gap: 4px; }
.vl-projbar-clear, .vl-projbar-close {
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 6px; color: var(--fg-mute); transition: all .15s;
}
.vl-projbar-clear:hover { color: var(--danger); background: oklch(70% 0.20 25 / 0.12); }
.vl-projbar-close:hover { color: var(--fg); background: var(--bg-3); }
.vl-projbar-body { padding: 8px; max-height: 320px; overflow-y: auto; }
.vl-projbar-empty { padding: 18px 12px; font-size: 12px; color: var(--fg-mute); line-height: 1.6; text-align: center; }
.vl-projbar-empty b { color: var(--accent); }
.vl-projbar-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border-radius: var(--r-2);
}
.vl-projbar-row:hover { background: var(--bg-2); }
.vl-projbar-ic {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid oklch(72% 0.18 245 / 0.25);
}
.vl-projbar-meta { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.vl-projbar-label { font-size: 12px; color: var(--fg); font-weight: 500; }
.vl-projbar-src { font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.06em; color: var(--fg-mute); }
.vl-projbar-val { font-size: 14px; color: var(--accent); font-weight: 600; flex-shrink: 0; }
.vl-projbar-val em { font-style: normal; font-size: 10px; color: var(--fg-mute); }
.vl-projbar-del {
  width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 5px; color: var(--fg-faint); flex-shrink: 0; transition: all .15s;
}
.vl-projbar-del:hover { color: var(--danger); background: oklch(70% 0.20 25 / 0.12); }

/* Toast */
.vl-proj-toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(8px);
  z-index: 9999; background: var(--accent); color: oklch(16% 0.02 240);
  padding: 9px 18px; border-radius: var(--r-2);
  font-family: var(--ff-mono); font-size: 12px; font-weight: 500;
  box-shadow: 0 8px 28px -8px var(--accent-glow);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.vl-proj-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===========================================================
   CÁLCULO DE DEMANDA
=========================================================== */
.vl-dem-table {
  margin: 6px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
}
.vl-dem-row {
  display: grid;
  grid-template-columns: minmax(0,1.7fr) 92px 88px 78px 92px 28px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.vl-dem-row:last-child { border-bottom: 0; }
.vl-dem-head {
  background: var(--bg-0);
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.vl-dem-head > span { text-align: center; }
.vl-dem-head > span:first-child { text-align: left; }

.vl-dem-carga { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vl-dem-ic {
  width: 28px; height: 28px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 7px;
  border: 1px solid var(--border-2);
}
.vl-dem-carga-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.vl-dem-desc {
  background: transparent; border: 0; outline: 0;
  font-size: 13px; color: var(--fg); font-weight: 500;
  padding: 2px 0; border-bottom: 1px solid transparent;
  font-family: var(--ff-body);
}
.vl-dem-desc:focus { border-bottom-color: var(--accent); }
.vl-dem-carga-meta .vl-dd-trigger { padding: 4px 8px; font-size: 11px; }

.vl-dem-cell {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  position: relative;
}
.vl-dem-cell > input {
  width: 100%; text-align: center;
  background: var(--bg-0); border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 4px;
  font-family: var(--ff-mono); font-size: 12px; color: var(--fg);
  outline: 0; transition: border-color .15s;
}
.vl-dem-cell > input:focus { border-color: var(--accent); }
.vl-dem-cell > em { font-style: normal; font-size: 10px; color: var(--fg-mute); flex-shrink: 0; }
.vl-dem-auto {
  position: absolute; right: 3px; top: -7px;
  font-family: var(--ff-mono); font-size: 7px; letter-spacing: 0.06em;
  color: var(--accent); background: var(--accent-soft);
  padding: 1px 4px; border-radius: 3px; text-transform: uppercase;
}
.vl-dem-qty { gap: 5px; }
.vl-dem-qty button {
  width: 22px; height: 22px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg-0); color: var(--fg-dim); font-size: 13px;
  display: grid; place-items: center; transition: all .15s;
}
.vl-dem-qty button:hover { color: var(--accent); border-color: var(--accent); }
.vl-dem-qty .mono { min-width: 22px; text-align: center; font-size: 12px; }
.vl-dem-demval { font-weight: 600; color: var(--fg); }
.vl-dem-demval em { font-style: normal; font-size: 10px; color: var(--fg-mute); }
.vl-dem-del {
  width: 24px; height: 24px; border-radius: 50%;
  color: var(--fg-mute); font-size: 17px; line-height: 1;
  display: grid; place-items: center; transition: all .15s;
}
.vl-dem-del:hover { color: var(--danger); background: oklch(70% 0.20 25 / 0.12); }

.vl-dem-add-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.vl-dem-add {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; font-size: 11px; font-weight: 500;
  border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--bg-1);
  color: var(--fg-dim); transition: all .15s;
}
.vl-dem-add:hover { color: var(--c); border-color: var(--c); background: var(--cs); }
.vl-dem-add svg { color: var(--c); }

.vl-dem-toolbar { display: flex; gap: 8px; }
.vl-dem-toolbar .btn { flex: 1; justify-content: center; }

/* gauge */
.vl-dem-gauge {
  margin: 16px 0;
  padding: 14px 16px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.vl-dem-gauge-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--fg-dim); margin-bottom: 8px; }
.vl-dem-gauge-top b { font-size: 18px; color: var(--accent); font-weight: 600; }
.vl-dem-gauge-track { height: 8px; background: var(--bg-3); border-radius: var(--r-pill); overflow: hidden; }
.vl-dem-gauge-track > span { display: block; height: 100%; background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); border-radius: var(--r-pill); transition: width .4s ease; }
.vl-dem-gauge-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--fg-mute); }
.vl-dem-gauge-foot b { color: var(--fg-dim); }

/* breakdown */
.vl-dem-breakdown { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border-2); }
.vl-dem-bk-row { margin-bottom: 12px; }
.vl-dem-bk-row:last-child { margin-bottom: 0; }
.vl-dem-bk-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 6px; }
.vl-dem-bk-label { display: inline-flex; align-items: center; gap: 7px; color: var(--fg-dim); }
.vl-dem-bk-label i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.vl-dem-bk-head .mono { font-size: 11px; color: var(--fg-mute); }
.vl-dem-bk-track { height: 6px; background: var(--bg-3); border-radius: var(--r-pill); overflow: hidden; }
.vl-dem-bk-track > span { display: block; height: 100%; border-radius: var(--r-pill); transition: width .4s ease; }

.vl-dem-ref .ref-head, .vl-dem-ref .ref-row { grid-template-columns: 1.6fr 0.8fr 0.8fr 1.6fr; }

@media (max-width: 1180px) {
  .vl-dem-row { grid-template-columns: minmax(0,1.5fr) 80px 78px 70px 80px 26px; }
}

/* ===========================================================
   QUADRO DE MOTORES
=========================================================== */
.vl-mot-table {
  margin: 8px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
}
.vl-mot-row {
  display: grid;
  grid-template-columns: minmax(0,1.7fr) 52px 90px 72px 96px 28px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .14s;
}
.vl-mot-row:last-child { border-bottom: 0; }
.vl-mot-row:not(.vl-mot-head):hover { background: var(--bg-2); }
.vl-mot-row.is-sel { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.vl-mot-head {
  background: var(--bg-0); cursor: default;
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.1em;
  color: var(--fg-mute); text-transform: uppercase;
}
.vl-mot-head > span { text-align: center; }
.vl-mot-head > span:first-child { text-align: left; }
.vl-mot-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.vl-mot-ic {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid oklch(72% 0.18 245 / 0.25);
}
.vl-mot-name-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.vl-mot-name-meta b { font-size: 13px; color: var(--fg); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-mot-name-meta em { font-style: normal; font-size: 10px; color: var(--fg-mute); font-family: var(--ff-mono); }
.vl-mot-cv { text-align: center; font-size: 13px; color: var(--fg); font-weight: 600; }
.vl-mot-part {
  text-align: center; font-family: var(--ff-mono); font-size: 10px;
  letter-spacing: 0.04em; color: var(--fg-dim);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 3px 4px;
}
.vl-mot-in { text-align: center; font-size: 13px; color: var(--accent); font-weight: 600; }
.vl-mot-cabo { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.vl-mot-cabo b { font-size: 14px; color: var(--fg); }
.vl-mot-cabo em { font-style: normal; font-size: 9px; color: var(--fg-mute); font-family: var(--ff-mono); }
.vl-mot-del {
  width: 24px; height: 24px; border-radius: 50%;
  color: var(--fg-mute); font-size: 17px; line-height: 1;
  display: grid; place-items: center; transition: all .15s;
}
.vl-mot-del:hover { color: var(--danger); background: oklch(70% 0.20 25 / 0.12); }

.vl-mot-toolbar { display: flex; gap: 8px; }
.vl-mot-toolbar .btn { flex: 1; justify-content: center; }
.vl-mot-edit { display: flex; flex-direction: column; gap: 14px; }
.vl-mot-edit .vl-field { margin-bottom: 0; }
.vl-mot-edit .form-row { margin-bottom: 0; }

.vl-mot-fp-ref .ref-head, .vl-mot-fp-ref .ref-row { grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; }
.vl-mot-cabo-ref .ref-head, .vl-mot-cabo-ref .ref-row { grid-template-columns: 1.2fr 1fr 1fr 1fr; }

@media (max-width: 1180px) {
  .vl-mot-row { grid-template-columns: minmax(0,1.5fr) 44px 76px 60px 84px 26px; gap: 7px; }
}

/* ===========================================================
   ILUMINAÇÃO — layout repaginado
=========================================================== */
.il-mod { display: flex; flex-direction: column; gap: 18px; }

/* abas */
.il-tabs {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.il-tabs-seg {
  display: inline-flex; gap: 4px;
  padding: 4px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}
.il-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--fg-mute);
  border-radius: var(--r-pill);
  transition: all .16s;
}
.il-tab:hover { color: var(--fg-dim); }
.il-tab.is-active {
  color: oklch(16% 0.02 240);
  background: var(--accent);
  box-shadow: 0 4px 14px -4px var(--accent-glow);
}
.il-tabs-meta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--fg-mute);
  font-family: var(--ff-mono); letter-spacing: 0.04em;
}
.il-tabs-meta b { color: var(--fg); font-weight: 600; margin-right: 2px; }
.il-dot-sep { color: var(--fg-faint); }

/* trilho horizontal de ambientes */
.il-rail {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 14px;
}
.il-rail-track {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.il-rail-track::-webkit-scrollbar { height: 6px; }
.il-rail-track::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

.il-amb-card {
  flex: 0 0 168px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 12px 14px;
  cursor: pointer;
  transition: all .18s ease;
  position: relative;
}
.il-amb-card:hover { border-color: var(--border-3); transform: translateY(-2px); }
.il-amb-card.is-selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--bg-0) 70%);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 28px -16px var(--accent-glow);
}
.il-amb-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.il-amb-ic {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--bg-2); color: var(--fg-mute);
  display: grid; place-items: center;
  border: 1px solid var(--border-2);
  transition: all .18s;
}
.il-amb-card.is-selected .il-amb-ic { background: var(--accent-soft); color: var(--accent); border-color: oklch(72% 0.18 245 / 0.4); }
.il-amb-status { width: 8px; height: 8px; border-radius: 50%; }
.il-amb-status.is-ok { background: var(--ok); box-shadow: 0 0 8px oklch(80% 0.18 150 / 0.5); }
.il-amb-status.is-warn { background: var(--warn); box-shadow: 0 0 8px oklch(80% 0.18 75 / 0.5); }
.il-amb-del {
  margin-left: auto;
  width: 24px; height: 24px; border-radius: 6px;
  color: var(--fg-faint);
  display: grid; place-items: center;
  transition: all .15s;
}
.il-amb-del:hover { color: var(--danger); background: oklch(70% 0.20 25 / 0.12); }
.il-amb-name {
  font-size: 13px; font-weight: 600; color: var(--fg);
  line-height: 1.3; margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.il-amb-stats { display: flex; gap: 10px; }
.il-amb-stats span {
  font-size: 10px; color: var(--fg-mute);
  font-family: var(--ff-mono); letter-spacing: 0.02em;
  display: flex; flex-direction: column; gap: 1px;
}
.il-amb-stats b { font-size: 14px; color: var(--fg); font-weight: 600; }
.il-amb-empty { font-size: 11px; color: var(--fg-faint); }

.il-add-card {
  flex: 0 0 120px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1.5px dashed var(--border-2);
  border-radius: var(--r-2);
  color: var(--fg-mute);
  font-size: 11px; line-height: 1.3; text-align: center;
  font-family: var(--ff-mono); letter-spacing: 0.04em;
  transition: all .18s;
}
.il-add-card:hover {
  color: var(--accent); border-color: var(--accent); background: var(--accent-soft);
}
.il-add-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-2); display: grid; place-items: center;
  transition: all .18s;
}
.il-add-card:hover .il-add-icon { background: var(--accent); color: oklch(16% 0.02 240); }

/* grid principal — 2 colunas amplas */
.il-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: var(--gap-grid);
  align-items: start;
}
.il-grid .el-result { position: sticky; top: 0; }

@media (max-width: 1100px) {
  .il-grid { grid-template-columns: 1fr; }
  .il-grid .el-result { position: static; }
}

/* ===========================================================
   CONVERSOR DE UNIDADES
=========================================================== */
.vl-quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 24px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
}
.vl-conv-cats {
  flex-wrap: wrap;
  gap: 4px;
}
.vl-conv-cats button {
  flex: 1 1 28%;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.vl-conv-cats button svg { flex: 0 0 auto; opacity: 0.85; }

.vl-conv-swap-row {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0;
}
.vl-conv-line {
  flex: 1; height: 1px;
  background: var(--border);
}
.vl-conv-swap {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--bg-0);
  color: var(--accent);
  transition: all .18s ease;
}
.vl-conv-swap:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: rotate(180deg);
  box-shadow: 0 0 14px var(--accent-glow);
}

/* tabelas de referência do conversor */
.vl-conv-ref .ref-head, .vl-conv-ref .ref-row {
  grid-template-columns: 90px 1.4fr 1.4fr 1fr;
}
.vl-awg-ref .ref-head, .vl-awg-ref .ref-row {
  grid-template-columns: 110px 1fr 1fr 1.2fr 1.1fr;
}

@media (max-width: 720px) {
  .vl-conv-cats button { flex: 1 1 45%; }
  .vl-awg-ref .ref-head, .vl-awg-ref .ref-row {
    grid-template-columns: 80px 1fr 1fr;
  }
  .vl-awg-ref .ref-head > :nth-child(4), .vl-awg-ref .ref-row > :nth-child(4),
  .vl-awg-ref .ref-head > :nth-child(5), .vl-awg-ref .ref-row > :nth-child(5) { display: none; }
}

/* ===========================================================
   CAD MODULE — full bleed editor
=========================================================== */
.vl-cad {
  height: calc(100vh - 134px); /* viewport minus header */
  margin: -28px -38px -60px;   /* counteract main-scroll padding */
  background: var(--bg-0);
  display: flex;
  overflow: hidden;
}
.vl-cad-grid {
  display: grid;
  grid-template-columns: 52px 1fr 280px;
  width: 100%;
  height: 100%;
  background: var(--bg-0);
}

/* ---------- LEFT TOOLBAR ---------- */
.vl-cad-tools {
  background: oklch(13% 0.012 240);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 10px 8px;
  gap: 4px;
  overflow-y: auto;
}
.vl-cad-tool {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-2);
  color: var(--fg-mute);
  border: 1px solid transparent;
  transition: all .15s ease;
  position: relative;
}
.vl-cad-tool:hover {
  background: var(--bg-2);
  color: var(--fg);
  border-color: var(--border-2);
}
.vl-cad-tool.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: oklch(72% 0.18 245 / 0.4);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 12px var(--accent-glow);
}
.vl-cad-tool.is-danger:hover {
  color: var(--danger);
  background: oklch(70% 0.20 25 / 0.12);
  border-color: oklch(70% 0.20 25 / 0.3);
}
.vl-cad-tool-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

/* ---------- STAGE ---------- */
.vl-cad-stage {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--bg-0);
  overflow: hidden;
}
.vl-cad-svg {
  flex: 1;
  width: 100%;
  background: var(--bg-0);
  display: block;
  user-select: none;
}

/* Top bar */
.vl-cad-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: oklch(15% 0.012 240);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.vl-cad-topbar-l, .vl-cad-topbar-r {
  display: flex; align-items: center; gap: 8px;
}
.vl-cad-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 8px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  border: 1px solid oklch(72% 0.18 245 / 0.3);
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.vl-cad-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  background: transparent;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
  transition: all .15s;
}
.vl-cad-toggle:hover { color: var(--fg-dim); border-color: var(--border-2); }
.vl-cad-toggle.is-on {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: oklch(72% 0.18 245 / 0.3);
}
.vl-cad-step {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 10px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  background: var(--bg-1);
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
}
.vl-cad-step select {
  background: transparent;
  border: 0;
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--fg);
  padding: 3px 4px;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.vl-cad-step select option { background: var(--bg-1); color: var(--fg); }
.vl-cad-coord {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
  padding: 5px 10px;
  border-radius: var(--r-2);
  background: var(--bg-1);
  border: 1px solid var(--border);
}
.vl-cad-coord b {
  color: var(--fg);
  font-weight: 500;
  margin-left: 4px;
}
.btn-sm { padding: 6px 10px; font-size: 11px; }

/* Bottom bar */
.vl-cad-bottombar {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 14px;
  background: oklch(13% 0.012 240);
  border-top: 1px solid var(--border);
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
  flex-shrink: 0;
}
.vl-cad-bottombar b { color: var(--fg); font-weight: 500; margin-left: 2px; }
.vl-cad-help { margin-left: auto; color: var(--fg-faint); }

/* ---------- RIGHT SIDE PANEL ---------- */
.vl-cad-side {
  background: oklch(15% 0.012 240);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.vl-cad-side-section {
  padding: 16px 16px;
  border-bottom: 1px solid var(--border);
}
.vl-cad-side-section:last-child { border-bottom: 0; }
.vl-cad-side-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.vl-cad-side-eyebrow {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--fg-mute);
  text-transform: uppercase;
  display: block;
  margin-bottom: 12px;
}
.vl-cad-side-head .vl-cad-side-eyebrow { margin-bottom: 0; }
.vl-cad-side-add {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 4px;
  color: var(--fg-mute);
  border: 1px solid var(--border);
  transition: all .15s;
}
.vl-cad-side-add:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* Properties */
.vl-cad-prop-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.vl-cad-prop-row label {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.vl-cad-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.vl-cad-sw {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1.5px solid var(--border-2);
  transition: all .15s;
}
.vl-cad-sw:hover { transform: scale(1.08); }
.vl-cad-sw.is-sel {
  border-color: var(--fg);
  box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 3px var(--fg);
}
.vl-cad-stroke-picker { display: flex; gap: 4px; }
.vl-cad-stroke-opt {
  flex: 1;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-0);
  display: grid; place-items: center;
  padding: 0 6px;
}
.vl-cad-stroke-opt.is-sel { border-color: var(--accent); background: var(--accent-soft); }
.vl-cad-stroke-opt > span {
  display: block;
  width: 100%;
  border-radius: 2px;
}

/* Layers */
.vl-cad-layers { display: flex; flex-direction: column; gap: 4px; }
.vl-cad-layer {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-2);
  background: var(--bg-0);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s;
}
.vl-cad-layer:hover { background: var(--bg-2); }
.vl-cad-layer.is-active {
  background: var(--accent-soft);
  border-color: oklch(72% 0.18 245 / 0.4);
}
.vl-cad-layer-vis, .vl-cad-layer-lock {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 4px;
  color: var(--fg-mute);
  background: transparent;
}
.vl-cad-layer-vis:hover, .vl-cad-layer-lock:hover { color: var(--fg); background: var(--bg-2); }
.vl-cad-layer-color {
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border-2);
  flex: 0 0 14px;
}
.vl-cad-layer-name {
  flex: 1;
  font-size: 12px;
  color: var(--fg);
}
.vl-cad-layer-count {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--fg-mute);
  background: var(--bg-1);
  padding: 2px 6px;
  border-radius: var(--r-pill);
  min-width: 22px;
  text-align: center;
}

/* Symbol library */
.vl-cad-symbols { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.vl-cad-sym-tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.vl-cad-sym-tab {
  padding: 5px 9px;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-mute);
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  transition: all .15s;
}
.vl-cad-sym-tab:hover { color: var(--fg-dim); background: var(--bg-2); }
.vl-cad-sym-tab.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: oklch(72% 0.18 245 / 0.3);
}
.vl-cad-sym-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  overflow-y: auto;
  padding-bottom: 12px;
}
.vl-cad-sym {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  transition: all .15s;
  cursor: pointer;
}
.vl-cad-sym:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.vl-cad-sym:hover svg { transform: scale(1.05); }
.vl-cad-sym svg { transition: transform .15s; }
.vl-cad-sym em {
  font-style: normal;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
  text-align: center;
  text-transform: uppercase;
}

@keyframes pulseSlide {
  0% { transform: translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateX(600px); opacity: 0; }
}
.pulse {
  animation: pulseSlide 5s linear infinite;
  transform-origin: left;
}
.pulse-2 { animation-duration: 6s; animation-delay: 1s; animation-direction: reverse; }
.pulse-3 { animation-duration: 7s; animation-delay: 2s; }
@keyframes pingPulse {
  0% { r: 3; opacity: 0.9; }
  100% { r: 14; opacity: 0; }
}
.ping {
  animation: pingPulse 2.4s ease-out infinite;
}
.ping-2 { animation-delay: 0.8s; }
.ping-3 { animation-delay: 1.6s; }

@keyframes fadeUp {
  from { transform: translateY(8px); }
  to { transform: translateY(0); }
}
.panel, .calc-card, .kpi, .d-hero {
  animation: fadeUp .4s ease;
}
.calc-card { animation-delay: calc(var(--i, 0) * 40ms); }

/* ===========================================================
   RESPONSIVE
=========================================================== */
@media (max-width: 1280px) {
  .d-grid { grid-template-columns: 1fr; }
  .panel-recent { grid-row: auto; }
  .d-kpis { grid-template-columns: repeat(2, 1fr); }
  .calc-grid { grid-template-columns: repeat(2, 1fr); }
  .el-grid { grid-template-columns: 1fr; }
  .el-result { position: static; }
}
@media (max-width: 980px) {
  .landing-grid { gap: 60px; padding: 60px 40px; }
}
@media (max-width: 720px) {
  .d-kpis, .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===========================================================
   CORREÇÃO DEFINITIVA DO DROPDOWN (MÉTODO COMPATÍVEL)
=========================================================== */

/* 1. Garante que a caixa da tabela nunca corte o menu */
.cond-table, .el-inputs {
  overflow: visible !important;
}

/* 2. O Segredo: Cada linha ganha um z-index menor que a anterior. 
      Assim, o menu da Linha 1 SEMPRE cobrirá a Linha 2, e assim sucessivamente. */
.ct-row { position: relative !important; }
.ct-row:nth-child(1)  { z-index: 50 !important; }
.ct-row:nth-child(2)  { z-index: 49 !important; }
.ct-row:nth-child(3)  { z-index: 48 !important; }
.ct-row:nth-child(4)  { z-index: 47 !important; }
.ct-row:nth-child(5)  { z-index: 46 !important; }
.ct-row:nth-child(6)  { z-index: 45 !important; }
.ct-row:nth-child(7)  { z-index: 44 !important; }
.ct-row:nth-child(8)  { z-index: 43 !important; }
.ct-row:nth-child(9)  { z-index: 42 !important; }
.ct-row:nth-child(10) { z-index: 41 !important; }

/* 3. Estiliza o menu flutuante e adiciona a barra de rolagem */
.vl-dd-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background-color: var(--bg-0) !important;
  border: 1px solid var(--border-3) !important;
  border-radius: 6px;
  z-index: 99999 !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9) !important;
  max-height: 180px !important;
  overflow-y: auto !important;
}

/* 4. Previne que os botões interfiram */
.qty button {
  position: static !important;
  z-index: 0 !important;
}

/* ===========================================================
   CONFIGURAÇÕES (Settings)
=========================================================== */
.settings-page {
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: var(--gap-grid);
  align-items: start;
}

/* Rail */
.set-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}
.set-rail-eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--fg-mute);
  text-transform: uppercase;
  padding: 6px 12px 10px;
}
.set-rail-nav { display: flex; flex-direction: column; gap: 2px; }
.set-rail-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  border-radius: var(--r-2);
  color: var(--fg-mute);
  font-size: 13.5px;
  text-align: left;
  border: 1px solid transparent;
  transition: all .15s;
}
.set-rail-item svg { color: var(--fg-faint); transition: color .15s; }
.set-rail-item:hover { color: var(--fg-dim); background: var(--bg-1); }
.set-rail-item:hover svg { color: var(--fg-mute); }
.set-rail-item.is-active {
  color: var(--fg);
  background: var(--accent-soft);
  border-color: oklch(72% 0.18 245 / 0.25);
}
.set-rail-item.is-active svg { color: var(--accent); }
.set-rail-foot {
  margin-top: 14px;
  padding: 14px 12px 4px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.set-saved {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ok);
}
.set-saved svg { color: var(--ok); }
.set-rail-version { font-size: 10px; color: var(--fg-faint); letter-spacing: 0.04em; }

/* Content */
.set-content { display: flex; flex-direction: column; gap: var(--gap-grid); min-width: 0; }
.set-section { scroll-margin-top: 16px; }
.set-section-lead {
  margin: -4px 0 20px;
  color: var(--fg-mute);
  font-size: 12.5px;
  max-width: 64ch;
  line-height: 1.55;
}
.set-mini { padding: 7px 12px; font-size: 12px; }

/* Linha de configuração */
.set-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.set-section > .panel-head + .set-row,
.set-section-lead + .set-row,
.set-section-lead + .set-grid-2 .set-row,
.set-grid-2 .set-row,
.set-grid-3 .set-row { border-top: 0; }
.set-row.is-full { grid-template-columns: 1fr; gap: 10px; }
.set-row-l { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.set-row-label { font-size: 13.5px; color: var(--fg); font-weight: 500; }
.set-row-label svg { vertical-align: -2px; margin-right: 5px; color: var(--warn); }
.set-row-hint { font-size: 11.5px; color: var(--fg-mute); line-height: 1.4; }
.set-row-c { display: flex; justify-content: flex-end; }
.set-row.is-full .set-row-c { justify-content: stretch; }
.set-row.is-full .set-row-c > * { width: 100%; }

/* Grids de linhas lado a lado */
.set-grid-2, .set-grid-3 {
  display: grid;
  gap: 24px;
  border-top: 1px solid var(--border);
  padding-top: 4px;
}
.set-grid-2 { grid-template-columns: 1fr 1fr; }
.set-grid-3 { grid-template-columns: repeat(3, 1fr); }
.set-grid-2 .set-row, .set-grid-3 .set-row { padding: 16px 0 4px; }
.set-grid-2 .set-row-c, .set-grid-3 .set-row-c { justify-content: flex-start; }
.set-grid-2 .seg, .set-grid-3 .seg, .set-grid-2 .set-num, .set-grid-3 .set-num { width: 100%; }

.set-section-actions {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end;
}

/* Inputs numéricos e de texto na página */
.set-num {
  height: 42px; min-width: 130px;
  padding: 0 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  display: inline-flex; align-items: center; gap: 8px;
}
.set-num input { flex: 1; min-width: 0; height: 100%; font-family: var(--ff-mono); font-size: 15px; font-feature-settings: "tnum"; }
.set-num input::-webkit-outer-spin-button, .set-num input::-webkit-inner-spin-button { opacity: .4; }
.set-num-unit { font-style: normal; font-family: var(--ff-mono); font-size: 12px; color: var(--fg-mute); }
.set-text {
  height: 42px; width: 100%;
  padding: 0 13px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  display: inline-flex; align-items: center; gap: 10px;
}
.set-text svg { color: var(--fg-mute); flex: 0 0 auto; }
.set-text input { flex: 1; min-width: 0; height: 100%; font-size: 14px; }
.set-text:focus-within, .set-num:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.set-tensao { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.set-tensao .seg { flex: 0 0 auto; }

/* Swatches de cor */
.set-swatches { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.set-swatch {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 9px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-pill);
  color: var(--fg-mute);
  font-size: 12.5px;
  transition: all .15s;
}
.set-swatch:hover { border-color: var(--border-3); color: var(--fg-dim); }
.set-swatch-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--sw);
  box-shadow: 0 0 0 1px oklch(100% 0 0 / 0.1) inset, 0 0 10px -2px var(--sw);
}
.set-swatch.is-sel {
  color: var(--fg);
  border-color: var(--sw);
  background: color-mix(in oklab, var(--sw) 12%, transparent);
}

/* Switch (toggle) */
.set-switch { display: inline-flex; align-items: center; gap: 10px; color: var(--fg-mute); font-size: 12.5px; }
.set-switch-track {
  width: 40px; height: 23px;
  border-radius: var(--r-pill);
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  padding: 2px;
  transition: background .18s, border-color .18s;
  flex: 0 0 auto;
}
.set-switch-thumb {
  display: block; width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--fg-mute);
  transform: translateX(0);
  transition: transform .18s, background .18s;
}
.set-switch.is-on { color: var(--fg); }
.set-switch.is-on .set-switch-track { background: var(--accent-soft); border-color: var(--accent); }
.set-switch.is-on .set-switch-thumb { transform: translateX(17px); background: var(--accent); }
.set-switch-label { min-width: 72px; }

/* Zona de dados / danger */
.set-danger-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.set-danger-row:first-of-type { border-top: 0; }
.set-danger-meta { display: flex; flex-direction: column; gap: 3px; }
.set-danger-meta b { font-size: 13.5px; font-weight: 500; color: var(--fg); }
.set-danger-meta b svg { vertical-align: -2px; margin-right: 5px; color: var(--danger); }
.set-danger-meta em { font-style: normal; font-size: 11.5px; color: var(--fg-mute); max-width: 56ch; line-height: 1.45; }
.set-danger-row.is-critical {
  margin-top: 6px;
  padding: 16px 18px;
  border: 1px solid oklch(70% 0.20 25 / 0.3);
  border-radius: var(--r-3);
  background: oklch(70% 0.20 25 / 0.05);
}
.btn-danger-solid {
  background: oklch(70% 0.20 25 / 0.12);
  border: 1px solid oklch(70% 0.20 25 / 0.4);
  color: oklch(78% 0.16 25);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--r-2);
  font-size: 13px; font-weight: 500;
  transition: all .15s; flex: 0 0 auto;
}
.btn-danger-solid:hover { background: oklch(70% 0.20 25 / 0.22); border-color: var(--danger); color: oklch(86% 0.14 25); }

@media (max-width: 980px) {
  .settings-page { grid-template-columns: 1fr; }
  .set-rail { position: static; flex-direction: row; flex-wrap: wrap; }
  .set-rail-nav { flex-direction: row; flex-wrap: wrap; }
  .set-rail-foot { display: none; }
  .set-grid-2, .set-grid-3 { grid-template-columns: 1fr; }
}

/* ===========================================================
   MOBILE / TABLET — uso no celular
   Sidebar vira gaveta (drawer) com botão hambúrguer no header.
=========================================================== */
.hamburger { display: none; }
.nav-scrim { display: none; }

@media (max-width: 860px) {
  /* libera a largura travada de desktop */
  .shell {
    grid-template-columns: 1fr;
    min-width: 0;
    height: 100dvh;
  }
  html, body { overflow-x: hidden; }

  /* SIDEBAR como gaveta deslizante */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 82vw; max-width: 320px;
    z-index: 70;
    transform: translateX(-102%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 0 0 100vmax transparent;
    padding-top: max(22px, env(safe-area-inset-top));
  }
  .shell.nav-open .sidebar { transform: translateX(0); box-shadow: 28px 0 60px -20px #000; }

  /* fundo escuro atrás da gaveta */
  .nav-scrim {
    display: block;
    position: fixed; inset: 0;
    z-index: 65;
    background: oklch(8% 0.01 245 / 0.62);
    backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity .26s;
  }
  .shell.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }

  /* botão hambúrguer no header */
  .hamburger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 40px; height: 40px; flex: 0 0 auto;
    border: 1px solid var(--border-2); border-radius: var(--r-2);
    background: var(--bg-1);
    margin-right: 12px;
  }
  .hamburger span {
    display: block; width: 18px; height: 2px; margin: 0 auto;
    background: var(--fg-dim); border-radius: 2px;
  }
  .hamburger:active { background: var(--bg-2); }

  /* header compacto e empilhado */
  .app-header {
    flex-wrap: wrap;
    align-items: center;
    padding: max(14px, env(safe-area-inset-top)) 16px 14px;
    gap: 10px;
  }
  .app-header-l { order: 2; flex: 1 1 100%; min-width: 0; }
  .hamburger { order: 1; }
  .app-header-r { order: 1; margin-left: auto; gap: 6px; }
  .crumbs { display: none; }
  .app-title { font-size: 22px; }
  .app-eyebrow { font-size: 10px; }

  /* esconder o botão grande "Novo cálculo" no header (cabe no menu) */
  .app-header-r .btn-primary { display: none; }
  .app-header-r .btn-ghost { padding: 8px 10px; font-size: 11px; }

  /* conteúdo com respiro lateral menor */
  .main-scroll {
    padding: 16px 14px calc(60px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  /* grids de KPIs e resumo em 1–2 colunas */
  .d-kpis { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
  .d-grid { grid-template-columns: 1fr !important; }
  .summary-grid { grid-template-columns: 1fr !important; }

  /* calculadoras: empilhar entrada/resultado */
  .el-grid, .il-grid { grid-template-columns: 1fr !important; }
  .el-result, .il-grid .el-result { position: static !important; }

  /* alvos de toque maiores */
  .btn, .nav-item, .icon-btn { min-height: 42px; }
  .icon-btn { width: 42px; height: 42px; }

  /* barra de projeto não cobrir conteúdo */
  .vl-projectbar, .project-bar { font-size: 12px; }
}

@media (max-width: 460px) {
  .d-kpis { grid-template-columns: 1fr !important; }
  .app-title { font-size: 19px; }
  .app-header-r .btn-ghost span,
  .app-header-r .btn-ghost { font-size: 0; }
  .app-header-r .btn-ghost svg { font-size: 14px; }
}

/* LANDING / LOGIN no celular */
@media (max-width: 860px) {
  .landing { min-height: 100dvh; }
  .landing-top { padding: 16px 18px; }
  .landing-nav { display: none; }
  .landing-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 28px 18px calc(40px + env(safe-area-inset-bottom));
    align-content: start;
  }
  /* card de login primeiro */
  .login-card { order: -1; justify-content: stretch; }
  .login-card > * { width: 100%; }
  .landing-hero { max-width: 100%; }
  .hero-title, .landing-hero h1 { font-size: clamp(30px, 9vw, 46px); }
  .landing-orb { filter: blur(120px); opacity: 0.4; }
  .landing-foot { padding: 14px 18px; flex-wrap: wrap; gap: 8px; font-size: 11px; }
}