@import url("https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&family=Roboto:ital,wght@0,100..900;1,100..900&family=Sora:wght@100..800&display=swap");

/* Dedicated app pages must fit the iframe without default browser margins. */
html.four-bar-document,
html.four-bar-document > body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.four-bar-app {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --background-color: #f0f0f0;
  --text-color: #333;
  --sidebar-width: 320px;

  /* Body styles merged here */
  font-family: Roboto, sans-serif;
  line-height: 1.4;
  color: var(--text-color);
  background-color: var(--background-color);
  font-weight: 400;
  font-size: 13px;
  
  /* App Container styles merged here */
  height: 100vh; /* Can be overridden by parent if needed */
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2vw, 22px) clamp(28px, 4vw, 64px);
  gap: 14px;
  margin: 0;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.four-bar-app * {
  box-sizing: border-box;
}

.four-bar-app h1 {
  text-align: center;
  color: var(--primary-color);
  margin: 0;
  padding: 5px 0;
  font-size: 1.5em;
  flex-shrink: 0;
}

/* Export Toolbar */
.four-bar-app .export-toolbar {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 15px;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.four-bar-app .toolbar-spacer {
  display: none;
}

.four-bar-app .toolbar-menu {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
}

.four-bar-app .toolbar-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid #d7dde3;
  border-radius: 999px;
  background: #f7f9fb;
  color: #445362;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.four-bar-app .toolbar-menu-button:hover,
.four-bar-app .toolbar-menu-button[aria-expanded="true"] {
  background: #eef4f9;
  border-color: #bcccdc;
}

.four-bar-app .toolbar-menu-icon {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: #5f6d7b;
  transition: transform 0.2s ease;
}

.four-bar-app .toolbar-menu-button[aria-expanded="true"] .toolbar-menu-icon {
  transform: translateY(1px);
}

.four-bar-app .toolbar-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  padding: 8px;
  border: 1px solid #dbe3ea;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 35;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.four-bar-app .toolbar-menu-button[aria-expanded="true"] + .toolbar-menu-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.four-bar-app .toolbar-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #465666;
  font-size: 12px;
  cursor: pointer;
}

.four-bar-app .toolbar-menu-item:hover {
  background: #f3f7fa;
}

.four-bar-app .toolbar-menu-item input {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.four-bar-app .toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.four-bar-app .toolbar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  background: #f7f9fb;
  color: #4a4a4a;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.four-bar-app .toolbar-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.four-bar-app .export-toolbar select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  background: white;
  cursor: pointer;
}

.four-bar-app .export-toolbar button {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.3s;
  width: auto;
  flex: none;
}

.four-bar-app .export-toolbar .toolbar-tooltip-button {
  position: relative;
}

.four-bar-app .export-toolbar .toolbar-tooltip-button::before,
.four-bar-app .export-toolbar .toolbar-tooltip-button::after {
  position: absolute;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 30;
}

.four-bar-app .export-toolbar .toolbar-tooltip-button::before {
  content: attr(data-tooltip);
  bottom: calc(100% + 10px);
  transform: translate(-50%, 4px);
  min-width: 180px;
  max-width: 260px;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(28, 28, 28, 0.96);
  color: #fff;
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.four-bar-app .export-toolbar .toolbar-tooltip-button::after {
  content: "";
  bottom: calc(100% + 4px);
  transform: translate(-50%, 4px);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(28, 28, 28, 0.96) transparent transparent transparent;
}

.four-bar-app .export-toolbar .toolbar-tooltip-button:hover::before,
.four-bar-app .export-toolbar .toolbar-tooltip-button:hover::after,
.four-bar-app .export-toolbar .toolbar-tooltip-button:focus-visible::before,
.four-bar-app .export-toolbar .toolbar-tooltip-button:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.four-bar-app .export-toolbar button:hover {
  background-color: #27ae60;
}

.four-bar-app .export-toolbar #play,
.four-bar-app .export-toolbar #reset {
  background-color: var(--primary-color);
}

.four-bar-app .export-toolbar #play:hover,
.four-bar-app .export-toolbar #reset:hover {
  background-color: #2980b9;
}

