.rgz-hydraulic-studio-root,
.rgz-hydraulic-studio-root * {
  box-sizing: border-box;
}

.rgz-hydraulic-studio-root {
  --rgz-bg: #070b16;
  --rgz-bg-2: #0a1024;
  --rgz-panel: rgba(15, 23, 42, .94);
  --rgz-panel-solid: #0f172a;
  --rgz-panel-2: rgba(17, 28, 51, .92);
  --rgz-card: rgba(255, 255, 255, .055);
  --rgz-card-2: rgba(255, 255, 255, .08);
  --rgz-line: #263554;
  --rgz-line-2: #354568;
  --rgz-text: #f3efe7;
  --rgz-muted: #93a4bd;
  --rgz-muted-2: #64748b;
  --rgz-accent: #e8793c;
  --rgz-accent-2: #38bdf8;
  --rgz-success: #22c55e;
  --rgz-warning: #f59e0b;
  --rgz-danger: #ef4444;
  --rgz-blue: #60a5fa;
  --rgz-shadow: 0 18px 60px rgba(0,0,0,.35);
  --rgz-radius: 18px;
  --rgz-radius-sm: 12px;
  --rgz-sidebar: 286px;
  --rgz-inspector: 342px;
  --rgz-header: 74px;
  color: var(--rgz-text);
  background:
    radial-gradient(circle at 10% 0%, rgba(232,121,60,.10), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(56,189,248,.08), transparent 30%),
    linear-gradient(180deg, var(--rgz-bg-2), var(--rgz-bg));
  min-height: 100vh;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  position: relative;
  isolation: isolate;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  direction: ltr;
}

.rgz-hydraulic-studio-root:fullscreen,
.rgz-hydraulic-studio-root.rgz-fallback-fullscreen {
  width: 100vw;
  height: 100vh;
  margin-left: 0;
  background: var(--rgz-bg);
}

.rgz-hydraulic-studio-root.rgz-fallback-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 999999;
}

.rgz-hydraulic-studio-root:fullscreen .rgz-app,
.rgz-hydraulic-studio-root.rgz-fallback-fullscreen .rgz-app {
  width: 100vw;
  height: 100vh;
}

#rgz-canvas.rgz-ctrl-pan {
  cursor: grab;
}
#rgz-canvas.rgz-ctrl-pan:active {
  cursor: grabbing;
}

.rgz-app {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  background: linear-gradient(180deg, rgba(7,11,22,.86), rgba(7,11,22,.98));
}

.rgz-topbar {
  height: var(--rgz-header);
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 18px;
  background: rgba(7, 11, 22, .82);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 20;
}

.rgz-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.rgz-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(232,121,60,.5);
  color: var(--rgz-accent);
  background: radial-gradient(circle at 30% 20%, rgba(232,121,60,.24), rgba(255,255,255,.04));
  border-radius: 14px;
  font-weight: 900;
  letter-spacing: -.06em;
  box-shadow: 0 0 0 4px rgba(232,121,60,.06);
}

.rgz-brand h1 {
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1;
  margin: 0;
  letter-spacing: -.035em;
}

.rgz-brand p {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--rgz-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rgz-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.rgz-btn,
.rgz-select,
.rgz-input,
.rgz-small-input,
.rgz-inspector textarea {
  border: 1px solid rgba(255,255,255,.11);
  background: rgba(255,255,255,.055);
  color: var(--rgz-text);
  border-radius: 999px;
  min-height: 38px;
  padding: 0 13px;
  font: inherit;
  outline: none;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.rgz-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.rgz-btn:hover {
  background: rgba(255,255,255,.095);
  border-color: rgba(255,255,255,.22);
  transform: translateY(-1px);
}

.rgz-btn:active {
  transform: translateY(0);
}

.rgz-btn.primary {
  background: linear-gradient(135deg, var(--rgz-accent), #f59e0b);
  color: #190b04;
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 12px 32px rgba(232,121,60,.22);
}

.rgz-btn.blue {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: white;
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 12px 32px rgba(56,189,248,.18);
}

.rgz-btn.green {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: white;
  border-color: rgba(255,255,255,.1);
}

.rgz-btn.danger {
  color: #fecaca;
  border-color: rgba(239,68,68,.34);
  background: rgba(239,68,68,.12);
}

.rgz-btn.icon {
  min-width: 38px;
  width: 38px;
  padding: 0;
  font-size: 17px;
}

.rgz-btn[disabled] {
  opacity: .42;
  cursor: not-allowed;
  transform: none;
}

.rgz-main {
  display: grid;
  grid-template-columns: var(--rgz-sidebar) minmax(420px, 1fr) var(--rgz-inspector);
  height: calc(100vh - var(--rgz-header));
  min-height: 0;
}

.rgz-sidebar,
.rgz-inspector {
  background: rgba(7,11,22,.66);
  backdrop-filter: blur(18px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}

.rgz-sidebar {
  border-right: 1px solid rgba(255,255,255,.08);
  padding: 14px;
}

.rgz-inspector {
  border-left: 1px solid rgba(255,255,255,.08);
  padding: 14px;
}

.rgz-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 3px 0 10px;
}

.rgz-section-title h2,
.rgz-panel-title {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--rgz-muted);
  font-weight: 850;
}

.rgz-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  color: var(--rgz-muted);
  font-size: 11px;
  background: rgba(255,255,255,.045);
}

.rgz-search {
  margin: 9px 0 12px;
}

.rgz-input,
.rgz-select {
  width: 100%;
  height: 40px;
  border-radius: 13px;
  color-scheme: dark;
}

.rgz-small-input {
  width: 100%;
  min-height: 34px;
  border-radius: 10px;
  padding: 0 10px;
  color-scheme: dark;
}

.rgz-inspector textarea {
  width: 100%;
  min-height: 76px;
  border-radius: 12px;
  padding: 10px;
  resize: vertical;
  color-scheme: dark;
}

.rgz-category {
  margin: 12px 0 16px;
}

.rgz-category summary {
  cursor: pointer;
  color: var(--rgz-text);
  font-size: 13px;
  font-weight: 800;
  padding: 10px 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  background: rgba(255,255,255,.045);
  user-select: none;
}

.rgz-symbol-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  padding-top: 9px;
}

.rgz-symbol-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 8px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,.09);
  background: linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.035));
  cursor: grab;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}

.rgz-symbol-card:hover {
  transform: translateY(-1px);
  border-color: rgba(232,121,60,.42);
  background: linear-gradient(145deg, rgba(232,121,60,.11), rgba(255,255,255,.055));
}

.rgz-symbol-card:active {
  cursor: grabbing;
}

.rgz-symbol-icon {
  width: 58px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}

.rgz-symbol-icon svg {
  width: 50px;
  height: 38px;
  overflow: visible;
}

.rgz-symbol-name {
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 3px;
}

.rgz-symbol-desc {
  font-size: 11px;
  line-height: 1.3;
  color: var(--rgz-muted);
}

.rgz-workspace {
  position: relative;
  overflow: hidden;
  background: #08101f;
}

.rgz-canvas-toolbar {
  position: absolute;
  left: 16px;
  top: 14px;
  right: 16px;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.rgz-canvas-toolbar > * {
  pointer-events: auto;
}

.rgz-tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(7,11,22,.68);
  backdrop-filter: blur(10px);
  color: var(--rgz-muted);
  font-size: 12px;
}

.rgz-canvas-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#rgz-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
  background: #07101f;
}

.rgz-canvas-grid-major {
  stroke: rgba(148,163,184,.12);
  stroke-width: 1;
}

.rgz-canvas-grid-minor {
  stroke: rgba(148,163,184,.06);
  stroke-width: 1;
}

.rgz-connection-path {
  fill: none;
  stroke: #d9e7ff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.28));
  cursor: pointer;
  transition: stroke .15s ease, stroke-width .15s ease, opacity .15s ease;
}