.four-bar-app .export-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.four-bar-app .export-checkbox input {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.four-bar-app .export-modal {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.four-bar-app .export-modal.open {
  display: flex;
}

.four-bar-app .export-modal-dialog {
  width: min(460px, 100%);
  max-height: min(90vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  padding: 18px;
}

.four-bar-app .export-modal-header,
.four-bar-app .export-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.four-bar-app .export-modal-header {
  margin-bottom: 14px;
}

.four-bar-app .export-modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-color);
}

.four-bar-app .export-modal-close {
  width: 34px;
  min-width: 34px;
  flex: 0 0 34px;
  padding: 6px 10px;
  background: #e7e7e7;
  color: #444;
}

.four-bar-app .export-modal-close:hover,
.four-bar-app .export-modal-cancel:hover {
  background: #d8d8d8;
}

.four-bar-app .export-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.four-bar-app .export-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #666;
}

.four-bar-app .export-modal-field select,
.four-bar-app .export-modal-field input[type="number"] {
  padding: 7px 9px;
  border: 1px solid #d7d7d7;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}

.four-bar-app .export-modal-checkbox {
  justify-content: flex-start;
}

.four-bar-app .export-option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.four-bar-app .export-option-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  background: #fafafa;
}

.four-bar-app .export-option-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.four-bar-app .export-option-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.four-bar-app .export-option-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.four-bar-app .export-option-description {
  font-size: 12px;
  color: #666;
}

.four-bar-app .export-option-row-csv {
  flex-direction: column;
  align-items: stretch;
}

.four-bar-app .export-option-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.four-bar-app .export-option-row-svg {
  flex-direction: column;
  align-items: stretch;
}

.four-bar-app .export-option-extra {
  margin-left: 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
}

.four-bar-app .export-option-extra-svg .export-modal-field {
  min-width: 150px;
}

.four-bar-app .export-steps-field {
  margin-left: 26px;
}

.four-bar-app .export-steps-field input:disabled {
  background: #f0f0f0;
  color: #888;
  cursor: not-allowed;
}

.four-bar-app .export-modal-footer {
  margin-top: 18px;
  justify-content: flex-end;
}

.four-bar-app .export-modal-cancel {
  background: #e7e7e7;
  color: #444;
}

/* Simulator: Side-by-side layout */
.four-bar-app .simulator {
  display: flex;
  gap: 18px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.four-bar-app .workspace-panel {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  gap: 0;
  transition: gap 0.38s ease;
}

.four-bar-app .simulator.show-plots .workspace-panel {
  gap: 18px;
}

/* Canvas Section */
.four-bar-app .canvas-container {
  --grid-spacing-x: 20px;
  --grid-spacing-y: 20px;
  --grid-origin-x: 50%;
  --grid-origin-y: 50%;
  flex: 1;
  min-width: 300px;
  overflow: hidden;
  border: 1px solid #ccc;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: flex-basis 0.38s ease, max-width 0.38s ease, min-width 0.38s ease;
}

.four-bar-app .plots-panel {
  flex: 0 0 0;
  max-width: 0;
  min-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(18px);
  transition:
    flex-basis 0.38s ease,
    max-width 0.38s ease,
    opacity 0.24s ease,
    transform 0.38s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.four-bar-app .simulator.show-plots .plots-panel {
  flex: 0 0 clamp(320px, 34%, 420px);
  max-width: clamp(320px, 34%, 420px);
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.four-bar-app .plot-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.four-bar-app .plot-card-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.four-bar-app .plot-card-header h3 {
  margin: 0;
  font-size: 13px;
  color: #28445c;
}

.four-bar-app .plot-title-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.four-bar-app .plot-info-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #c8d7e4;
  border-radius: 999px;
  background: #f4f9fd;
  color: #4a6780;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.four-bar-app .plot-info-button::before,
.four-bar-app .plot-info-button::after {
  position: absolute;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 30;
}

.four-bar-app .plot-info-button::before {
  content: attr(data-tooltip);
  bottom: calc(100% + 10px);
  transform: translate(-50%, 4px);
  min-width: 220px;
  max-width: 320px;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(28, 28, 28, 0.96);
  color: #fff;
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.four-bar-app .plot-info-button::after {
  content: "";
  bottom: calc(100% + 4px);
  transform: translate(-50%, 4px);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(28, 28, 28, 0.96) transparent transparent transparent;
}

.four-bar-app .plot-info-button:hover::before,
.four-bar-app .plot-info-button:hover::after,
.four-bar-app .plot-info-button:focus-visible::before,
.four-bar-app .plot-info-button:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.four-bar-app .plot-card-header p {
  margin: 3px 0 0 0;
  font-size: 11px;
  color: #6a7784;
}

.four-bar-app .plot-readout {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf6ff;
  color: #2a6da6;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.four-bar-app #ma-plot-readout {
  min-width: 7ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.four-bar-app .plot-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid #d9e3ec;
  border-radius: 999px;
  background: #f7fafc;
  color: #4f6171;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.four-bar-app .plot-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

.four-bar-app .plot-canvas-shell {
  position: relative;
  flex: 1;
  min-height: 180px;
  border: 1px solid #dde5ec;
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(240, 247, 252, 0.85), rgba(255, 255, 255, 0.96));
}

.four-bar-app .plot-canvas-shell canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.four-bar-app .grid-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      to right,
      rgba(52, 152, 219, 0.12) 0,
      rgba(52, 152, 219, 0.12) 1px,
      transparent 1px,
      transparent var(--grid-spacing-x)
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(52, 152, 219, 0.12) 0,
      rgba(52, 152, 219, 0.12) 1px,
      transparent 1px,
      transparent var(--grid-spacing-y)
    );
  background-size: var(--grid-spacing-x) 100%, 100% var(--grid-spacing-y);
  background-position: var(--grid-origin-x) 0, 0 var(--grid-origin-y);
  z-index: 0;
}

.four-bar-app .grid-axis {
  position: absolute;
  pointer-events: none;
  background: rgba(120, 120, 120, 0.55);
  z-index: 1;
}

.four-bar-app .grid-axis-x {
  left: 0;
  right: 0;
  top: var(--grid-origin-y);
  height: 1px;
}

.four-bar-app .grid-axis-y {
  top: 0;
  bottom: 0;
  left: var(--grid-origin-x);
  width: 1px;
}

.four-bar-app .canvas-overlay-button {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: 34px;
  height: 34px;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  background: #ececec;
  color: #444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: background-color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.four-bar-app .canvas-overlay-button:hover {
  background: #e2e2e2;
  border-color: #bdbdbd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16);
}

.four-bar-app .canvas-wrapper {
  cursor: grab;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  transform-origin: center;
  transition: transform 0.1s ease-out;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.four-bar-app .invalid-linkage {
  height: 100%;
  display: none;
  width: 100%;
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.four-bar-app .invalid-linkage p {
  padding: 20px;
  background-color: white;
}

.four-bar-app #canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Sidebar: Stack all controls vertically */
.four-bar-app .sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 5px;
}

/* Control Sections - Compact */
.four-bar-app .control-section {
  background-color: white;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

/* Info Panel Styling */
.four-bar-app .info-panel {
  border-left: 3px solid var(--primary-color);
}

.four-bar-app .sticky-info-panel {
  position: sticky;
  top: 0;
  z-index: 6;
}

.four-bar-app .info-panel-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 8px 0;
  margin: 0 0 8px 0;
  border: none;
  border-bottom: 1px solid #eee;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.four-bar-app .info-panel-toggle:hover {
  background: transparent;
}

.four-bar-app .info-panel-toggle-icon {
  font-size: 15px;
  color: var(--primary-color);
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

.four-bar-app .sticky-info-panel.is-collapsed .info-panel-toggle-icon {
  transform: rotate(0deg);
}

.four-bar-app .info-panel-content {
  display: block;
}

.four-bar-app .sticky-info-panel.is-collapsed .info-panel-content {
  display: none;
}

.four-bar-app .info-panel-title {
  margin: 0;
  padding: 0;
  border: none;
  color: var(--primary-color);
  font-size: 0.95em;
  font-weight: 600;
}

.four-bar-app .info-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  margin-bottom: 2px;
  border-radius: 3px;
  cursor: help;
  transition: background-color 0.2s ease;
}

.four-bar-app .info-group:hover {
  background-color: #f5f8fa;
}

.four-bar-app .info-title {
  font-size: 12px;
  color: #666;
}

.four-bar-app .info-value {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 12px;
}

/* Input Groups - Compact */
.four-bar-app .input-group {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.four-bar-app .input-group .input-controls {
  flex: 1;
  min-width: 0;
}

.four-bar-app .input-group label {
  width: 110px;
  flex-shrink: 0;
  font-size: 12px;
  white-space: nowrap;
}

.four-bar-app label {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

/* Range Inputs */
.four-bar-app input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #ddd;
  outline: none;
  opacity: 0.7;
  transition: opacity 0.2s;
  min-width: 60px;
}

.four-bar-app input[type="range"]:hover {
  opacity: 1;
}

.four-bar-app input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--primary-color);
  cursor: pointer;
  border-radius: 50%;
}

.four-bar-app input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--primary-color);
  cursor: pointer;
  border-radius: 50%;
}