.rgz-connection-path.pressure { stroke: #93c5fd; }
.rgz-connection-path.return { stroke: #a7f3d0; }
.rgz-connection-path.pilot { stroke: #fbbf24; stroke-dasharray: 8 8; }
.rgz-connection-path.drain { stroke: #c4b5fd; stroke-dasharray: 3 7; }
.rgz-connection-path.electrical { stroke: #f0abfc; stroke-dasharray: 10 6 2 6; }

.rgz-connection-path.selected {
  stroke: var(--rgz-accent);
  stroke-width: 5;
}

.rgz-connection-path.sim-active {
  stroke: var(--rgz-accent-2);
  stroke-dasharray: 18 12;
  animation: rgz-flow 1.05s linear infinite;
  filter: drop-shadow(0 0 9px rgba(56,189,248,.45));
}

.rgz-connection-path.sim-high {
  stroke: #fb7185;
  filter: drop-shadow(0 0 10px rgba(251,113,133,.48));
}

@keyframes rgz-flow {
  to { stroke-dashoffset: -60; }
}

.rgz-component {
  cursor: move;
}

.rgz-component .symbol-stroke {
  stroke: #f8fafc;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rgz-component .symbol-fill {
  fill: rgba(255,255,255,.07);
  stroke: #f8fafc;
  stroke-width: 2.2;
}

.rgz-component .symbol-muted {
  stroke: #94a3b8;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rgz-component .symbol-accent {
  stroke: var(--rgz-accent);
  fill: none;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rgz-component.selected .selection-box {
  stroke: var(--rgz-accent);
  stroke-width: 1.7;
  fill: rgba(232,121,60,.08);
  stroke-dasharray: 7 6;
}

.rgz-component .selection-box {
  stroke: transparent;
  fill: transparent;
  pointer-events: none;
}

.rgz-component .port {
  fill: #08101f;
  stroke: #38bdf8;
  stroke-width: 2.5;
  cursor: crosshair;
  filter: drop-shadow(0 0 5px rgba(56,189,248,.45));
}

.rgz-component .port.pending {
  stroke: var(--rgz-accent);
  fill: rgba(232,121,60,.5);
}

.rgz-component .port-label {
  fill: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
  paint-order: stroke;
  stroke: #07101f;
  stroke-width: 3;
}

.rgz-component .component-label {
  fill: #f8fafc;
  font-size: 13px;
  font-weight: 850;
  pointer-events: none;
  paint-order: stroke;
  stroke: #07101f;
  stroke-width: 4;
}

.rgz-component.sim-moving .symbol-accent,
.rgz-component.sim-moving .symbol-stroke {
  stroke: #38bdf8;
  filter: drop-shadow(0 0 8px rgba(56,189,248,.38));
}

.rgz-bottom-panel {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 10;
  max-height: 230px;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(7,11,22,.76);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
}

.rgz-bottom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.rgz-message-list {
  padding: 10px 12px 12px;
  display: grid;
  gap: 8px;
}

.rgz-message {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  padding: 9px 10px;
  background: rgba(255,255,255,.045);
  font-size: 12px;
  line-height: 1.35;
}

.rgz-message strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.rgz-message.error { border-color: rgba(239,68,68,.38); background: rgba(239,68,68,.11); }
.rgz-message.warning { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.11); }
.rgz-message.info { border-color: rgba(56,189,248,.34); background: rgba(56,189,248,.08); }
.rgz-message.ok { border-color: rgba(34,197,94,.36); background: rgba(34,197,94,.1); }

.rgz-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.rgz-tab {
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.045);
  color: var(--rgz-muted);
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.rgz-tab.active {
  color: var(--rgz-text);
  border-color: rgba(232,121,60,.42);
  background: rgba(232,121,60,.13);
}

.rgz-panel {
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.045);
  border-radius: 17px;
  padding: 13px;
  margin-bottom: 12px;
}

.rgz-panel p,
.rgz-help {
  color: var(--rgz-muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 7px 0 0;
}

.rgz-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rgz-field {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.rgz-field label {
  color: var(--rgz-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}

.rgz-kv {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.rgz-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 11px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.06);
  font-size: 12px;
}

.rgz-kv-row span:first-child {
  color: var(--rgz-muted);
}

.rgz-kv-row span:last-child {
  font-weight: 850;
  color: var(--rgz-text);
  text-align: right;
}

.rgz-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--rgz-muted-2);
  box-shadow: 0 0 0 4px rgba(148,163,184,.08);
}

.rgz-status-dot.running {
  background: var(--rgz-success);
  box-shadow: 0 0 0 4px rgba(34,197,94,.12), 0 0 18px rgba(34,197,94,.55);
}

.rgz-print-title-block {
  display: none;
}

.rgz-disclaimer {
  font-size: 11px;
  color: var(--rgz-muted);
  line-height: 1.45;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(255,255,255,.16);
  background: rgba(255,255,255,.035);
}

.rgz-toast-wrap {
  position: absolute;
  z-index: 50;
  right: 16px;
  top: calc(var(--rgz-header) + 16px);
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.rgz-toast {
  width: min(360px, calc(100vw - 32px));
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(7,11,22,.88);
  backdrop-filter: blur(14px);
  border-radius: 15px;
  padding: 11px 13px;
  font-size: 12px;
  color: var(--rgz-text);
  box-shadow: var(--rgz-shadow);
  animation: rgz-toast-in .22s ease both;
}

@keyframes rgz-toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.rgz-mobile-note {
  display: none;
  padding: 10px 14px;
  background: rgba(245,158,11,.12);
  border-bottom: 1px solid rgba(245,158,11,.28);
  color: #fde68a;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .rgz-hydraulic-studio-root {
    --rgz-sidebar: 238px;
    --rgz-inspector: 302px;
  }
  .rgz-topbar {
    grid-template-columns: 1fr;
    height: auto;
  }
  .rgz-main {
    height: calc(100vh - 132px);
  }
}

@media (max-width: 920px) {
  .rgz-mobile-note { display: block; }
  .rgz-main {
    grid-template-columns: 1fr;
    height: auto;
  }
  .rgz-sidebar,
  .rgz-inspector {
    max-height: 360px;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .rgz-workspace {
    height: 680px;
    order: 2;
  }
  .rgz-sidebar { order: 1; }
  .rgz-inspector { order: 3; }
}

@media print {
  body * {
    visibility: hidden !important;
  }
  .rgz-hydraulic-studio-root,
  .rgz-hydraulic-studio-root * {
    visibility: visible !important;
  }
  .rgz-hydraulic-studio-root {
    background: white !important;
    color: black !important;
    position: absolute;
    inset: 0;
    width: 100% !important;
    min-height: auto !important;
    font-family: Arial, sans-serif;
  }
  .rgz-app {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: white !important;
    min-height: auto !important;
  }
  .rgz-topbar,
  .rgz-sidebar,
  .rgz-inspector,
  .rgz-bottom-panel,
  .rgz-canvas-toolbar,
  .rgz-toast-wrap,
  .rgz-mobile-note {
    display: none !important;
  }
  .rgz-main {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .rgz-workspace {
    position: static !important;
    height: calc(100vh - 116px) !important;
    background: white !important;
    overflow: visible !important;
  }
  .rgz-canvas-wrap {
    position: static !important;
    height: 100% !important;
    border: 1px solid #111;
  }
  #rgz-canvas {
    height: 100% !important;
    background: white !important;
  }
  .rgz-canvas-grid-minor,
  .rgz-canvas-grid-major {
    stroke: #e5e7eb !important;
  }
  .rgz-component .symbol-stroke,
  .rgz-component .symbol-muted,
  .rgz-component .symbol-fill {
    stroke: black !important;
  }
  .rgz-component .symbol-fill {
    fill: white !important;
  }
  .rgz-component .component-label,
  .rgz-component .port-label {
    fill: black !important;
    stroke: white !important;
  }
  .rgz-component .port {
    fill: white !important;
    stroke: black !important;
    filter: none !important;
  }
  .rgz-connection-path,
  .rgz-connection-path.pressure,
  .rgz-connection-path.return,
  .rgz-connection-path.pilot,
  .rgz-connection-path.drain,
  .rgz-connection-path.electrical {
    stroke: black !important;
    filter: none !important;
    animation: none !important;
  }
  .rgz-print-title-block {
    display: grid !important;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0;
    border: 1px solid #111;
    border-top: none;
    font-size: 10px;
    color: #111;
  }
  .rgz-print-title-block > div {
    padding: 7px 8px;
    border-right: 1px solid #111;
    min-height: 34px;
  }
  .rgz-print-title-block > div:nth-child(3n) {
    border-right: none;
  }
  @page {
    size: A4 landscape;
    margin: 8mm;
  }
}

/* Improvements requested for the first release */
.rgz-select option,
.rgz-small-input option,
.rgz-input option {
  background: #0f172a;
  color: #f8fafc;
}

.rgz-examples-panel {
  border-color: rgba(232,121,60,.42);
  background: linear-gradient(145deg, rgba(232,121,60,.13), rgba(56,189,248,.06));
  box-shadow: 0 12px 36px rgba(232,121,60,.08);
}

.rgz-examples-panel .rgz-select {
  background: #111c33;
  color: #f8fafc;
  border-color: rgba(232,121,60,.45);
  font-weight: 750;
}

.rgz-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, .66);
  backdrop-filter: blur(10px);
}

.rgz-modal {
  width: min(760px, calc(100vw - 40px));
  max-height: min(840px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.16);
  background: #0b1224;
  color: var(--rgz-text);
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
  overflow: hidden;
}

.rgz-modal-head,
.rgz-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  background: rgba(255,255,255,.045);
  border-bottom: 1px solid rgba(255,255,255,.09);
}

.rgz-modal-foot {
  border-top: 1px solid rgba(255,255,255,.09);
  border-bottom: 0;
  color: var(--rgz-muted);
  font-size: 12px;
}

.rgz-modal-head h3 {
  margin: 0 0 5px;
  font-size: 18px;
  letter-spacing: -.02em;
}

.rgz-modal-head p {
  margin: 0;
  color: var(--rgz-muted);
  font-size: 12px;
  line-height: 1.4;
}

.rgz-modal-body {
  overflow: auto;
  padding: 14px;
}

/* Readable simple black list/dropdown colors */
.rgz-select,
select.rgz-small-input,
.rgz-examples-panel .rgz-select {
  background: #ffffff !important;
  color: #111827 !important;
  border-color: #111827 !important;
}

.rgz-select option,
select.rgz-small-input option,
.rgz-input option {
  background: #ffffff !important;
  color: #111827 !important;
}

/* Dedicated app-page cleanup: remove bottom whitespace from WordPress/Elementor wrappers where supported */
body:has(#rgz-hydraulic-studio),
html:has(#rgz-hydraulic-studio) {
  background: #070b16 !important;
}

body:has(#rgz-hydraulic-studio) .entry-content,
body:has(#rgz-hydraulic-studio) .elementor,
body:has(#rgz-hydraulic-studio) .elementor-section,
body:has(#rgz-hydraulic-studio) .elementor-container,
body:has(#rgz-hydraulic-studio) .elementor-widget-container {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.rgz-hydraulic-studio-root {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  margin-bottom: 0 !important;
}

.rgz-app {
  height: 100dvh;
  min-height: 100dvh;
}

.rgz-main {
  height: calc(100dvh - var(--rgz-header));
}

.rgz-example-list {
  display: grid;
  gap: 7px;
  max-height: 248px;
  overflow: auto;
  padding: 3px 2px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(232,121,60,.65) rgba(255,255,255,.08);
}

.rgz-example-card {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 9px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: #0b1224;
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

.rgz-example-card:hover {
  transform: translateY(-1px);
  border-color: rgba(232,121,60,.66);
  background: #111c33;
}

.rgz-example-card span {
  display: grid;
  place-items: center;
  height: 28px;
  border-radius: 9px;
  background: rgba(232,121,60,.16);
  color: #ffedd5;
  font-size: 12px;
  font-weight: 900;
}

.rgz-example-card strong {
  color: #ffffff;
  font-size: 12px;
  line-height: 1.22;
  font-weight: 800;
}

.rgz-hydraulic-studio-root select,
.rgz-hydraulic-studio-root option,
.rgz-hydraulic-studio-root optgroup {
  background-color: #ffffff !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  text-shadow: none !important;
}

/* True fullscreen web-app mounting for the WordPress page */
.rgz-hydraulic-studio-root {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  overflow: hidden !important;
}

body.admin-bar .rgz-hydraulic-studio-root {
  top: 32px !important;
  height: calc(100dvh - 32px) !important;
  min-height: calc(100dvh - 32px) !important;
}

body:has(#rgz-hydraulic-studio) {
  overflow: hidden !important;
  min-height: 100dvh !important;
  background: #070b16 !important;
}

@media (max-width: 782px) {
  body.admin-bar .rgz-hydraulic-studio-root {
    top: 46px !important;
    height: calc(100dvh - 46px) !important;
    min-height: calc(100dvh - 46px) !important;
  }
}

/* Select-like predesigned circuit picker: keeps the old compact style but uses controlled colors */
.rgz-custom-select {
  position: relative;
  z-index: 30;
}

.rgz-example-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.rgz-example-trigger span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rgz-example-trigger b {
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
}

.rgz-example-menu {
  display: none;
  position: absolute;
  z-index: 500;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 320px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #111827;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  padding: 5px;
}

.rgz-custom-select.open .rgz-example-menu {
  display: grid;
  gap: 2px;
}

.rgz-example-option {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.rgz-example-option span,
.rgz-example-option strong {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

.rgz-example-option span {
  font-weight: 850;
  font-size: 12px;
}

.rgz-example-option strong {
  font-weight: 650;
  font-size: 13px;
  line-height: 1.25;
}

.rgz-example-option:hover,
.rgz-example-option.active {
  background: #dbeafe;
}

html.rgz-hydraulic-page,
body.rgz-hydraulic-page {
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #070b16 !important;
}

.rgz-print-area-rect {
  fill: rgba(232,121,60,.06);
  stroke: rgba(232,121,60,.8);
  stroke-width: 2;
  stroke-dasharray: 12 8;
  pointer-events: none;
}

.rgz-print-area-label {
  fill: #fed7aa;
  font-size: 13px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #07101f;
  stroke-width: 4;
  pointer-events: none;
}

.rgz-example-group {
  padding: 8px 9px 5px;
  color: #6b7280;
  background: #f3f4f6;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-radius: 7px;
  margin-top: 4px;
}

.rgz-selector-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.rgz-examples-panel .rgz-field {
  margin-top: 8px;
}

.rgz-examples-panel .rgz-example-menu {
  max-height: 360px;
}

.rgz-connection-path.sim-pressure {
  filter: drop-shadow(0 0 12px rgba(239,68,68,.45));
}

.rgz-connection-path.sim-pressure.pressure,
.rgz-connection-path.sim-pressure.return,
.rgz-connection-path.sim-pressure.pilot,
.rgz-connection-path.sim-pressure.drain {
  opacity: 1;
}

/* Better pre-designed title fitting */
.rgz-examples-panel {
  overflow: visible;
}

.rgz-selector-row .rgz-custom-select {
  width: 100%;
  min-width: 0;
}

.rgz-example-trigger {
  min-height: 48px;
  height: auto;
  align-items: flex-start;
  padding-top: 9px;
  padding-bottom: 9px;
}

.rgz-example-trigger span {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.28;
  word-break: normal;
  overflow-wrap: anywhere;
  max-width: calc(100% - 22px);
}

.rgz-example-menu {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.rgz-example-option {
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  min-height: 40px;
}

.rgz-example-option strong {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

/* Final hardening for long pre-designed circuit titles */
.rgz-custom-select,
.rgz-example-trigger,
.rgz-example-menu,
.rgz-example-option {
  box-sizing: border-box !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
}

.rgz-example-trigger {
  width: 100% !important;
  white-space: normal !important;
  overflow: hidden !important;
}

.rgz-example-trigger span {
  display: block !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

.rgz-example-menu {
  left: 0 !important;
  right: auto !important;
  width: 100% !important;
}

.rgz-example-option strong {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* Account and popup-based pre-designed circuit browser */
.rgz-examples-modal .rgz-modal-body,
.rgz-auth-modal .rgz-modal-body {
  overflow: visible;
}

.rgz-example-modal-grid {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.5fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

.rgz-examples-modal .rgz-example-menu {
  max-height: min(54vh, 520px);
}

.rgz-example-preview {
  font-size: 14px;
  color: var(--rgz-text);
  font-weight: 800;
  line-height: 1.45;
}

.rgz-design-list {
  display: grid;
  gap: 9px;
  max-height: 420px;
  overflow: auto;
}

.rgz-design-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.045);
  border-radius: 14px;
}

.rgz-design-row strong {
  display: block;
  color: var(--rgz-text);
  overflow-wrap: anywhere;
}

.rgz-design-row span {
  display: block;
  margin-top: 3px;
  color: var(--rgz-muted);
  font-size: 11px;
  line-height: 1.35;
}

.rgz-design-row > div:last-child {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .rgz-example-modal-grid,
  .rgz-design-row {
    grid-template-columns: 1fr;
  }
}

/* Clean professional native dropdowns in the pre-designed popup */
.rgz-native-select {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: #ffffff !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  outline: none;
}

.rgz-native-select option {
  background: #ffffff !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  font-weight: 600;
  white-space: normal;
}

.rgz-examples-modal .rgz-modal-body {
  overflow: visible;
}

/* Dynamic simulation readouts */
.rgz-readout-bg {
  fill: rgba(2, 6, 23, .88);
  stroke: rgba(255,255,255,.24);
  stroke-width: 1.2;
  filter: drop-shadow(0 5px 12px rgba(0,0,0,.35));
}
.rgz-readout-text {
  fill: #ffffff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .01em;
  pointer-events: none;
}

/* Modal hardening: prevent popups from flowing to page bottom */
.rgz-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000005 !important;
  display: grid !important;
  place-items: center !important;
  overflow: auto !important;
}

/* Portrait mobile lock screen with animated rotate hint */
.rgz-orientation-card {
  display: grid;
  place-items: center;
  gap: 12px;
  max-width: 360px;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.14);
  background: radial-gradient(circle at 30% 10%, rgba(232,121,60,.22), rgba(15,23,42,.96));
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}
.rgz-orientation-card h2 { margin: 6px 0 0; color: #fff; font-size: 24px; }
.rgz-orientation-card p { margin: 0; color: #cbd5e1; line-height: 1.5; }
.rgz-phone-rotate {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}
.rgz-phone-rotate span {
  width: 35px;
  height: 58px;
  border: 4px solid #fff;
  border-radius: 10px;
  position: relative;
  animation: rgz-phone-rotate 1.8s ease-in-out infinite;
}
.rgz-phone-rotate span::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 6px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #e8793c;
}
@keyframes rgz-phone-rotate {
  0%, 20% { transform: rotate(0deg); }
  55%, 80% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}

/* Landscape mobile/tablet drawer UI */
.rgz-mobile-landscape-bar { display: none; }
@media (max-width: 920px) and (orientation: landscape) {
  .rgz-hydraulic-studio-root { --rgz-header: 62px; }
  .rgz-topbar {
    height: var(--rgz-header) !important;
    grid-template-columns: auto 1fr auto;
    padding: 8px 10px;
  }
  .rgz-brand p { display: none; }
  .rgz-brand h1 { font-size: 16px; white-space: nowrap; }
  .rgz-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 12px; }
  .rgz-mobile-landscape-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
  }
  .rgz-mobile-landscape-bar .rgz-btn { min-height: 36px; font-size: 12px; padding: 0 10px; }
  .rgz-main { grid-template-columns: 1fr !important; height: calc(100dvh - var(--rgz-header)) !important; }
  .rgz-workspace { height: calc(100dvh - var(--rgz-header)) !important; order: 1 !important; }
  .rgz-sidebar, .rgz-inspector {
    position: fixed !important;
    top: var(--rgz-header) !important;
    bottom: 0 !important;
    width: min(340px, 88vw) !important;
    max-height: none !important;
    z-index: 80 !important;
    background: rgba(7,11,22,.96) !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    transition: transform .2s ease;
  }
  .rgz-sidebar { left: 0; transform: translateX(-104%); }
  .rgz-inspector { right: 0; transform: translateX(104%); }
  .rgz-hydraulic-studio-root.rgz-show-library .rgz-sidebar { transform: translateX(0); }
  .rgz-hydraulic-studio-root.rgz-show-inspector .rgz-inspector { transform: translateX(0); }
  .rgz-actions {
    display: none;
    position: fixed;
    z-index: 90;
    top: calc(var(--rgz-header) + 8px);
    right: 10px;
    left: 10px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(7,11,22,.96);
    box-shadow: 0 20px 70px rgba(0,0,0,.45);
    justify-content: flex-start;
  }
  .rgz-hydraulic-studio-root.rgz-show-actions .rgz-actions { display: flex; }
  .rgz-bottom-panel { max-height: 150px; }
}

@media print {
  .rgz-readout-bg { fill: #fff !important; stroke: #111 !important; filter: none !important; }
  .rgz-readout-text { fill: #111 !important; }
}

/* Mobile landscape refinement for iPhone-mini class screens */
@media (max-width: 920px) and (orientation: landscape) {
  .rgz-hydraulic-studio-root {
    --rgz-header: 42px !important;
    height: var(--rgz-vh, 100dvh) !important;
    min-height: var(--rgz-vh, 100dvh) !important;
  }
  .rgz-app { height: var(--rgz-vh, 100dvh) !important; min-height: var(--rgz-vh, 100dvh) !important; }
  .rgz-topbar { height: 42px !important; min-height: 42px !important; padding: 4px 6px !important; gap: 5px !important; }
  .rgz-brand { gap: 6px !important; }
  .rgz-brand h1 { font-size: 10px !important; letter-spacing: -.02em !important; }
  .rgz-mark { width: 24px !important; height: 24px !important; border-radius: 8px !important; font-size: 8px !important; }
  .rgz-mobile-landscape-bar { gap: 4px !important; }
  .rgz-mobile-landscape-bar .rgz-btn,
  .rgz-actions .rgz-btn,
  .rgz-sidebar .rgz-btn,
  .rgz-inspector .rgz-btn,
  .rgz-mobile-sim-controls .rgz-btn {
    min-height: 22px !important;
    height: 22px !important;
    padding: 0 6px !important;
    font-size: 8px !important;
    border-radius: 999px !important;
    gap: 3px !important;
  }
  .rgz-main { height: calc(var(--rgz-vh, 100dvh) - 42px) !important; }
  .rgz-workspace { height: calc(var(--rgz-vh, 100dvh) - 42px) !important; }
  .rgz-sidebar, .rgz-inspector {
    top: 42px !important;
    width: min(250px, 78vw) !important;
    padding: 7px !important;
    font-size: 9px !important;
  }
  .rgz-actions {
    top: 48px !important;
    right: 6px !important;
    left: auto !important;
    width: min(300px, 70vw) !important;
    max-height: calc(var(--rgz-vh, 100dvh) - 58px) !important;
    overflow: auto !important;
    padding: 7px !important;
    gap: 5px !important;
    border-radius: 12px !important;
  }
  .rgz-section-title h2, .rgz-panel-title { font-size: 8px !important; letter-spacing: .09em !important; }
  .rgz-badge { min-height: 16px !important; padding: 0 5px !important; font-size: 8px !important; }
  .rgz-panel { padding: 7px !important; border-radius: 10px !important; margin-bottom: 7px !important; }
  .rgz-panel p, .rgz-help { font-size: 8px !important; line-height: 1.3 !important; }
  .rgz-input, .rgz-select, .rgz-small-input, .rgz-inspector textarea {
    min-height: 24px !important;
    height: 24px !important;
    padding: 0 7px !important;
    font-size: 9px !important;
    border-radius: 8px !important;
  }
  .rgz-inspector textarea { height: auto !important; min-height: 44px !important; padding: 6px !important; }
  .rgz-category summary { font-size: 9px !important; padding: 6px 7px !important; border-radius: 8px !important; }
  .rgz-symbol-list { gap: 5px !important; padding-top: 5px !important; }
  .rgz-symbol-card { min-height: 38px !important; grid-template-columns: 34px 1fr !important; gap: 6px !important; padding: 5px !important; border-radius: 9px !important; }
  .rgz-symbol-icon { width: 34px !important; height: 28px !important; border-radius: 7px !important; }
  .rgz-symbol-icon svg { width: 32px !important; height: 24px !important; }
  .rgz-symbol-name { font-size: 8.5px !important; margin-bottom: 1px !important; }
  .rgz-symbol-desc { font-size: 7.5px !important; line-height: 1.15 !important; }
  .rgz-canvas-toolbar { top: 6px !important; left: 7px !important; right: 7px !important; gap: 5px !important; }
  .rgz-tool-pill { min-height: 22px !important; padding: 0 7px !important; font-size: 8px !important; }
  .rgz-bottom-panel {
    left: 7px !important;
    right: 7px !important;
    bottom: 7px !important;
    max-height: 28px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }
  .rgz-bottom-panel.rgz-open { max-height: 110px !important; overflow: auto !important; }
  .rgz-bottom-panel:not(.rgz-open) .rgz-message-list { display: none !important; }
  .rgz-bottom-header { min-height: 26px !important; padding: 3px 6px !important; }
  .rgz-bottom-header .rgz-panel-title { font-size: 8px !important; }
  .rgz-message-list { padding: 5px !important; gap: 4px !important; }
  .rgz-message { font-size: 8px !important; padding: 5px 6px !important; border-radius: 8px !important; }
  .rgz-mobile-sim-controls {
    display: flex !important;
    position: absolute;
    z-index: 16;
    right: 8px;
    bottom: 43px;
    gap: 5px;
    padding: 5px;
    border-radius: 999px;
    background: rgba(7,11,22,.76);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
  }
  .rgz-component .component-label { font-size: 10px !important; }
  .rgz-component .port-label { font-size: 8px !important; }
  .rgz-readout-text { font-size: 9px !important; }
}

@media (min-width: 921px), (orientation: portrait) {
  .rgz-mobile-sim-controls { display: none; }
}

/* Mobile simulation safety and live valve controls */
.rgz-mobile-live-controls { display: none; }
@media (max-width: 920px) and (orientation: landscape) {
  .rgz-mobile-sim-controls {
    z-index: 260 !important;
    bottom: 36px !important;
    right: 7px !important;
  }
  .rgz-mobile-sim-controls .rgz-btn[data-action="stop"] {
    background: #dc2626 !important;
    color: #fff !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .rgz-mobile-live-controls.active {
    display: block;
    position: absolute;
    z-index: 255;
    right: 7px;
    bottom: 72px;
    width: min(300px, 72vw);
    max-height: calc(var(--rgz-vh, 100dvh) - 125px);
    overflow: auto;
    padding: 7px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(7,11,22,.90);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 60px rgba(0,0,0,.45);
  }
  .rgz-mobile-live-controls.rgz-collapsed {
    max-height: 30px;
    overflow: hidden;
  }
  .rgz-mobile-live-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
  }
  .rgz-mobile-control-row {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 5px;
    align-items: center;
    padding: 4px;
    margin-top: 4px;
    border-radius: 9px;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.08);
  }
  .rgz-mobile-control-row strong {
    color: #e2e8f0;
    font-size: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .rgz-mobile-control-row span {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .rgz-mobile-control-row .rgz-btn,
  .rgz-mobile-live-head .rgz-btn {
    min-height: 21px !important;
    height: 21px !important;
    padding: 0 6px !important;
    font-size: 8px !important;
  }
  .rgz-hydraulic-studio-root.rgz-show-actions .rgz-mobile-live-controls.active {
    opacity: .18;
    pointer-events: none;
  }
}

/* When the Properties/Inspector drawer is open on mobile, move simulation controls to the left */
@media (max-width: 920px) and (orientation: landscape) {
  .rgz-hydraulic-studio-root.rgz-show-inspector .rgz-mobile-sim-controls {
    left: 7px !important;
    right: auto !important;
  }
  .rgz-hydraulic-studio-root.rgz-show-inspector .rgz-mobile-live-controls.active {
    left: 7px !important;
    right: auto !important;
    width: min(300px, 62vw) !important;
  }
  .rgz-hydraulic-studio-root.rgz-show-library .rgz-mobile-sim-controls,
  .rgz-hydraulic-studio-root.rgz-show-library .rgz-mobile-live-controls.active {
    right: 7px !important;
    left: auto !important;
  }
  .rgz-hydraulic-studio-root.rgz-show-actions .rgz-mobile-sim-controls {
    left: 7px !important;
    right: auto !important;
  }
}

/* Mobile zoom buttons */
.rgz-mobile-zoom {
  min-width: 28px !important;
  width: 28px !important;
  padding: 0 !important;
  font-weight: 950 !important;
}
@media (max-width: 920px) and (orientation: landscape) {
  .rgz-mobile-landscape-bar .rgz-mobile-zoom {
    min-width: 24px !important;
    width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    font-size: 13px !important;
    background: rgba(232,121,60,.18) !important;
    border-color: rgba(232,121,60,.38) !important;
    color: #fff !important;
  }
}

/* Desktop file/account dropdown menu */
.rgz-file-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.rgz-file-menu-list {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 120;
  min-width: 230px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(7,11,22,.98);
  box-shadow: 0 22px 70px rgba(0,0,0,.45);
  backdrop-filter: blur(14px);
  gap: 6px;
}
.rgz-file-menu.open .rgz-file-menu-list {
  display: grid;
}
.rgz-file-menu-list .rgz-btn {
  justify-content: flex-start;
  width: 100%;
}
.rgz-file-menu-list hr {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.1);
  margin: 4px 0;
}
@media (max-width: 920px) and (orientation: landscape) {
  .rgz-file-menu { width: 100%; display: grid; }
  .rgz-file-menu > .rgz-btn { width: 100%; }
  .rgz-file-menu-list {
    position: static;
    min-width: 0;
    box-shadow: none;
    margin-top: 6px;
    background: rgba(255,255,255,.045);
  }
}

/* Library sub-categories */
.rgz-subcategory-wrap {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}
.rgz-subcategory {
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  overflow: hidden;
}
.rgz-subcategory summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 9px;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 850;
  background: rgba(255,255,255,.04);
}
.rgz-subcategory summary::-webkit-details-marker { display: none; }
.rgz-subcategory .rgz-symbol-list { padding: 7px; }
.rgz-subcount {
  float: right;
  opacity: .75;
  font-size: 10px;
  font-weight: 800;
}
.rgz-pneumatic-studio-root,
.rgz-pneumatic-studio-root * {
  box-sizing: border-box;
}

.rgz-pneumatic-studio-root {
  --rgz-bg: #070b16;
  --rgz-bg-2: #0a1024;
  --rgz-panel: rgba(15, 23, 42, .94);
  --rgz-panel-solid: #0f172a;
  --rgz-panel-2: rgba(17, 28, 51, .92);
  --rgz-card: rgba(255, 255, 255, .055);
  --rgz-card-2: rgba(255, 255, 255, .08);
  --rgz-line: #263554;
  --rgz-line-2: #354568;
  --rgz-text: #f3efe7;
  --rgz-muted: #93a4bd;
  --rgz-muted-2: #64748b;
  --rgz-accent: #e8793c;
  --rgz-accent-2: #38bdf8;
  --rgz-success: #22c55e;
  --rgz-warning: #f59e0b;
  --rgz-danger: #ef4444;
  --rgz-blue: #60a5fa;
  --rgz-shadow: 0 18px 60px rgba(0,0,0,.35);
  --rgz-radius: 18px;
  --rgz-radius-sm: 12px;
  --rgz-sidebar: 286px;
  --rgz-inspector: 342px;
  --rgz-header: 74px;
  color: var(--rgz-text);
  background:
    radial-gradient(circle at 10% 0%, rgba(232,121,60,.10), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(56,189,248,.08), transparent 30%),
    linear-gradient(180deg, var(--rgz-bg-2), var(--rgz-bg));
  min-height: 100vh;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  position: relative;
  isolation: isolate;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  direction: ltr;
}

.rgz-pneumatic-studio-root:fullscreen,
.rgz-pneumatic-studio-root.rgz-fallback-fullscreen {
  width: 100vw;
  height: 100vh;
  margin-left: 0;
  background: var(--rgz-bg);
}

.rgz-pneumatic-studio-root.rgz-fallback-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 999999;
}

.rgz-pneumatic-studio-root:fullscreen .rgz-app,
.rgz-pneumatic-studio-root.rgz-fallback-fullscreen .rgz-app {
  width: 100vw;
  height: 100vh;
}

#rgz-canvas.rgz-ctrl-pan {
  cursor: grab;
}
#rgz-canvas.rgz-ctrl-pan:active {
  cursor: grabbing;
}

.rgz-app {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  background: linear-gradient(180deg, rgba(7,11,22,.86), rgba(7,11,22,.98));
}

.rgz-topbar {
  height: var(--rgz-header);
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 18px;
  background: rgba(7, 11, 22, .82);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 20;
}

.rgz-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.rgz-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(232,121,60,.5);
  color: var(--rgz-accent);
  background: radial-gradient(circle at 30% 20%, rgba(232,121,60,.24), rgba(255,255,255,.04));
  border-radius: 14px;
  font-weight: 900;
  letter-spacing: -.06em;
  box-shadow: 0 0 0 4px rgba(232,121,60,.06);
}

.rgz-brand h1 {
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1;
  margin: 0;
  letter-spacing: -.035em;
}

.rgz-brand p {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--rgz-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rgz-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.rgz-btn,
.rgz-select,
.rgz-input,
.rgz-small-input,
.rgz-inspector textarea {
  border: 1px solid rgba(255,255,255,.11);
  background: rgba(255,255,255,.055);
  color: var(--rgz-text);
  border-radius: 999px;
  min-height: 38px;
  padding: 0 13px;
  font: inherit;
  outline: none;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.rgz-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.rgz-btn:hover {
  background: rgba(255,255,255,.095);
  border-color: rgba(255,255,255,.22);
  transform: translateY(-1px);
}

.rgz-btn:active {
  transform: translateY(0);
}

.rgz-btn.primary {
  background: linear-gradient(135deg, var(--rgz-accent), #f59e0b);
  color: #190b04;
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 12px 32px rgba(232,121,60,.22);
}

.rgz-btn.blue {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: white;
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 12px 32px rgba(56,189,248,.18);
}

.rgz-btn.green {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: white;
  border-color: rgba(255,255,255,.1);
}

.rgz-btn.danger {
  color: #fecaca;
  border-color: rgba(239,68,68,.34);
  background: rgba(239,68,68,.12);
}

.rgz-btn.icon {
  min-width: 38px;
  width: 38px;
  padding: 0;
  font-size: 17px;
}

.rgz-btn[disabled] {
  opacity: .42;
  cursor: not-allowed;
  transform: none;
}

.rgz-main {
  display: grid;
  grid-template-columns: var(--rgz-sidebar) minmax(420px, 1fr) var(--rgz-inspector);
  height: calc(100vh - var(--rgz-header));
  min-height: 0;
}

.rgz-sidebar,
.rgz-inspector {
  background: rgba(7,11,22,.66);
  backdrop-filter: blur(18px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}

.rgz-sidebar {
  border-right: 1px solid rgba(255,255,255,.08);
  padding: 14px;
}

.rgz-inspector {
  border-left: 1px solid rgba(255,255,255,.08);
  padding: 14px;
}

.rgz-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 3px 0 10px;
}

.rgz-section-title h2,
.rgz-panel-title {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--rgz-muted);
  font-weight: 850;
}

.rgz-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  color: var(--rgz-muted);
  font-size: 11px;
  background: rgba(255,255,255,.045);
}

.rgz-search {
  margin: 9px 0 12px;
}

.rgz-input,
.rgz-select {
  width: 100%;
  height: 40px;
  border-radius: 13px;
  color-scheme: dark;
}

.rgz-small-input {
  width: 100%;
  min-height: 34px;
  border-radius: 10px;
  padding: 0 10px;
  color-scheme: dark;
}

.rgz-inspector textarea {
  width: 100%;
  min-height: 76px;
  border-radius: 12px;
  padding: 10px;
  resize: vertical;
  color-scheme: dark;
}

.rgz-category {
  margin: 12px 0 16px;
}

.rgz-category summary {
  cursor: pointer;
  color: var(--rgz-text);
  font-size: 13px;
  font-weight: 800;
  padding: 10px 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  background: rgba(255,255,255,.045);
  user-select: none;
}

.rgz-symbol-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  padding-top: 9px;
}

.rgz-symbol-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 8px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,.09);
  background: linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.035));
  cursor: grab;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}

.rgz-symbol-card:hover {
  transform: translateY(-1px);
  border-color: rgba(232,121,60,.42);
  background: linear-gradient(145deg, rgba(232,121,60,.11), rgba(255,255,255,.055));
}

.rgz-symbol-card:active {
  cursor: grabbing;
}

.rgz-symbol-icon {
  width: 58px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}

.rgz-symbol-icon svg {
  width: 50px;
  height: 38px;
  overflow: visible;
}

.rgz-symbol-name {
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 3px;
}

.rgz-symbol-desc {
  font-size: 11px;
  line-height: 1.3;
  color: var(--rgz-muted);
}

.rgz-workspace {
  position: relative;
  overflow: hidden;
  background: #08101f;
}

.rgz-canvas-toolbar {
  position: absolute;
  left: 16px;
  top: 14px;
  right: 16px;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.rgz-canvas-toolbar > * {
  pointer-events: auto;
}

.rgz-tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(7,11,22,.68);
  backdrop-filter: blur(10px);
  color: var(--rgz-muted);
  font-size: 12px;
}

.rgz-canvas-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#rgz-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
  background: #07101f;
}

.rgz-canvas-grid-major {
  stroke: rgba(148,163,184,.12);
  stroke-width: 1;
}

.rgz-canvas-grid-minor {
  stroke: rgba(148,163,184,.06);
  stroke-width: 1;
}

.rgz-connection-path {
  fill: none;
  stroke: #d9e7ff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.28));
  cursor: pointer;
  transition: stroke .15s ease, stroke-width .15s ease, opacity .15s ease;
}

.rgz-connection-path.pressure { stroke: #93c5fd; }
.rgz-connection-path.return { stroke: #a7f3d0; }
.rgz-connection-path.pilot { stroke: #fbbf24; stroke-dasharray: 8 8; }
.rgz-connection-path.drain { stroke: #c4b5fd; stroke-dasharray: 3 7; }
.rgz-connection-path.electrical { stroke: #f0abfc; stroke-dasharray: 10 6 2 6; }

.rgz-connection-path.selected {
  stroke: var(--rgz-accent);
  stroke-width: 5;
}

.rgz-connection-path.sim-active {
  stroke: var(--rgz-accent-2);
  stroke-dasharray: 18 12;
  animation: rgz-flow 1.05s linear infinite;
  filter: drop-shadow(0 0 9px rgba(56,189,248,.45));
}

.rgz-connection-path.sim-high {
  stroke: #fb7185;
  filter: drop-shadow(0 0 10px rgba(251,113,133,.48));
}

@keyframes rgz-flow {
  to { stroke-dashoffset: -60; }
}

.rgz-component {
  cursor: move;
}

.rgz-component .symbol-stroke {
  stroke: #f8fafc;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rgz-component .symbol-fill {
  fill: rgba(255,255,255,.07);
  stroke: #f8fafc;
  stroke-width: 2.2;
}

.rgz-component .symbol-muted {
  stroke: #94a3b8;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rgz-component .symbol-accent {
  stroke: var(--rgz-accent);
  fill: none;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rgz-component.selected .selection-box {
  stroke: var(--rgz-accent);
  stroke-width: 1.7;
  fill: rgba(232,121,60,.08);
  stroke-dasharray: 7 6;
}

.rgz-component .selection-box {
  stroke: transparent;
  fill: transparent;
  pointer-events: none;
}

.rgz-component .port {
  fill: #08101f;
  stroke: #38bdf8;
  stroke-width: 2.5;
  cursor: crosshair;
  filter: drop-shadow(0 0 5px rgba(56,189,248,.45));
}

.rgz-component .port.pending {
  stroke: var(--rgz-accent);
  fill: rgba(232,121,60,.5);
}

.rgz-component .port-label {
  fill: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
  paint-order: stroke;
  stroke: #07101f;
  stroke-width: 3;
}

.rgz-component .component-label {
  fill: #f8fafc;
  font-size: 13px;
  font-weight: 850;
  pointer-events: none;
  paint-order: stroke;
  stroke: #07101f;
  stroke-width: 4;
}

.rgz-component.sim-moving .symbol-accent,
.rgz-component.sim-moving .symbol-stroke {
  stroke: #38bdf8;
  filter: drop-shadow(0 0 8px rgba(56,189,248,.38));
}

.rgz-bottom-panel {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 10;
  max-height: 230px;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(7,11,22,.76);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
}

.rgz-bottom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.rgz-message-list {
  padding: 10px 12px 12px;
  display: grid;
  gap: 8px;
}

.rgz-message {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  padding: 9px 10px;
  background: rgba(255,255,255,.045);
  font-size: 12px;
  line-height: 1.35;
}

.rgz-message strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.rgz-message.error { border-color: rgba(239,68,68,.38); background: rgba(239,68,68,.11); }
.rgz-message.warning { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.11); }
.rgz-message.info { border-color: rgba(56,189,248,.34); background: rgba(56,189,248,.08); }
.rgz-message.ok { border-color: rgba(34,197,94,.36); background: rgba(34,197,94,.1); }

.rgz-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.rgz-tab {
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.045);
  color: var(--rgz-muted);
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.rgz-tab.active {
  color: var(--rgz-text);
  border-color: rgba(232,121,60,.42);
  background: rgba(232,121,60,.13);
}

.rgz-panel {
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.045);
  border-radius: 17px;
  padding: 13px;
  margin-bottom: 12px;
}

.rgz-panel p,
.rgz-help {
  color: var(--rgz-muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 7px 0 0;
}

.rgz-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rgz-field {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.rgz-field label {
  color: var(--rgz-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}

.rgz-kv {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.rgz-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 11px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.06);
  font-size: 12px;
}

.rgz-kv-row span:first-child {
  color: var(--rgz-muted);
}

.rgz-kv-row span:last-child {
  font-weight: 850;
  color: var(--rgz-text);
  text-align: right;
}

.rgz-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--rgz-muted-2);
  box-shadow: 0 0 0 4px rgba(148,163,184,.08);
}

.rgz-status-dot.running {
  background: var(--rgz-success);
  box-shadow: 0 0 0 4px rgba(34,197,94,.12), 0 0 18px rgba(34,197,94,.55);
}

.rgz-print-title-block {
  display: none;
}

.rgz-disclaimer {
  font-size: 11px;
  color: var(--rgz-muted);
  line-height: 1.45;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(255,255,255,.16);
  background: rgba(255,255,255,.035);
}

.rgz-toast-wrap {
  position: absolute;
  z-index: 50;
  right: 16px;
  top: calc(var(--rgz-header) + 16px);
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.rgz-toast {
  width: min(360px, calc(100vw - 32px));
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(7,11,22,.88);
  backdrop-filter: blur(14px);
  border-radius: 15px;
  padding: 11px 13px;
  font-size: 12px;
  color: var(--rgz-text);
  box-shadow: var(--rgz-shadow);
  animation: rgz-toast-in .22s ease both;
}

@keyframes rgz-toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.rgz-mobile-note {
  display: none;
  padding: 10px 14px;
  background: rgba(245,158,11,.12);
  border-bottom: 1px solid rgba(245,158,11,.28);
  color: #fde68a;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .rgz-pneumatic-studio-root {
    --rgz-sidebar: 238px;
    --rgz-inspector: 302px;
  }
  .rgz-topbar {
    grid-template-columns: 1fr;
    height: auto;
  }
  .rgz-main {
    height: calc(100vh - 132px);
  }
}

@media (max-width: 920px) {
  .rgz-mobile-note { display: block; }
  .rgz-main {
    grid-template-columns: 1fr;
    height: auto;
  }
  .rgz-sidebar,
  .rgz-inspector {
    max-height: 360px;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .rgz-workspace {
    height: 680px;
    order: 2;
  }
  .rgz-sidebar { order: 1; }
  .rgz-inspector { order: 3; }
}

@media print {
  body * {
    visibility: hidden !important;
  }
  .rgz-pneumatic-studio-root,
  .rgz-pneumatic-studio-root * {
    visibility: visible !important;
  }
  .rgz-pneumatic-studio-root {
    background: white !important;
    color: black !important;
    position: absolute;
    inset: 0;
    width: 100% !important;
    min-height: auto !important;
    font-family: Arial, sans-serif;
  }
  .rgz-app {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: white !important;
    min-height: auto !important;
  }
  .rgz-topbar,
  .rgz-sidebar,
  .rgz-inspector,
  .rgz-bottom-panel,
  .rgz-canvas-toolbar,
  .rgz-toast-wrap,
  .rgz-mobile-note {
    display: none !important;
  }
  .rgz-main {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .rgz-workspace {
    position: static !important;
    height: calc(100vh - 116px) !important;
    background: white !important;
    overflow: visible !important;
  }
  .rgz-canvas-wrap {
    position: static !important;
    height: 100% !important;
    border: 1px solid #111;
  }
  #rgz-canvas {
    height: 100% !important;
    background: white !important;
  }
  .rgz-canvas-grid-minor,
  .rgz-canvas-grid-major {
    stroke: #e5e7eb !important;
  }
  .rgz-component .symbol-stroke,
  .rgz-component .symbol-muted,
  .rgz-component .symbol-fill {
    stroke: black !important;
  }
  .rgz-component .symbol-fill {
    fill: white !important;
  }
  .rgz-component .component-label,
  .rgz-component .port-label {
    fill: black !important;
    stroke: white !important;
  }
  .rgz-component .port {
    fill: white !important;
    stroke: black !important;
    filter: none !important;
  }
  .rgz-connection-path,
  .rgz-connection-path.pressure,
  .rgz-connection-path.return,
  .rgz-connection-path.pilot,
  .rgz-connection-path.drain,
  .rgz-connection-path.electrical {
    stroke: black !important;
    filter: none !important;
    animation: none !important;
  }
  .rgz-print-title-block {
    display: grid !important;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0;
    border: 1px solid #111;
    border-top: none;
    font-size: 10px;
    color: #111;
  }
  .rgz-print-title-block > div {
    padding: 7px 8px;
    border-right: 1px solid #111;
    min-height: 34px;
  }
  .rgz-print-title-block > div:nth-child(3n) {
    border-right: none;
  }
  @page {
    size: A4 landscape;
    margin: 8mm;
  }
}

/* Improvements requested for the first release */
.rgz-select option,
.rgz-small-input option,
.rgz-input option {
  background: #0f172a;
  color: #f8fafc;
}

.rgz-examples-panel {
  border-color: rgba(232,121,60,.42);
  background: linear-gradient(145deg, rgba(232,121,60,.13), rgba(56,189,248,.06));
  box-shadow: 0 12px 36px rgba(232,121,60,.08);
}

.rgz-examples-panel .rgz-select {
  background: #111c33;
  color: #f8fafc;
  border-color: rgba(232,121,60,.45);
  font-weight: 750;
}

.rgz-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, .66);
  backdrop-filter: blur(10px);
}

.rgz-modal {
  width: min(760px, calc(100vw - 40px));
  max-height: min(840px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.16);
  background: #0b1224;
  color: var(--rgz-text);
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
  overflow: hidden;
}

.rgz-modal-head,
.rgz-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  background: rgba(255,255,255,.045);
  border-bottom: 1px solid rgba(255,255,255,.09);
}

.rgz-modal-foot {
  border-top: 1px solid rgba(255,255,255,.09);
  border-bottom: 0;
  color: var(--rgz-muted);
  font-size: 12px;
}

.rgz-modal-head h3 {
  margin: 0 0 5px;
  font-size: 18px;
  letter-spacing: -.02em;
}

.rgz-modal-head p {
  margin: 0;
  color: var(--rgz-muted);
  font-size: 12px;
  line-height: 1.4;
}

.rgz-modal-body {
  overflow: auto;
  padding: 14px;
}

/* Readable simple black list/dropdown colors */
.rgz-select,
select.rgz-small-input,
.rgz-examples-panel .rgz-select {
  background: #ffffff !important;
  color: #111827 !important;
  border-color: #111827 !important;
}

.rgz-select option,
select.rgz-small-input option,
.rgz-input option {
  background: #ffffff !important;
  color: #111827 !important;
}

/* Dedicated app-page cleanup: remove bottom whitespace from WordPress/Elementor wrappers where supported */
body:has(#rgz-pneumatic-studio),
html:has(#rgz-pneumatic-studio) {
  background: #070b16 !important;
}

body:has(#rgz-pneumatic-studio) .entry-content,
body:has(#rgz-pneumatic-studio) .elementor,
body:has(#rgz-pneumatic-studio) .elementor-section,
body:has(#rgz-pneumatic-studio) .elementor-container,
body:has(#rgz-pneumatic-studio) .elementor-widget-container {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.rgz-pneumatic-studio-root {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  margin-bottom: 0 !important;
}

.rgz-app {
  height: 100dvh;
  min-height: 100dvh;
}

.rgz-main {
  height: calc(100dvh - var(--rgz-header));
}

.rgz-example-list {
  display: grid;
  gap: 7px;
  max-height: 248px;
  overflow: auto;
  padding: 3px 2px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(232,121,60,.65) rgba(255,255,255,.08);
}

.rgz-example-card {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 9px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: #0b1224;
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

.rgz-example-card:hover {
  transform: translateY(-1px);
  border-color: rgba(232,121,60,.66);
  background: #111c33;
}

.rgz-example-card span {
  display: grid;
  place-items: center;
  height: 28px;
  border-radius: 9px;
  background: rgba(232,121,60,.16);
  color: #ffedd5;
  font-size: 12px;
  font-weight: 900;
}

.rgz-example-card strong {
  color: #ffffff;
  font-size: 12px;
  line-height: 1.22;
  font-weight: 800;
}

.rgz-pneumatic-studio-root select,
.rgz-pneumatic-studio-root option,
.rgz-pneumatic-studio-root optgroup {
  background-color: #ffffff !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  text-shadow: none !important;
}

/* True fullscreen web-app mounting for the WordPress page */
.rgz-pneumatic-studio-root {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  overflow: hidden !important;
}

body.admin-bar .rgz-pneumatic-studio-root {
  top: 32px !important;
  height: calc(100dvh - 32px) !important;
  min-height: calc(100dvh - 32px) !important;
}

body:has(#rgz-pneumatic-studio) {
  overflow: hidden !important;
  min-height: 100dvh !important;
  background: #070b16 !important;
}

@media (max-width: 782px) {
  body.admin-bar .rgz-pneumatic-studio-root {
    top: 46px !important;
    height: calc(100dvh - 46px) !important;
    min-height: calc(100dvh - 46px) !important;
  }
}

/* Select-like predesigned circuit picker: keeps the old compact style but uses controlled colors */
.rgz-custom-select {
  position: relative;
  z-index: 30;
}

.rgz-example-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.rgz-example-trigger span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rgz-example-trigger b {
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
}

.rgz-example-menu {
  display: none;
  position: absolute;
  z-index: 500;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 320px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #111827;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  padding: 5px;
}

.rgz-custom-select.open .rgz-example-menu {
  display: grid;
  gap: 2px;
}

.rgz-example-option {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.rgz-example-option span,
.rgz-example-option strong {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

.rgz-example-option span {
  font-weight: 850;
  font-size: 12px;
}

.rgz-example-option strong {
  font-weight: 650;
  font-size: 13px;
  line-height: 1.25;
}

.rgz-example-option:hover,
.rgz-example-option.active {
  background: #dbeafe;
}

html.rgz-pneumatic-page,
body.rgz-pneumatic-page {
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #070b16 !important;
}

.rgz-print-area-rect {
  fill: rgba(232,121,60,.06);
  stroke: rgba(232,121,60,.8);
  stroke-width: 2;
  stroke-dasharray: 12 8;
  pointer-events: none;
}

.rgz-print-area-label {
  fill: #fed7aa;
  font-size: 13px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #07101f;
  stroke-width: 4;
  pointer-events: none;
}

.rgz-example-group {
  padding: 8px 9px 5px;
  color: #6b7280;
  background: #f3f4f6;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-radius: 7px;
  margin-top: 4px;
}

.rgz-selector-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.rgz-examples-panel .rgz-field {
  margin-top: 8px;
}

.rgz-examples-panel .rgz-example-menu {
  max-height: 360px;
}

.rgz-connection-path.sim-pressure {
  filter: drop-shadow(0 0 12px rgba(239,68,68,.45));
}

.rgz-connection-path.sim-pressure.pressure,
.rgz-connection-path.sim-pressure.return,
.rgz-connection-path.sim-pressure.pilot,
.rgz-connection-path.sim-pressure.drain {
  opacity: 1;
}

/* Better pre-designed title fitting */
.rgz-examples-panel {
  overflow: visible;
}

.rgz-selector-row .rgz-custom-select {
  width: 100%;
  min-width: 0;
}

.rgz-example-trigger {
  min-height: 48px;
  height: auto;
  align-items: flex-start;
  padding-top: 9px;
  padding-bottom: 9px;
}

.rgz-example-trigger span {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.28;
  word-break: normal;
  overflow-wrap: anywhere;
  max-width: calc(100% - 22px);
}

.rgz-example-menu {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.rgz-example-option {
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  min-height: 40px;
}

.rgz-example-option strong {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

/* Final hardening for long pre-designed circuit titles */
.rgz-custom-select,
.rgz-example-trigger,
.rgz-example-menu,
.rgz-example-option {
  box-sizing: border-box !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
}

.rgz-example-trigger {
  width: 100% !important;
  white-space: normal !important;
  overflow: hidden !important;
}

.rgz-example-trigger span {
  display: block !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

.rgz-example-menu {
  left: 0 !important;
  right: auto !important;
  width: 100% !important;
}

.rgz-example-option strong {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* Account and popup-based pre-designed circuit browser */
.rgz-examples-modal .rgz-modal-body,
.rgz-auth-modal .rgz-modal-body {
  overflow: visible;
}

.rgz-example-modal-grid {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.5fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

.rgz-examples-modal .rgz-example-menu {
  max-height: min(54vh, 520px);
}

.rgz-example-preview {
  font-size: 14px;
  color: var(--rgz-text);
  font-weight: 800;
  line-height: 1.45;
}

.rgz-design-list {
  display: grid;
  gap: 9px;
  max-height: 420px;
  overflow: auto;
}

.rgz-design-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.045);
  border-radius: 14px;
}

.rgz-design-row strong {
  display: block;
  color: var(--rgz-text);
  overflow-wrap: anywhere;
}

.rgz-design-row span {
  display: block;
  margin-top: 3px;
  color: var(--rgz-muted);
  font-size: 11px;
  line-height: 1.35;
}

.rgz-design-row > div:last-child {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .rgz-example-modal-grid,
  .rgz-design-row {
    grid-template-columns: 1fr;
  }
}

/* Clean professional native dropdowns in the pre-designed popup */
.rgz-native-select {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: #ffffff !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  outline: none;
}

.rgz-native-select option {
  background: #ffffff !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  font-weight: 600;
  white-space: normal;
}

.rgz-examples-modal .rgz-modal-body {
  overflow: visible;
}

/* Dynamic simulation readouts */
.rgz-readout-bg {
  fill: rgba(2, 6, 23, .88);
  stroke: rgba(255,255,255,.24);
  stroke-width: 1.2;
  filter: drop-shadow(0 5px 12px rgba(0,0,0,.35));
}
.rgz-readout-text {
  fill: #ffffff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .01em;
  pointer-events: none;
}

/* Modal hardening: prevent popups from flowing to page bottom */
.rgz-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000005 !important;
  display: grid !important;
  place-items: center !important;
  overflow: auto !important;
}

/* Portrait mobile lock screen with animated rotate hint */
.rgz-orientation-card {
  display: grid;
  place-items: center;
  gap: 12px;
  max-width: 360px;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.14);
  background: radial-gradient(circle at 30% 10%, rgba(232,121,60,.22), rgba(15,23,42,.96));
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}
.rgz-orientation-card h2 { margin: 6px 0 0; color: #fff; font-size: 24px; }
.rgz-orientation-card p { margin: 0; color: #cbd5e1; line-height: 1.5; }
.rgz-phone-rotate {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}
.rgz-phone-rotate span {
  width: 35px;
  height: 58px;
  border: 4px solid #fff;
  border-radius: 10px;
  position: relative;
  animation: rgz-phone-rotate 1.8s ease-in-out infinite;
}
.rgz-phone-rotate span::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 6px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #e8793c;
}
@keyframes rgz-phone-rotate {
  0%, 20% { transform: rotate(0deg); }
  55%, 80% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}

/* Landscape mobile/tablet drawer UI */
.rgz-mobile-landscape-bar { display: none; }
@media (max-width: 920px) and (orientation: landscape) {
  .rgz-pneumatic-studio-root { --rgz-header: 62px; }
  .rgz-topbar {
    height: var(--rgz-header) !important;
    grid-template-columns: auto 1fr auto;
    padding: 8px 10px;
  }
  .rgz-brand p { display: none; }
  .rgz-brand h1 { font-size: 16px; white-space: nowrap; }
  .rgz-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 12px; }
  .rgz-mobile-landscape-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
  }
  .rgz-mobile-landscape-bar .rgz-btn { min-height: 36px; font-size: 12px; padding: 0 10px; }
  .rgz-main { grid-template-columns: 1fr !important; height: calc(100dvh - var(--rgz-header)) !important; }
  .rgz-workspace { height: calc(100dvh - var(--rgz-header)) !important; order: 1 !important; }
  .rgz-sidebar, .rgz-inspector {
    position: fixed !important;
    top: var(--rgz-header) !important;
    bottom: 0 !important;
    width: min(340px, 88vw) !important;
    max-height: none !important;
    z-index: 80 !important;
    background: rgba(7,11,22,.96) !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    transition: transform .2s ease;
  }
  .rgz-sidebar { left: 0; transform: translateX(-104%); }
  .rgz-inspector { right: 0; transform: translateX(104%); }
  .rgz-pneumatic-studio-root.rgz-show-library .rgz-sidebar { transform: translateX(0); }
  .rgz-pneumatic-studio-root.rgz-show-inspector .rgz-inspector { transform: translateX(0); }
  .rgz-actions {
    display: none;
    position: fixed;
    z-index: 90;
    top: calc(var(--rgz-header) + 8px);
    right: 10px;
    left: 10px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(7,11,22,.96);
    box-shadow: 0 20px 70px rgba(0,0,0,.45);
    justify-content: flex-start;
  }
  .rgz-pneumatic-studio-root.rgz-show-actions .rgz-actions { display: flex; }
  .rgz-bottom-panel { max-height: 150px; }
}

@media print {
  .rgz-readout-bg { fill: #fff !important; stroke: #111 !important; filter: none !important; }
  .rgz-readout-text { fill: #111 !important; }
}

/* Mobile landscape refinement for iPhone-mini class screens */
@media (max-width: 920px) and (orientation: landscape) {
  .rgz-pneumatic-studio-root {
    --rgz-header: 42px !important;
    height: var(--rgz-vh, 100dvh) !important;
    min-height: var(--rgz-vh, 100dvh) !important;
  }
  .rgz-app { height: var(--rgz-vh, 100dvh) !important; min-height: var(--rgz-vh, 100dvh) !important; }
  .rgz-topbar { height: 42px !important; min-height: 42px !important; padding: 4px 6px !important; gap: 5px !important; }
  .rgz-brand { gap: 6px !important; }
  .rgz-brand h1 { font-size: 10px !important; letter-spacing: -.02em !important; }
  .rgz-mark { width: 24px !important; height: 24px !important; border-radius: 8px !important; font-size: 8px !important; }
  .rgz-mobile-landscape-bar { gap: 4px !important; }
  .rgz-mobile-landscape-bar .rgz-btn,
  .rgz-actions .rgz-btn,
  .rgz-sidebar .rgz-btn,
  .rgz-inspector .rgz-btn,
  .rgz-mobile-sim-controls .rgz-btn {
    min-height: 22px !important;
    height: 22px !important;
    padding: 0 6px !important;
    font-size: 8px !important;
    border-radius: 999px !important;
    gap: 3px !important;
  }
  .rgz-main { height: calc(var(--rgz-vh, 100dvh) - 42px) !important; }
  .rgz-workspace { height: calc(var(--rgz-vh, 100dvh) - 42px) !important; }
  .rgz-sidebar, .rgz-inspector {
    top: 42px !important;
    width: min(250px, 78vw) !important;
    padding: 7px !important;
    font-size: 9px !important;
  }
  .rgz-actions {
    top: 48px !important;
    right: 6px !important;
    left: auto !important;
    width: min(300px, 70vw) !important;
    max-height: calc(var(--rgz-vh, 100dvh) - 58px) !important;
    overflow: auto !important;
    padding: 7px !important;
    gap: 5px !important;
    border-radius: 12px !important;
  }
  .rgz-section-title h2, .rgz-panel-title { font-size: 8px !important; letter-spacing: .09em !important; }
  .rgz-badge { min-height: 16px !important; padding: 0 5px !important; font-size: 8px !important; }
  .rgz-panel { padding: 7px !important; border-radius: 10px !important; margin-bottom: 7px !important; }
  .rgz-panel p, .rgz-help { font-size: 8px !important; line-height: 1.3 !important; }
  .rgz-input, .rgz-select, .rgz-small-input, .rgz-inspector textarea {
    min-height: 24px !important;
    height: 24px !important;
    padding: 0 7px !important;
    font-size: 9px !important;
    border-radius: 8px !important;
  }
  .rgz-inspector textarea { height: auto !important; min-height: 44px !important; padding: 6px !important; }
  .rgz-category summary { font-size: 9px !important; padding: 6px 7px !important; border-radius: 8px !important; }
  .rgz-symbol-list { gap: 5px !important; padding-top: 5px !important; }
  .rgz-symbol-card { min-height: 38px !important; grid-template-columns: 34px 1fr !important; gap: 6px !important; padding: 5px !important; border-radius: 9px !important; }
  .rgz-symbol-icon { width: 34px !important; height: 28px !important; border-radius: 7px !important; }
  .rgz-symbol-icon svg { width: 32px !important; height: 24px !important; }
  .rgz-symbol-name { font-size: 8.5px !important; margin-bottom: 1px !important; }
  .rgz-symbol-desc { font-size: 7.5px !important; line-height: 1.15 !important; }
  .rgz-canvas-toolbar { top: 6px !important; left: 7px !important; right: 7px !important; gap: 5px !important; }
  .rgz-tool-pill { min-height: 22px !important; padding: 0 7px !important; font-size: 8px !important; }
  .rgz-bottom-panel {
    left: 7px !important;
    right: 7px !important;
    bottom: 7px !important;
    max-height: 28px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }
  .rgz-bottom-panel.rgz-open { max-height: 110px !important; overflow: auto !important; }
  .rgz-bottom-panel:not(.rgz-open) .rgz-message-list { display: none !important; }
  .rgz-bottom-header { min-height: 26px !important; padding: 3px 6px !important; }
  .rgz-bottom-header .rgz-panel-title { font-size: 8px !important; }
  .rgz-message-list { padding: 5px !important; gap: 4px !important; }
  .rgz-message { font-size: 8px !important; padding: 5px 6px !important; border-radius: 8px !important; }
  .rgz-mobile-sim-controls {
    display: flex !important;
    position: absolute;
    z-index: 16;
    right: 8px;
    bottom: 43px;
    gap: 5px;
    padding: 5px;
    border-radius: 999px;
    background: rgba(7,11,22,.76);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
  }
  .rgz-component .component-label { font-size: 10px !important; }
  .rgz-component .port-label { font-size: 8px !important; }
  .rgz-readout-text { font-size: 9px !important; }
}

@media (min-width: 921px), (orientation: portrait) {
  .rgz-mobile-sim-controls { display: none; }
}

/* Mobile simulation safety and live valve controls */
.rgz-mobile-live-controls { display: none; }
@media (max-width: 920px) and (orientation: landscape) {
  .rgz-mobile-sim-controls {
    z-index: 260 !important;
    bottom: 36px !important;
    right: 7px !important;
  }
  .rgz-mobile-sim-controls .rgz-btn[data-action="stop"] {
    background: #dc2626 !important;
    color: #fff !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .rgz-mobile-live-controls.active {
    display: block;
    position: absolute;
    z-index: 255;
    right: 7px;
    bottom: 72px;
    width: min(300px, 72vw);
    max-height: calc(var(--rgz-vh, 100dvh) - 125px);
    overflow: auto;
    padding: 7px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(7,11,22,.90);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 60px rgba(0,0,0,.45);
  }
  .rgz-mobile-live-controls.rgz-collapsed {
    max-height: 30px;
    overflow: hidden;
  }
  .rgz-mobile-live-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
  }
  .rgz-mobile-control-row {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 5px;
    align-items: center;
    padding: 4px;
    margin-top: 4px;
    border-radius: 9px;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.08);
  }
  .rgz-mobile-control-row strong {
    color: #e2e8f0;
    font-size: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .rgz-mobile-control-row span {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .rgz-mobile-control-row .rgz-btn,
  .rgz-mobile-live-head .rgz-btn {
    min-height: 21px !important;
    height: 21px !important;
    padding: 0 6px !important;
    font-size: 8px !important;
  }
  .rgz-pneumatic-studio-root.rgz-show-actions .rgz-mobile-live-controls.active {
    opacity: .18;
    pointer-events: none;
  }
}

/* When the Properties/Inspector drawer is open on mobile, move simulation controls to the left */
@media (max-width: 920px) and (orientation: landscape) {
  .rgz-pneumatic-studio-root.rgz-show-inspector .rgz-mobile-sim-controls {
    left: 7px !important;
    right: auto !important;
  }
  .rgz-pneumatic-studio-root.rgz-show-inspector .rgz-mobile-live-controls.active {
    left: 7px !important;
    right: auto !important;
    width: min(300px, 62vw) !important;
  }
  .rgz-pneumatic-studio-root.rgz-show-library .rgz-mobile-sim-controls,
  .rgz-pneumatic-studio-root.rgz-show-library .rgz-mobile-live-controls.active {
    right: 7px !important;
    left: auto !important;
  }
  .rgz-pneumatic-studio-root.rgz-show-actions .rgz-mobile-sim-controls {
    left: 7px !important;
    right: auto !important;
  }
}

/* Mobile zoom buttons */
.rgz-mobile-zoom {
  min-width: 28px !important;
  width: 28px !important;
  padding: 0 !important;
  font-weight: 950 !important;
}
@media (max-width: 920px) and (orientation: landscape) {
  .rgz-mobile-landscape-bar .rgz-mobile-zoom {
    min-width: 24px !important;
    width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    font-size: 13px !important;
    background: rgba(232,121,60,.18) !important;
    border-color: rgba(232,121,60,.38) !important;
    color: #fff !important;
  }
}

/* Desktop file/account dropdown menu */
.rgz-file-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.rgz-file-menu-list {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 120;
  min-width: 230px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(7,11,22,.98);
  box-shadow: 0 22px 70px rgba(0,0,0,.45);
  backdrop-filter: blur(14px);
  gap: 6px;
}
.rgz-file-menu.open .rgz-file-menu-list {
  display: grid;
}
.rgz-file-menu-list .rgz-btn {
  justify-content: flex-start;
  width: 100%;
}
.rgz-file-menu-list hr {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.1);
  margin: 4px 0;
}
@media (max-width: 920px) and (orientation: landscape) {
  .rgz-file-menu { width: 100%; display: grid; }
  .rgz-file-menu > .rgz-btn { width: 100%; }
  .rgz-file-menu-list {
    position: static;
    min-width: 0;
    box-shadow: none;
    margin-top: 6px;
    background: rgba(255,255,255,.045);
  }
}

/* Library sub-categories */
.rgz-subcategory-wrap {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}
.rgz-subcategory {
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  overflow: hidden;
}
.rgz-subcategory summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 9px;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 850;
  background: rgba(255,255,255,.04);
}
.rgz-subcategory summary::-webkit-details-marker { display: none; }
.rgz-subcategory .rgz-symbol-list { padding: 7px; }
.rgz-subcount {
  float: right;
  opacity: .75;
  font-size: 10px;
  font-weight: 800;
}