/* Number Inputs */
.four-bar-app input[type="number"] {
  padding: 4px;
  text-align: center;
  width: 55px;
  font-size: 12px;
}

/* Checkbox Inputs */
.four-bar-app input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.four-bar-app input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.four-bar-app .checkbox-input {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  cursor: help;
  margin-bottom: 4px;
}

.four-bar-app .checkbox-input label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
}

.four-bar-app .checkbox-input.is-disabled label {
  color: #8a8a8a;
}

/* Button Group */
.four-bar-app .button-group {
  padding: 6px 0;
  display: flex;
  gap: 8px;
}

.four-bar-app .button-group #setCoordinates {
  flex: 1 1 100%;
  white-space: nowrap;
}

.four-bar-app .step-playback-section {
  margin-top: auto;
}

.four-bar-app .step-playback-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.four-bar-app .input-angle-scrubber-group {
  margin-top: 10px;
}

.four-bar-app .input-angle-scrubber-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #666;
}

.four-bar-app .input-angle-current-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.four-bar-app #input-angle-current-input {
  width: 88px;
  flex: 0 0 auto;
}

.four-bar-app .input-angle-unit {
  font-size: 12px;
  color: #666;
}

.four-bar-app .step-playback-controls button {
  flex: 0 0 42px;
  padding: 6px 0;
}

.four-bar-app #step-angle {
  width: 64px;
  flex: 0 0 auto;
}

.four-bar-app .step-angle-unit {
  font-size: 12px;
  color: #666;
  min-width: 24px;
}

.four-bar-app #input-angle-scrubber {
  width: 100%;
}

.four-bar-app .input-angle-readout {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: #666;
}

.four-bar-app .input-angle-readout span:nth-child(2) {
  display: none;
}

.four-bar-app button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 12px;
  flex: 1;
}

.four-bar-app button:hover {
  background-color: #2980b9;
}

/* Export Controls */
.four-bar-app .export-group {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.four-bar-app .export-group select {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  background: white;
  cursor: pointer;
}

.four-bar-app .export-group button {
  flex-shrink: 0;
  background-color: var(--secondary-color);
}

.four-bar-app .export-group button:hover {
  background-color: #27ae60;
}

/* Link Lengths Tab - Single column inputs */
.four-bar-app .link-rows-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.four-bar-app .input-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.four-bar-app .input-row label {
  font-weight: 500;
  margin-bottom: 2px;
  color: var(--primary-color);
}

.four-bar-app .input-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.four-bar-app .input-controls input[type="range"] {
  flex: 1;
  min-width: 0; /* Allows flexing smaller if needed */
}

.four-bar-app .input-controls input[type="number"] {
  width: 50px;
  flex-shrink: 0;
}

.four-bar-app #oscInput-center-number,
.four-bar-app #oscInput-range-number {
  width: 66px;
}

/* Coordinates Grid */
.four-bar-app .coordinates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.four-bar-app .coordinates-grid h4 {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: var(--secondary-color);
}

.four-bar-app .coordinate-inputs {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.four-bar-app .coordinate-input {
  display: flex;
  align-items: center;
  gap: 5px;
}

.four-bar-app .coordinate-input label {
  width: 15px;
  margin-bottom: 0;
}

.four-bar-app .coordinate-input input {
  width: 60px;
  font-size: 11px;
}

/* Tabs */
.four-bar-app .tab-contents {
  background-color: white;
  padding: 0;
}

.four-bar-app .tabs {
  display: flex;
  cursor: pointer;
}

.four-bar-app .tab {
  flex: 1;
  background-color: #f0f0f0;
  text-align: center;
  padding: 8px;
  font-size: 12px;
}

.four-bar-app .tab.active {
  color: var(--secondary-color);
  font-weight: bold;
  background-color: white;
}

.four-bar-app .tab-content {
  display: none;
  padding: 10px 12px;
}

.four-bar-app .tab-content.active {
  display: block;
}

/* Scrollbar styling for sidebar */
.four-bar-app .sidebar::-webkit-scrollbar {
  width: 6px;
}

.four-bar-app .sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.four-bar-app .sidebar::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.four-bar-app .sidebar::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}
