﻿:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --panel: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #cbd5e1;
  --line-soft: #e2e8f0;
  --purple: #7c3aed;
  --purple-dark: #5b21b6;
  --purple-soft: #ede9fe;
  --green: #10b981;
  --green-dark: #047857;
  --green-soft: #ecfdf5;
  --blue: #1e88e5;
  --red: #e53935;
  --dark: #172033;
  --dark-2: #243047;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; width: 100%; }

.workstation {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 48px 46px 34px minmax(420px, 1fr) 188px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}
.titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: linear-gradient(90deg, #111827, #29315f 54%, #4c1d95);
  color: #fff;
  letter-spacing: .2px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
}
.brand { font-weight: 900; font-size: 18px; }
.product { font-weight: 800; color: #dbeafe; }
.owner { justify-self: end; font-weight: 800; color: #f5f3ff; }
.navbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.nav-tab {
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 750;
  white-space: nowrap;
}
.nav-tab.active,
.nav-tab:hover {
  background: var(--purple-soft);
  color: var(--purple-dark);
  border-color: #ddd6fe;
}
.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line-soft);
  color: #475569;
  font-size: 13px;
  font-weight: 750;
}
.status-ready { color: var(--green-dark); }
.main-grid {
  display: grid;
  grid-template-columns: 220px minmax(420px, 1fr) 280px;
  gap: 10px;
  padding: 10px;
  min-height: 0;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-height: 0;
  overflow: hidden;
}
.panel-title {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--line);
  color: #334155;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .6px;
}
.tool-panel, .properties-panel, .workspace-panel { display: flex; flex-direction: column; }
.tool-list {
  padding: 8px;
  display: grid;
  gap: 5px;
  overflow: auto;
}
.tool-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #243047;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 9px;
  text-align: left;
  font-weight: 780;
}
.tool-btn:hover { background: #f8fafc; border-color: var(--line-soft); }
.tool-btn.active {
  background: linear-gradient(135deg, var(--purple), #8b5cf6);
  color: #fff;
  box-shadow: 0 8px 18px rgba(124, 58, 237, .22);
}
.workspace-body {
  flex: 1;
  min-height: 0;
  padding: 14px;
  overflow: auto;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr);
  gap: 12px;
}
.workspace-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}
.workspace-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.preview {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: radial-gradient(circle at center, #ffffff 0%, #f8fafc 70%);
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: visible;
}
.preview-label {
  position: absolute;
  transform: translateY(-132px);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .8px;
}
.preview svg { width: min(720px, 100%); height: min(360px, 46vh); }
.preview img.preview-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 150%;
  max-height: min(510px, 63vh);
  object-fit: contain;
  object-position: center;
}
.properties-body {
  padding: 12px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
}
.form-section { display: grid; gap: 10px; }
.field { display: grid; gap: 5px; }
.field label { color: #475569; font-size: 12px; font-weight: 850; }
.field input, .field select {
  width: 100%;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  padding: 0 10px;
  color: var(--ink);
  outline: none;
}
.field input:focus, .field select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.mode-btn,
.action-btn {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #334155;
  min-height: 38px;
  padding: 8px 9px;
  font-weight: 850;
}
.mode-btn.active {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}
.action-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.action-btn.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.action-btn.program { background: var(--green); border-color: var(--green); color: #fff; }
.action-btn.copy { background: #dbeafe; border-color: #bfdbfe; color: #1d4ed8; }
button:active { transform: translateY(1px) scale(.99); }
.output-panel {
  margin: 0 10px 10px;
  display: grid;
  grid-template-rows: 38px 1fr;
}
.output-body {
  margin: 0;
  padding: 12px 14px;
  background: #0f172a;
  color: #d1fae5;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow: auto;
}
.code-workspace {
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  min-height: 0;
}
.search-input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  outline: none;
}
.search-input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
.code-list {
  overflow: auto;
  display: grid;
  gap: 8px;
  align-content: start;
}
.code-row {
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #fff;
  padding: 10px;
}
.code-row-head { display: flex; align-items: baseline; gap: 10px; }
.code-code { color: var(--purple); font-size: 21px; font-weight: 950; min-width: 60px; }
.code-name { color: var(--ink); font-weight: 900; }
.code-desc { color: #334155; line-height: 1.45; margin-top: 4px; font-size: 13px; }
.code-note { color: #92400e; margin-top: 4px; font-size: 12px; }
.dev-box {
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
  padding: 20px;
}

@media (max-width: 980px) {
  .workstation { grid-template-rows: auto auto auto auto auto; }
  .titlebar { grid-template-columns: 1fr; gap: 3px; padding: 10px 14px; }
  .product, .owner { justify-self: start; }
  .main-grid { grid-template-columns: 1fr; }
  .tool-list { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .tool-btn { min-width: max-content; }
  .workspace-body { grid-template-rows: auto auto; }
  .output-panel { min-height: 180px; }
}

@media (max-width: 560px) {
  .navbar { padding: 6px 8px; }
  .statusbar { padding: 6px 10px; height: auto; align-items: start; gap: 8px; }
  .main-grid { padding: 8px; }
  .action-row { grid-template-columns: 1fr; }
  .segmented, .segmented.three { grid-template-columns: 1fr; }
}

/* Program reader - step 1 */
.program-input-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  min-height: 280px;
  padding: 22px;
  display: grid;
  align-content: start;
  gap: 16px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.file-button {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--purple);
  border-radius: 11px;
  background: var(--purple);
  color: #fff;
  min-height: 44px;
  padding: 0 18px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(124, 58, 237, .20);
  cursor: pointer;
}
.file-button:hover { background: var(--purple-dark); }
.program-file-meta {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  display: grid;
  gap: 5px;
}
.program-file-meta span,
.program-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.program-file-meta strong {
  color: var(--ink);
  font-size: 16px;
  word-break: break-word;
}
.program-reader-section {
  min-height: 0;
  height: 100%;
}
.program-empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fff;
  min-height: 240px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 18px;
  line-height: 1.5;
}
.program-viewer-wrap {
  height: min(560px, calc(100vh - 260px));
  min-height: 360px;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.program-viewer-head {
  min-height: 38px;
  padding: 8px 10px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}
.program-viewer-head span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.program-viewer {
  width: 100%;
  height: 100%;
  border: 0;
  resize: none;
  outline: none;
  padding: 12px;
  color: #0f172a;
  background: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre;
  overflow: auto;
}

/* Program reader refinements */
.reader-tool-list {
  grid-auto-flow: row;
  grid-auto-columns: initial;
}
.reader-open-tool {
  justify-content: flex-start;
}
.program-status-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fff;
  min-height: 280px;
  padding: 28px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}
.program-status-card.ready {
  background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
  border-color: #bbf7d0;
}
.program-status-card.muted {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.program-status-card h2 {
  margin: 0;
  font-size: 24px;
}
.program-status-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 560px;
}
.program-status-card > strong {
  color: var(--purple-dark);
  font-size: 18px;
  word-break: break-word;
}
.program-status-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--purple-soft);
  font-size: 28px;
}
.program-content-title {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.2;
}
.program-info-grid {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.program-info-grid div {
  display: grid;
  gap: 3px;
}
.program-info-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.program-info-grid strong {
  color: var(--ink);
  font-size: 13px;
  word-break: break-word;
}
.program-reader-section .program-viewer-wrap {
  height: min(520px, calc(100vh - 360px));
  min-height: 320px;
  grid-template-rows: 1fr;
}
.reader-analyze-tool {
  border-color: var(--line-soft);
  background: #ffffff;
}
.reader-analyze-tool:hover {
  background: #f8fafc;
  border-color: #ddd6fe;
  color: var(--purple-dark);
}

/* Compact program file metadata */
.program-reader-section {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  height: 100%;
}
.program-content-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.15;
}
.program-info-grid {
  min-height: 70px;
  max-height: 90px;
  padding: 7px 9px;
  gap: 4px;
  margin-bottom: 0;
  align-content: center;
  overflow: hidden;
}
.program-info-grid div,
.program-info-grid .program-info-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  line-height: 1.2;
}
.program-info-grid span {
  flex: 0 0 auto;
  font-size: 11px;
  white-space: nowrap;
}
.program-info-grid strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.program-reader-section .program-viewer-wrap {
  height: auto;
  min-height: 0;
  grid-template-rows: 1fr;
}
.program-viewer {
  white-space: pre;
  overflow: auto;
}

/* Reader properties panel full-height viewer */
.reader-properties-panel {
  min-height: 0;
}
.reader-properties-panel .properties-body {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-content: stretch;
}
.reader-properties-panel .program-reader-section {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reader-properties-panel .program-content-title {
  flex: 0 0 auto;
}
.reader-properties-panel .program-info-grid {
  flex: 0 0 76px;
  min-height: 70px;
  max-height: 90px;
}
.reader-properties-panel .program-viewer-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.reader-properties-panel .program-viewer {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

/* Tool analysis table */
.tool-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}
.tool-block-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tool-block-table th,
.tool-block-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 9px;
  text-align: left;
  white-space: nowrap;
}
.tool-block-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 950;
}
.tool-block-row {
  cursor: pointer;
}
.tool-block-row:hover {
  background: #f8fafc;
}
.tool-block-row.selected {
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-weight: 850;
}
.selected-tool-preview {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.selected-tool-preview h3 {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
  font-size: 13px;
}
.selected-tool-preview pre {
  margin: 0;
  padding: 10px;
  overflow: auto;
  white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #0f172a;
}

/* Program reader line highlighting */
.reader-properties-panel .program-line-viewer,
.program-line-viewer {
  padding: 0;
  background: #ffffff;
  overflow: auto;
  white-space: pre;
}
.program-line {
  min-width: max-content;
  width: 100%;
  display: grid;
  grid-template-columns: 22px max-content;
  align-items: center;
  min-height: 22px;
  padding: 0 10px 0 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.65);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #0f172a;
}
.program-line-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 18px;
}
.program-marker-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 2px #ffffff;
}
.program-marker-dot.start {
  background: #16a34a;
}
.program-marker-dot.end {
  background: #f59e0b;
}
.program-line-text {
  white-space: pre;
  min-width: max-content;
  padding: 2px 8px 2px 0;
}
.program-line.selected-tool-range {
  background: #f3e8ff;
}
.program-line.selected-tool-start {
  box-shadow: inset 3px 0 0 #16a34a;
}
.program-line.selected-tool-end {
  box-shadow: inset 3px 0 0 #f59e0b;
}
.program-line.selected-tool-start.selected-tool-end {
  box-shadow: inset 3px 0 0 #16a34a, inset 6px 0 0 #f59e0b;
}
.tool-analysis-card {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}
.tool-analysis-card .tool-table-wrap {
  height: 100%;
}
.empty-tool-row {
  color: #64748b;
  text-align: center !important;
  padding: 18px 12px !important;
  font-style: italic;
}

/* Reader panel fixed-height internal scrolling */
html,
body,
.app-shell,
.workstation {
  height: 100%;
}
.workstation {
  min-height: 720px;
  overflow: hidden;
}
.main-grid {
  min-height: 0;
  overflow: hidden;
}
.reader-properties-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.reader-properties-panel .properties-body {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.reader-properties-panel .program-reader-section {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.reader-properties-panel .program-content-title,
.reader-properties-panel .program-info-grid {
  flex: 0 0 auto;
}
.reader-properties-panel .program-viewer-wrap {
  flex: 1 1 0;
  height: auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
}
.reader-properties-panel .program-line-viewer {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  position: relative;
  overscroll-behavior: contain;
}
.reader-properties-panel .program-line {
  height: auto;
  min-height: 22px;
  flex: 0 0 auto;
}

/* Workstation split: output under tools + workspace only, properties full height */
.workstation {
  height: 100vh;
  min-height: 720px;
  grid-template-rows: 48px 46px 34px minmax(0, 1fr);
  overflow: hidden;
}
.main-grid {
  grid-template-columns: 220px minmax(420px, 1fr) 280px;
  grid-template-rows: minmax(0, 1fr) 188px;
  grid-template-areas:
    "tools workspace props"
    "output output props";
  min-height: 0;
  overflow: hidden;
}
.tool-panel {
  grid-area: tools;
}
.workspace-panel {
  grid-area: workspace;
}
.properties-panel {
  grid-area: props;
}
.output-panel {
  grid-area: output;
  margin: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr);
}
.output-body {
  min-height: 0;
  overflow: auto;
}
.properties-panel .properties-body,
.workspace-panel .workspace-body,
.tool-panel .tool-list {
  flex: 1 1 auto;
  min-height: 0;
}
.reader-properties-panel .program-viewer-wrap {
  flex-basis: 0;
}

/* Compact left tool panel: keep buttons at natural height */
.tool-panel .tool-list,
.reader-tool-list {
  width: 100%;
  flex: 0 0 auto;
  display: grid;
  grid-auto-flow: row;
  grid-auto-columns: initial;
  grid-auto-rows: 52px;
  align-content: start;
  align-items: stretch;
  justify-content: stretch;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
}
.tool-panel .tool-btn,
.reader-tool-list .tool-btn {
  width: 100%;
  height: 52px;
  min-height: 52px;
  max-height: 56px;
  flex: 0 0 auto;
  margin: 0;
  align-self: stretch;
  justify-content: flex-start;
}
.reader-tool-list .reader-open-tool,
.reader-tool-list .reader-analyze-tool {
  background: #ffffff;
  color: #243047;
  border-color: var(--line-soft);
}
.reader-tool-list .reader-open-tool.active {
  background: linear-gradient(135deg, var(--purple), #8b5cf6);
  color: #ffffff;
  border-color: transparent;
}
.reader-tool-list .reader-analyze-tool:hover {
  background: #f8fafc;
  border-color: #ddd6fe;
  color: var(--purple-dark);
}

/* Tool preliminary classification */
.tool-type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.tool-type-pill.milling { background: #dbeafe; color: #1d4ed8; }
.tool-type-pill.drilling { background: #ccfbf1; color: #0f766e; }
.tool-type-pill.rough { background: #ffedd5; color: #c2410c; }
.tool-type-pill.finish { background: #dcfce7; color: #15803d; }
.tool-type-pill.unknown { background: #f1f5f9; color: #475569; }

.tool-type-pill.stopper { background: #fef3c7; color: #92400e; }

.tool-type-pill.cutoff { background: #fee2e2; color: #b91c1c; }


.tool-block-table td:nth-child(8),
.tool-block-table th:nth-child(8) {
  min-width: 180px;
}


/* Process timeline */
.reader-view-tabs {
  display: inline-flex;
  gap: 6px;
  margin-top: 10px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #f8fafc;
}
.reader-view-tab {
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  padding: 7px 10px;
  cursor: pointer;
}
.reader-view-tab.active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}
.process-timeline-card {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fff;
}
.process-timeline-list {
  list-style: none;
  margin: 0;
  padding: 10px;
  display: grid;
  gap: 8px;
}
.timeline-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
}
.timeline-step:hover,
.timeline-step.selected {
  border-color: #c4b5fd;
  background: #f5f3ff;
}
.timeline-index {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ede9fe;
  color: var(--purple-dark);
  font-size: 12px;
  font-weight: 900;
}
.timeline-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.timeline-title {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}
.timeline-title strong {
  color: var(--purple-dark);
  font-size: 13px;
  white-space: nowrap;
}
.timeline-title span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  min-width: 0;
}
.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.timeline-meta span {
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px 7px;
  color: #475569;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 750;
}
.timeline-meta .timeline-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}
.timeline-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #f8fafc;
}

/* CNC Workstation dark/glass shell */
body {
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 220, 255, .16), transparent 30%),
    radial-gradient(circle at 82% 16%, rgba(177, 88, 255, .16), transparent 32%),
    linear-gradient(135deg, #020711 0%, #061426 48%, #07041a 100%);
  color: #eaf8ff;
}

.workstation {
  height: 100vh;
  min-height: 720px;
  grid-template-rows: 74px minmax(0, 1fr) !important;
  overflow: hidden;
  background:
    linear-gradient(rgba(71, 224, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(71, 224, 255, .035) 1px, transparent 1px),
    radial-gradient(circle at 15% 0%, rgba(0, 255, 224, .15), transparent 28%),
    radial-gradient(circle at 88% 6%, rgba(160, 80, 255, .18), transparent 30%),
    #030814;
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
}

.titlebar,
.statusbar {
  display: none !important;
}

.navbar {
  min-height: 64px;
  margin: 12px 20px 0;
  padding: 10px 14px;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(91, 221, 255, .18);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(8, 18, 38, .86), rgba(12, 9, 32, .82)),
    radial-gradient(circle at 12% 0%, rgba(0, 255, 224, .14), transparent 30%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 18px 50px rgba(0, 0, 0, .34),
    0 0 32px rgba(0, 210, 255, .07);
  backdrop-filter: blur(18px);
}

.nav-tab {
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid rgba(148, 182, 255, .18);
  border-radius: 16px;
  color: #e7f8ff;
  background: rgba(7, 12, 28, .72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .02),
    0 10px 22px rgba(0, 0, 0, .22);
  font-weight: 850;
  letter-spacing: 0;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.nav-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(94, 234, 255, .55);
  background: rgba(12, 28, 52, .86);
  box-shadow: 0 0 22px rgba(0, 229, 255, .18);
}

.nav-tab.active {
  color: #bffcff;
  border-color: rgba(0, 245, 255, .86);
  background:
    linear-gradient(135deg, rgba(0, 224, 255, .2), rgba(119, 71, 255, .24)),
    rgba(8, 17, 36, .9);
  box-shadow:
    0 0 0 1px rgba(0, 245, 255, .16),
    0 0 24px rgba(0, 245, 255, .42),
    inset 0 0 20px rgba(0, 245, 255, .12);
}

#mainPageRoot {
  min-height: 0;
  animation: cncPageIn .22s ease both;
}

@keyframes cncPageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.workstation:has(.nav-tab[data-nav="calc"].active) .main-grid {
  grid-template-columns: 220px minmax(420px, 1fr) 300px;
  grid-template-rows: minmax(0, 1fr) 188px;
  grid-template-areas:
    "tools workspace props"
    "output output props";
  gap: 12px;
  padding: 0 20px 14px;
}

.workstation:has(.nav-tab[data-nav="calc"].active) .panel,
.workstation:has(.nav-tab[data-nav="calc"].active) .output-panel {
  border: 1px solid rgba(73, 213, 255, .2);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(7, 18, 36, .82), rgba(8, 9, 28, .82)),
    radial-gradient(circle at 12% 0%, rgba(0, 229, 255, .08), transparent 34%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    0 18px 40px rgba(0, 0, 0, .28),
    0 0 30px rgba(0, 216, 255, .06);
  backdrop-filter: blur(18px);
  color: #eaf8ff;
}

.workstation:has(.nav-tab[data-nav="calc"].active) .panel-title,
.workstation:has(.nav-tab[data-nav="calc"].active) .output-title {
  color: #9ef7ff;
  border-bottom: 1px solid rgba(73, 213, 255, .16);
  background: linear-gradient(90deg, rgba(0, 217, 255, .11), rgba(151, 71, 255, .09), transparent);
  text-shadow: 0 0 16px rgba(0, 229, 255, .28);
}

.workstation:has(.nav-tab[data-nav="calc"].active) .tool-list,
.workstation:has(.nav-tab[data-nav="calc"].active) .properties-body,
.workstation:has(.nav-tab[data-nav="calc"].active) .workspace-body {
  min-height: 0;
}

.workstation:has(.nav-tab[data-nav="calc"].active) .tool-btn {
  min-height: 44px;
  border: 1px solid rgba(132, 173, 255, .16);
  border-radius: 14px;
  color: #d9f6ff;
  background: rgba(5, 14, 31, .62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.workstation:has(.nav-tab[data-nav="calc"].active) .tool-btn:hover {
  transform: translateX(2px);
  color: #ffffff;
  border-color: rgba(0, 235, 255, .45);
  background: rgba(12, 31, 56, .82);
  box-shadow: 0 0 18px rgba(0, 229, 255, .12);
}

.workstation:has(.nav-tab[data-nav="calc"].active) .tool-btn.active {
  color: #f4feff;
  border-color: rgba(0, 245, 255, .72);
  background:
    linear-gradient(135deg, rgba(0, 218, 255, .26), rgba(157, 78, 255, .38)),
    rgba(11, 20, 44, .95);
  box-shadow:
    0 0 22px rgba(0, 229, 255, .24),
    inset 0 0 18px rgba(157, 78, 255, .18);
}

.workstation:has(.nav-tab[data-nav="calc"].active) .workspace-head h1,
.workstation:has(.nav-tab[data-nav="calc"].active) .properties-title,
.workstation:has(.nav-tab[data-nav="calc"].active) .section-title {
  color: #ffffff;
  text-shadow: 0 0 18px rgba(0, 229, 255, .14);
}

.workstation:has(.nav-tab[data-nav="calc"].active) .workspace-head p,
.workstation:has(.nav-tab[data-nav="calc"].active) .field label,
.workstation:has(.nav-tab[data-nav="calc"].active) .hint,
.workstation:has(.nav-tab[data-nav="calc"].active) .muted {
  color: #a7c8d8;
}

.workstation:has(.nav-tab[data-nav="calc"].active) .preview {
  border: 1px solid rgba(73, 213, 255, .18);
  border-radius: 18px;
  background: #ffffff;
  min-height: 360px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 16px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .88),
    inset 0 0 24px rgba(15, 23, 42, .04);
}

.workstation:has(.nav-tab[data-nav="calc"].active) .preview svg {
  filter: drop-shadow(0 2px 8px rgba(15, 23, 42, .12));
}

.workstation:has(.nav-tab[data-nav="calc"].active) .preview img.preview-img {
  width: auto;
  height: auto;
  max-width: 150%;
  max-height: 510px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, .14));
}

.angle-r-preview-switcher {
  position: relative;
  width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.angle-r-nav-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(15, 23, 42, .16);
  border-radius: 999px;
  background: rgba(15, 23, 42, .12);
  color: rgba(15, 23, 42, .42);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
}

.angle-r-nav-prev {
  left: 8px;
}

.angle-r-nav-next {
  right: 8px;
}

.angle-r-nav-btn.is-enabled {
  cursor: pointer;
  border-color: rgba(0, 218, 255, .56);
  background: linear-gradient(135deg, rgba(0, 220, 255, .82), rgba(142, 82, 255, .82));
  color: #ffffff;
  box-shadow: 0 0 18px rgba(0, 218, 255, .34);
}

.angle-r-nav-btn:disabled {
  cursor: default;
  opacity: .45;
}

.workstation:has(.nav-tab[data-nav="calc"].active) .preview svg line,
.workstation:has(.nav-tab[data-nav="calc"].active) .preview svg path,
.workstation:has(.nav-tab[data-nav="calc"].active) .preview svg circle,
.workstation:has(.nav-tab[data-nav="calc"].active) .preview svg polyline,
.workstation:has(.nav-tab[data-nav="calc"].active) .preview svg rect {
  stroke: #102033;
}

.workstation:has(.nav-tab[data-nav="calc"].active) .preview svg text {
  fill: #102033;
}

.workstation:has(.nav-tab[data-nav="calc"].active) .result-box,
.workstation:has(.nav-tab[data-nav="calc"].active) .info-box,
.workstation:has(.nav-tab[data-nav="calc"].active) .code-card {
  border-color: rgba(73, 213, 255, .18);
  background: rgba(3, 16, 31, .72);
  color: #eaf8ff;
}

.workstation:has(.nav-tab[data-nav="calc"].active) .field input,
.workstation:has(.nav-tab[data-nav="calc"].active) .field select,
.workstation:has(.nav-tab[data-nav="calc"].active) .search-input,
.workstation:has(.nav-tab[data-nav="calc"].active) textarea {
  color: #f2fdff;
  border-color: rgba(109, 226, 255, .25);
  background: rgba(2, 10, 24, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.workstation:has(.nav-tab[data-nav="calc"].active) .field input::placeholder,
.workstation:has(.nav-tab[data-nav="calc"].active) .search-input::placeholder,
.workstation:has(.nav-tab[data-nav="calc"].active) textarea::placeholder {
  color: rgba(188, 223, 235, .55);
}

.workstation:has(.nav-tab[data-nav="calc"].active) .field input:focus,
.workstation:has(.nav-tab[data-nav="calc"].active) .field select:focus,
.workstation:has(.nav-tab[data-nav="calc"].active) .search-input:focus,
.workstation:has(.nav-tab[data-nav="calc"].active) textarea:focus {
  border-color: rgba(0, 245, 255, .72);
  box-shadow:
    0 0 0 3px rgba(0, 229, 255, .12),
    0 0 18px rgba(0, 229, 255, .16);
  outline: none;
}

.workstation:has(.nav-tab[data-nav="calc"].active) .mode-btn,
.workstation:has(.nav-tab[data-nav="calc"].active) .action-btn,
.workstation:has(.nav-tab[data-nav="calc"].active) .copy-btn {
  border-color: rgba(132, 173, 255, .2);
  border-radius: 14px;
  color: #eaf8ff;
  background: rgba(8, 18, 38, .82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, filter .16s ease;
}

.workstation:has(.nav-tab[data-nav="calc"].active) .mode-btn:hover,
.workstation:has(.nav-tab[data-nav="calc"].active) .action-btn:hover,
.workstation:has(.nav-tab[data-nav="calc"].active) .copy-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 245, 255, .55);
  box-shadow: 0 0 18px rgba(0, 229, 255, .16);
}

.workstation:has(.nav-tab[data-nav="calc"].active) .mode-btn.active,
.workstation:has(.nav-tab[data-nav="calc"].active) .action-btn.primary {
  color: #ffffff;
  border-color: rgba(0, 245, 255, .64);
  background: linear-gradient(135deg, #00b7ff, #7c3aed 58%, #d946ef);
  box-shadow:
    0 0 22px rgba(0, 229, 255, .22),
    0 0 30px rgba(157, 78, 255, .16);
}

.workstation:has(.nav-tab[data-nav="calc"].active) .action-btn.program {
  color: #ffffff;
  border-color: rgba(0, 255, 178, .55);
  background: linear-gradient(135deg, #10b981, #00d5ff);
  box-shadow: 0 0 24px rgba(16, 185, 129, .24);
}

.workstation:has(.nav-tab[data-nav="calc"].active) .action-btn.copy,
.workstation:has(.nav-tab[data-nav="calc"].active) .copy-btn {
  color: #ffffff;
  border-color: rgba(92, 213, 255, .42);
  background: linear-gradient(135deg, rgba(0, 174, 255, .78), rgba(118, 71, 255, .88));
}

.workstation:has(.nav-tab[data-nav="calc"].active) .output-body {
  border-top: 1px solid rgba(73, 213, 255, .14);
  color: #9fffe4;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 229, 255, .08), transparent 30%),
    #010711;
  text-shadow: 0 0 12px rgba(0, 255, 188, .12);
}

.workstation:has(.nav-tab[data-nav="calc"].active) .panel ::-webkit-scrollbar,
.workstation:has(.nav-tab[data-nav="calc"].active) .output-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.workstation:has(.nav-tab[data-nav="calc"].active) .panel ::-webkit-scrollbar-track,
.workstation:has(.nav-tab[data-nav="calc"].active) .output-body::-webkit-scrollbar-track {
  background: rgba(3, 10, 24, .62);
}

.workstation:has(.nav-tab[data-nav="calc"].active) .panel ::-webkit-scrollbar-thumb,
.workstation:has(.nav-tab[data-nav="calc"].active) .output-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, #00d5ff, #8b5cf6);
}

@media (max-width: 980px) {
  .workstation {
    grid-template-rows: 72px minmax(0, 1fr) !important;
  }

  .navbar {
    justify-content: flex-start;
    margin: 10px;
    padding: 8px 10px;
    overflow-x: auto;
  }

  .nav-tab {
    min-width: max-content;
    padding: 0 16px;
  }

  .workstation:has(.nav-tab[data-nav="calc"].active) .main-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto minmax(180px, auto);
    grid-template-areas:
      "tools"
      "workspace"
      "props"
      "output";
    overflow: auto;
    padding: 0 12px 14px;
  }
}

/* Program Reader dark/glass workstation skin */
.workstation:has(.nav-tab[data-nav="reader"].active) .main-grid {
  grid-template-columns: 220px minmax(420px, 1fr) 320px;
  grid-template-rows: minmax(0, 1fr) 170px;
  grid-template-areas:
    "tools workspace props"
    "output output props";
  gap: 12px;
  padding: 0 20px 14px;
  min-height: 0;
  overflow: hidden;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .panel,
.workstation:has(.nav-tab[data-nav="reader"].active) .output-panel {
  min-height: 0;
  border: 1px solid rgba(73, 213, 255, .2);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(7, 18, 36, .84), rgba(8, 9, 28, .84)),
    radial-gradient(circle at 12% 0%, rgba(0, 229, 255, .08), transparent 34%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    0 18px 40px rgba(0, 0, 0, .28),
    0 0 30px rgba(0, 216, 255, .06);
  backdrop-filter: blur(18px);
  color: #eaf8ff;
  overflow: hidden;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .panel-title,
.workstation:has(.nav-tab[data-nav="reader"].active) .output-title {
  color: #9ef7ff;
  border-bottom: 1px solid rgba(73, 213, 255, .16);
  background: linear-gradient(90deg, rgba(0, 217, 255, .11), rgba(151, 71, 255, .09), transparent);
  text-shadow: 0 0 16px rgba(0, 229, 255, .28);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .tool-panel,
.workstation:has(.nav-tab[data-nav="reader"].active) .workspace-panel,
.workstation:has(.nav-tab[data-nav="reader"].active) .properties-panel {
  min-height: 0;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .tool-list,
.workstation:has(.nav-tab[data-nav="reader"].active) .workspace-body,
.workstation:has(.nav-tab[data-nav="reader"].active) .properties-body {
  min-height: 0;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .workspace-body {
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .workspace-head {
  min-height: 0;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .workspace-head h1,
.workstation:has(.nav-tab[data-nav="reader"].active) .program-content-title {
  color: #ffffff;
  text-shadow: 0 0 18px rgba(0, 229, 255, .14);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .workspace-head p,
.workstation:has(.nav-tab[data-nav="reader"].active) .program-help,
.workstation:has(.nav-tab[data-nav="reader"].active) .program-status-card p,
.workstation:has(.nav-tab[data-nav="reader"].active) .empty-tool-row {
  color: #a7c8d8;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-tool-list .tool-btn,
.workstation:has(.nav-tab[data-nav="reader"].active) .reader-tool-list .reader-open-tool,
.workstation:has(.nav-tab[data-nav="reader"].active) .reader-tool-list .reader-analyze-tool {
  min-height: 52px;
  border: 1px solid rgba(132, 173, 255, .18);
  border-radius: 14px;
  color: #d9f6ff;
  background: rgba(5, 14, 31, .66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-tool-list .tool-btn:hover,
.workstation:has(.nav-tab[data-nav="reader"].active) .reader-tool-list .reader-analyze-tool:hover {
  transform: translateX(2px);
  color: #ffffff;
  border-color: rgba(0, 235, 255, .45);
  background: rgba(12, 31, 56, .84);
  box-shadow: 0 0 18px rgba(0, 229, 255, .12);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-tool-list .tool-btn.active,
.workstation:has(.nav-tab[data-nav="reader"].active) .reader-tool-list .reader-open-tool.active {
  color: #f4feff;
  border-color: rgba(0, 245, 255, .72);
  background:
    linear-gradient(135deg, rgba(0, 218, 255, .26), rgba(157, 78, 255, .38)),
    rgba(11, 20, 44, .95);
  box-shadow:
    0 0 22px rgba(0, 229, 255, .24),
    inset 0 0 18px rgba(157, 78, 255, .18);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-vibration-tool.auto {
  border-color: rgba(0, 245, 255, .45);
  background: linear-gradient(135deg, rgba(0, 183, 255, .24), rgba(0, 245, 255, .16));
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-vibration-tool.step {
  border-color: rgba(185, 121, 255, .45);
  background: linear-gradient(135deg, rgba(124, 58, 237, .26), rgba(217, 70, 239, .16));
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-vibration-tool {
  border-color: rgba(0, 245, 255, .42);
  background: linear-gradient(135deg, rgba(0, 183, 255, .22), rgba(124, 58, 237, .2));
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-status-card,
.workstation:has(.nav-tab[data-nav="reader"].active) .program-status-card.ready,
.workstation:has(.nav-tab[data-nav="reader"].active) .program-status-card.muted,
.workstation:has(.nav-tab[data-nav="reader"].active) .program-empty {
  border-color: rgba(73, 213, 255, .2);
  background:
    radial-gradient(circle at 18% 0%, rgba(0, 229, 255, .12), transparent 34%),
    rgba(3, 16, 31, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  color: #eaf8ff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-status-card > strong,
.workstation:has(.nav-tab[data-nav="reader"].active) .program-status-card h2,
.workstation:has(.nav-tab[data-nav="reader"].active) .program-file-meta strong {
  color: #f5fdff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-status-icon {
  color: #dffcff;
  background: linear-gradient(135deg, rgba(0, 218, 255, .2), rgba(157, 78, 255, .34));
  box-shadow: 0 0 22px rgba(0, 229, 255, .22);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-view-tabs {
  border-color: rgba(73, 213, 255, .2);
  border-radius: 14px;
  background: rgba(2, 10, 24, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-view-tab {
  color: #a7c8d8;
  border-radius: 11px;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-view-tab:hover {
  color: #ffffff;
  border-color: rgba(0, 235, 255, .4);
  background: rgba(12, 31, 56, .8);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-view-tab.active {
  color: #ffffff;
  border-color: rgba(0, 245, 255, .64);
  background: linear-gradient(135deg, #00b7ff, #7c3aed 58%, #d946ef);
  box-shadow: 0 0 20px rgba(0, 229, 255, .18);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .tool-analysis-card,
.workstation:has(.nav-tab[data-nav="reader"].active) .process-timeline-card {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(73, 213, 255, .18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 210, 255, .1), transparent 42%),
    rgba(0, 8, 18, .72);
  box-shadow: inset 0 0 30px rgba(0, 229, 255, .06);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .tool-table-wrap,
.workstation:has(.nav-tab[data-nav="reader"].active) .process-timeline-card {
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  border-color: rgba(73, 213, 255, .18);
  background: rgba(1, 7, 17, .7);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .tool-block-table {
  color: #eaf8ff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .tool-block-table th {
  color: #9ef7ff;
  border-bottom-color: rgba(73, 213, 255, .18);
  background: rgba(6, 18, 34, .96);
  box-shadow: 0 1px 0 rgba(73, 213, 255, .1);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .tool-block-table td {
  border-bottom-color: rgba(73, 213, 255, .1);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .tool-block-row:hover {
  background: rgba(0, 229, 255, .08);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .tool-block-row.selected {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(0, 218, 255, .22), rgba(157, 78, 255, .28));
  box-shadow: inset 3px 0 0 rgba(0, 245, 255, .85);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-reader-section {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-info-grid {
  border-color: rgba(73, 213, 255, .18);
  background: rgba(3, 16, 31, .72);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-tabs-row {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(73, 213, 255, .16);
  border-radius: 14px;
  background: rgba(2, 10, 24, .55);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-tabs-label {
  color: #9ef7ff;
  font-size: 12px;
  font-weight: 850;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-file-tab {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  border: 1px solid rgba(255, 211, 105, .45);
  border-radius: 999px;
  background: rgba(255, 193, 7, .08);
  box-shadow: 0 0 14px rgba(255, 193, 7, .08);
  overflow: hidden;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-file-tab.active {
  border-color: rgba(0, 245, 255, .82);
  background: rgba(0, 229, 255, .12);
  box-shadow: 0 0 18px rgba(0, 229, 255, .26);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-file-select,
.workstation:has(.nav-tab[data-nav="reader"].active) .program-file-close {
  border: 0;
  color: #f4feff;
  background: transparent;
  cursor: pointer;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-file-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 9px 7px 12px;
  font-weight: 850;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-file-select span:first-child {
  min-width: 0;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-slot-badge {
  flex: 0 0 auto;
  color: #07111f;
  border-radius: 999px;
  padding: 2px 6px;
  background: linear-gradient(135deg, #9ef7ff, #d8b4fe);
  font-size: 10px;
  font-weight: 950;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-file-close {
  width: 28px;
  color: #ffd1d1;
  font-size: 16px;
  font-weight: 950;
  background: rgba(255, 80, 80, .16);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-file-close:hover {
  color: #ffffff;
  background: rgba(255, 74, 74, .45);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-info-grid span {
  color: #8eb5c7;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-info-grid strong {
  color: #eaf8ff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-viewer-wrap {
  min-height: 0;
  height: auto;
  border-color: rgba(73, 213, 255, .18);
  background: rgba(1, 7, 17, .78);
  overflow: hidden;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-line-viewer,
.workstation:has(.nav-tab[data-nav="reader"].active) .program-viewer {
  min-height: 0;
  overflow: auto;
  background:
    radial-gradient(circle at 10% 0%, rgba(0, 229, 255, .08), transparent 28%),
    #010711;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-line {
  color: #dffcff;
  border-bottom-color: rgba(73, 213, 255, .08);
  background: transparent;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-line:nth-child(2n) {
  background: rgba(255, 255, 255, .012);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-line.selected-tool-range {
  background: rgba(157, 78, 255, .18);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-line.selected-tool-start {
  box-shadow: inset 3px 0 0 #20f48b;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-line.selected-tool-end {
  box-shadow: inset 3px 0 0 #ffd166;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-line.selected-tool-start.selected-tool-end {
  box-shadow: inset 3px 0 0 #20f48b, inset 6px 0 0 #ffd166;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-line.vibration-current-line {
  background: rgba(255, 186, 73, .16);
  box-shadow: inset 3px 0 0 #ffb84d;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-marker-dot {
  box-shadow: 0 0 0 2px rgba(2, 10, 24, .9), 0 0 12px currentColor;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-marker-dot.start {
  background: #20f48b;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-marker-dot.end {
  background: #ffd166;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .timeline-step {
  border-color: rgba(73, 213, 255, .15);
  background: rgba(5, 14, 31, .66);
  color: #eaf8ff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .timeline-step:hover,
.workstation:has(.nav-tab[data-nav="reader"].active) .timeline-step.selected {
  border-color: rgba(0, 245, 255, .58);
  background: rgba(20, 31, 64, .82);
  box-shadow: 0 0 18px rgba(0, 229, 255, .12);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .timeline-index {
  color: #eaf8ff;
  background: linear-gradient(135deg, rgba(0, 218, 255, .4), rgba(157, 78, 255, .55));
}

.workstation:has(.nav-tab[data-nav="reader"].active) .timeline-title strong,
.workstation:has(.nav-tab[data-nav="reader"].active) .timeline-title span {
  color: #f2fdff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .timeline-meta span {
  color: #bce7f4;
  border-color: rgba(73, 213, 255, .15);
  background: rgba(2, 10, 24, .58);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .timeline-empty {
  color: #a7c8d8;
  border-color: rgba(73, 213, 255, .18);
  background: rgba(3, 16, 31, .72);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-panel {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  margin: 10px;
  padding: 10px;
  border: 1px solid rgba(73, 213, 255, .18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 229, 255, .1), transparent 32%),
    rgba(2, 10, 24, .78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-panel.warning {
  border-color: rgba(255, 165, 56, .62);
  box-shadow: 0 0 20px rgba(255, 127, 48, .14), inset 0 1px 0 rgba(255, 255, 255, .04);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #eaf8ff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-panel-head strong {
  color: #9ef7ff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-panel-head span {
  color: #a7c8d8;
  font-size: 12px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-grid div,
.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-lines div {
  min-width: 0;
  border: 1px solid rgba(73, 213, 255, .12);
  border-radius: 10px;
  padding: 6px 8px;
  background: rgba(1, 7, 17, .66);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-grid span,
.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-lines span {
  color: #8eb5c7;
  font-size: 11px;
  font-weight: 850;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-grid strong {
  display: block;
  color: #f4feff;
  margin-top: 2px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-lines {
  display: grid;
  gap: 6px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-lines code {
  display: block;
  min-width: 0;
  margin-top: 3px;
  color: #dffcff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-warning {
  color: #fff3d6;
  border: 1px solid rgba(255, 165, 56, .42);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 116, 40, .18);
  font-weight: 900;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-ok {
  color: #9fffe4;
  font-size: 12px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-workspace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-run-controls {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(73, 213, 255, .18);
  border-radius: 14px;
  background: rgba(2, 10, 24, .72);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-run {
  min-width: 76px;
  color: #ffffff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-run.auto {
  border-color: rgba(0, 245, 255, .58);
  background: linear-gradient(135deg, #00b7ff, #14f1ff);
  box-shadow: 0 0 18px rgba(0, 229, 255, .2);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-run.step {
  border-color: rgba(185, 121, 255, .58);
  background: linear-gradient(135deg, #7c3aed, #d946ef);
  box-shadow: 0 0 18px rgba(185, 121, 255, .18);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-run.m01 {
  border-color: rgba(73, 213, 255, .28);
  background: rgba(7, 18, 36, .86);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-run.m01.active {
  border-color: rgba(0, 245, 255, .72);
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  box-shadow: 0 0 18px rgba(0, 229, 255, .24);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-run.pause {
  border-color: rgba(255, 211, 105, .68);
  background: linear-gradient(135deg, #f59e0b, #f97316);
  box-shadow: 0 0 18px rgba(245, 158, 11, .2);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-run.stop {
  border-color: rgba(255, 132, 84, .68);
  background: linear-gradient(135deg, #ff6b3d, #d92672);
  box-shadow: 0 0 18px rgba(255, 105, 61, .2);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-run:disabled {
  cursor: not-allowed;
  opacity: .45;
  filter: grayscale(.3);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-workspace {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "main sub"
    "status status";
  gap: 12px;
  overflow: hidden;
  position: relative;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-pane {
  min-height: 0;
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr);
  border: 1px solid rgba(73, 213, 255, .18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 210, 255, .1), transparent 42%),
    rgba(0, 8, 18, .72);
  overflow: visible;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-pane:first-child {
  grid-area: main;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-pane:nth-of-type(2) {
  grid-area: sub;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-inline {
  margin-left: 8px;
  padding: 5px 8px;
  border-radius: 16px;
  border: 1px solid rgba(73, 213, 255, .32);
  color: #e8fcff;
  background: linear-gradient(160deg, rgba(0, 229, 255, .2), rgba(151, 71, 255, .2));
  box-shadow: 0 0 22px rgba(0, 229, 255, .16);
  cursor: pointer;
  font-weight: 900;
  font-size: 11px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid rgba(73, 213, 255, .14);
  background: linear-gradient(90deg, rgba(0, 217, 255, .11), rgba(151, 71, 255, .09), transparent);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-head-controls {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-side-tab,
.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-find-btn,
.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-edit-btn,
.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-save-btn {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 12px;
  border: 1px solid rgba(95, 213, 255, .24);
  color: #dcfbff;
  background: rgba(4, 12, 28, .68);
  box-shadow: inset 0 0 14px rgba(0, 229, 255, .06);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-side-tab.active {
  color: #ffffff;
  border-color: rgba(55, 235, 255, .72);
  background: linear-gradient(135deg, rgba(0, 229, 255, .28), rgba(152, 73, 255, .26));
  box-shadow: 0 0 18px rgba(0, 229, 255, .32), inset 0 0 18px rgba(255, 255, 255, .08);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-search-input {
  min-width: 84px;
  width: clamp(84px, 10vw, 150px);
  height: 28px;
  padding: 5px 9px;
  border-radius: 12px;
  border: 1px solid rgba(73, 213, 255, .22);
  color: #f2feff;
  background: rgba(1, 8, 18, .72);
  outline: none;
  font-size: 11px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-search-input:focus {
  border-color: rgba(73, 213, 255, .62);
  box-shadow: 0 0 16px rgba(0, 229, 255, .18);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-edit-btn.active {
  color: #fff7dd;
  border-color: rgba(255, 188, 74, .7);
  background: linear-gradient(135deg, rgba(255, 188, 74, .24), rgba(255, 75, 150, .22));
  box-shadow: 0 0 18px rgba(255, 151, 73, .26);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-save-wrap {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  overflow: visible;
  white-space: normal;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-save-btn {
  color: #f6eaff;
  border-color: rgba(190, 112, 255, .34);
  background: linear-gradient(135deg, rgba(104, 73, 255, .2), rgba(255, 75, 194, .16));
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-save-menu {
  position: absolute;
  z-index: 35;
  top: calc(100% + 7px);
  right: 0;
  min-width: 160px;
  overflow: visible;
  white-space: normal;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(73, 213, 255, .24);
  background: rgba(4, 10, 24, .96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .38), 0 0 24px rgba(151, 71, 255, .18);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-save-menu button {
  width: 100%;
  margin: 0;
  padding: 8px 9px;
  border: 0;
  border-radius: 10px;
  color: #e7fbff;
  background: transparent;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-save-menu button:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, .16), rgba(151, 71, 255, .2));
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-head-meta {
  flex: 0 1 auto;
  max-width: 34%;
  font-size: 11px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-head strong {
  color: #9ef7ff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-head .vibration-head-meta {
  min-width: 0;
  color: #dffcff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-viewer {
  min-height: 0;
  overflow: auto;
  scroll-behavior: auto;
  overflow-anchor: none;
  background:
    radial-gradient(circle at 10% 0%, rgba(0, 229, 255, .08), transparent 28%),
    #010711;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-line {
  min-width: max-content;
  display: grid;
  grid-template-columns: 48px max-content;
  gap: 8px;
  align-items: center;
  padding: 2px 10px 2px 0;
  border-bottom: 1px solid rgba(73, 213, 255, .08);
  color: #dffcff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-line span {
  color: #6faabd;
  text-align: right;
  user-select: none;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-line code {
  white-space: pre;
  min-width: 0;
  outline: none;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-line code[contenteditable="true"] {
  color: #fff7db;
  text-shadow: 0 0 10px rgba(255, 190, 73, .18);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-line.active {
  color: #fff3d6;
  background: rgba(255, 186, 73, .18);
  box-shadow: inset 3px 0 0 #ffb84d;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-line.search-hit {
  background: rgba(0, 229, 255, .13);
  box-shadow: inset 3px 0 0 #28e8ff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-line.active.search-hit {
  background: linear-gradient(90deg, rgba(255, 186, 73, .22), rgba(0, 229, 255, .12));
  box-shadow: inset 3px 0 0 #ffb84d, inset 7px 0 0 rgba(40, 232, 255, .78);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-code-empty {
  padding: 18px;
  color: #a7c8d8;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-status-card {
  grid-area: status;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "main sub"
    "message message";
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(73, 213, 255, .18);
  border-radius: 16px;
  background: rgba(2, 10, 24, .78);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-status-main,
.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-status-sub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  min-width: 0;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-status-main {
  grid-area: main;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-status-sub {
  grid-area: sub;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-status-card.warning {
  border-color: rgba(255, 165, 56, .62);
  background: rgba(255, 116, 40, .12);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-status-card div {
  min-width: 0;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-status-card span {
  display: block;
  color: #8eb5c7;
  font-size: 11px;
  font-weight: 850;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-status-card strong {
  color: #f4feff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-status-message {
  grid-area: message;
  color: #9fffe4;
  font-weight: 850;
  align-self: center;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-status-card.warning .vibration-status-message {
  color: #fff3d6;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-panel {
  position: absolute;
  z-index: 20;
  left: 50%;
  top: 50%;
  width: min(460px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(73, 213, 255, .34);
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 229, 255, .14), transparent 34%),
    linear-gradient(145deg, rgba(3, 13, 30, .96), rgba(17, 8, 38, .94));
  box-shadow: 0 22px 60px rgba(0, 0, 0, .48), 0 0 28px rgba(151, 71, 255, .18);
  color: #e8fcff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-head strong {
  color: #9ef7ff;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-head button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 92, 132, .42);
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 68, 105, .18);
  cursor: pointer;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-panel label {
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  color: #bcefff;
  font-weight: 800;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-calibrate,
.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-result {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(180, 92, 255, .24);
  border-radius: 14px;
  background: rgba(8, 13, 32, .62);
  box-shadow: inset 0 0 18px rgba(104, 68, 255, .08);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-calibrate {
  display: grid;
  gap: 8px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-check {
  grid-template-columns: 1fr auto;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-check input {
  width: 18px;
  height: 18px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-result {
  color: #d7fbff;
  font-size: 12px;
  line-height: 1.55;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-panel input {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(73, 213, 255, .28);
  color: #f4feff;
  background: rgba(1, 8, 18, .74);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .vibration-param-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .output-body {
  border-top: 1px solid rgba(73, 213, 255, .14);
  color: #9fffe4;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 229, 255, .08), transparent 30%),
    #010711;
  text-shadow: 0 0 12px rgba(0, 255, 188, .12);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .panel ::-webkit-scrollbar,
.workstation:has(.nav-tab[data-nav="reader"].active) .output-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .panel ::-webkit-scrollbar-track,
.workstation:has(.nav-tab[data-nav="reader"].active) .output-body::-webkit-scrollbar-track {
  background: rgba(3, 10, 24, .62);
}

.workstation:has(.nav-tab[data-nav="reader"].active) .panel ::-webkit-scrollbar-thumb,
.workstation:has(.nav-tab[data-nav="reader"].active) .output-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, #00d5ff, #8b5cf6);
}

@media (max-width: 980px) {
  .workstation:has(.nav-tab[data-nav="reader"].active) .main-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(360px, 1fr) minmax(360px, 1fr) 170px;
    grid-template-areas:
      "tools"
      "workspace"
      "props"
      "output";
    overflow: auto;
    padding: 0 12px 14px;
  }

  .workstation:has(.nav-tab[data-nav="reader"].active) .workspace-body {
    overflow: hidden;
  }
}

/* Reader fixed-height scroll lock */
.workstation:has(.nav-tab[data-nav="reader"].active) {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .main-grid {
  height: calc(100vh - 88px);
  max-height: calc(100vh - 88px);
  overflow: hidden;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .workspace-panel,
.workstation:has(.nav-tab[data-nav="reader"].active) .properties-panel,
.workstation:has(.nav-tab[data-nav="reader"].active) .reader-properties-panel,
.workstation:has(.nav-tab[data-nav="reader"].active) .output-panel {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .output-panel {
  height: 170px;
  max-height: 190px;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .workspace-body {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden !important;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-properties-panel {
  display: flex;
  flex-direction: column;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-properties-panel .properties-body {
  flex: 1 1 auto;
  height: auto;
  max-height: 100%;
  min-height: 0;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column;
  align-content: stretch;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-properties-panel .program-reader-section {
  flex: 1 1 auto;
  height: auto;
  max-height: 100%;
  min-height: 0;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-properties-panel .program-content-title,
.workstation:has(.nav-tab[data-nav="reader"].active) .reader-properties-panel .program-info-grid {
  flex: 0 0 auto;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-properties-panel .program-viewer-wrap {
  flex: 1 1 0;
  height: auto !important;
  max-height: calc(100vh - 260px);
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .reader-properties-panel .program-viewer,
.workstation:has(.nav-tab[data-nav="reader"].active) .reader-properties-panel .program-line-viewer {
  flex: 1 1 auto;
  height: auto !important;
  max-height: 100%;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .tool-analysis-card,
.workstation:has(.nav-tab[data-nav="reader"].active) .process-timeline-card {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .tool-table-wrap,
.workstation:has(.nav-tab[data-nav="reader"].active) .process-timeline-list {
  flex: 1 1 auto;
  height: auto !important;
  max-height: calc(100vh - 260px);
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: auto;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .process-timeline-card {
  overflow-y: auto !important;
  overflow-x: hidden;
}

.workstation:has(.nav-tab[data-nav="reader"].active) .program-tool-list,
.workstation:has(.nav-tab[data-nav="reader"].active) .detected-tools-list,
.workstation:has(.nav-tab[data-nav="reader"].active) .tool-list-scroll {
  flex: 1 1 auto;
  max-height: calc(100vh - 260px);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

@media (max-width: 980px) {
  .workstation:has(.nav-tab[data-nav="reader"].active) {
    overflow: auto;
  }

  .workstation:has(.nav-tab[data-nav="reader"].active) .main-grid {
    height: auto;
    max-height: none;
  }

  .workstation:has(.nav-tab[data-nav="reader"].active) .workspace-panel,
  .workstation:has(.nav-tab[data-nav="reader"].active) .properties-panel,
  .workstation:has(.nav-tab[data-nav="reader"].active) .reader-properties-panel {
    min-height: 360px;
  }
}

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    overflow: auto;
  }

  #app,
  .app-shell,
  .workstation {
    width: 1280px;
    min-width: 1280px;
    max-width: none;
  }

  .workstation {
    min-height: 100vh;
    grid-template-rows: 72px minmax(0, 1fr) !important;
    overflow: visible;
  }

  .navbar {
    justify-content: center;
    overflow: visible;
  }

  .main-grid,
  .workstation:has(.nav-tab[data-nav="calc"].active) .main-grid {
    grid-template-columns: 220px minmax(420px, 1fr) 280px;
    grid-template-rows: minmax(0, 1fr) 188px;
    grid-template-areas:
      "tools workspace props"
      "output output props";
    gap: 10px;
    padding: 10px;
    min-height: 0;
    overflow: hidden;
  }

  .workstation:has(.nav-tab[data-nav="reader"].active) .main-grid {
    grid-template-columns: 220px minmax(420px, 1fr) 320px;
    grid-template-rows: minmax(0, 1fr) 170px;
    grid-template-areas:
      "tools workspace props"
      "output output props";
    gap: 12px;
    padding: 0 20px 14px;
    height: calc(100vh - 72px);
    max-height: calc(100vh - 72px);
    overflow: hidden;
  }

  .tool-panel {
    grid-area: tools;
  }

  .workspace-panel {
    grid-area: workspace;
  }

  .properties-panel {
    grid-area: props;
  }

  .output-panel {
    grid-area: output;
  }

  .tool-list {
    grid-auto-flow: row;
    grid-auto-columns: initial;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .tool-btn {
    min-width: 0;
  }

  .workspace-body {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .action-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .segmented.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workstation:has(.nav-tab[data-nav="reader"].active) .workspace-panel,
  .workstation:has(.nav-tab[data-nav="reader"].active) .properties-panel,
  .workstation:has(.nav-tab[data-nav="reader"].active) .reader-properties-panel {
    min-height: 0;
  }
}

@media (max-width: 899px) {
  body.mobile-desktop-viewer-active {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    overscroll-behavior: none;
    background: #020711;
  }

  body.mobile-desktop-viewer-active #mobileViewport {
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    touch-action: none;
    background:
      radial-gradient(circle at 20% 12%, rgba(0, 220, 255, .12), transparent 30%),
      radial-gradient(circle at 80% 18%, rgba(177, 88, 255, .12), transparent 32%),
      #020711;
  }

  body.mobile-desktop-viewer-active #desktopCanvas {
    width: 1920px;
    height: 1080px;
    transform-origin: 0 0;
    will-change: transform;
  }

  body.mobile-desktop-viewer-active #app,
  body.mobile-desktop-viewer-active .app-shell,
  body.mobile-desktop-viewer-active .workstation {
    width: 1920px !important;
    min-width: 1920px !important;
    max-width: none !important;
    height: 1080px !important;
    min-height: 1080px !important;
  }

  body.mobile-desktop-viewer-active .workstation {
    grid-template-rows: 74px minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  body.mobile-desktop-viewer-active .navbar {
    min-height: 64px !important;
    margin: 12px 20px 0 !important;
    padding: 10px 14px !important;
    justify-content: center !important;
    gap: 12px !important;
    overflow: visible !important;
  }

  body.mobile-desktop-viewer-active .nav-tab {
    min-width: auto !important;
    padding: 0 18px !important;
  }

  body.mobile-desktop-viewer-active .main-grid,
  body.mobile-desktop-viewer-active .workstation:has(.nav-tab[data-nav="calc"].active) .main-grid {
    grid-template-columns: 220px minmax(420px, 1fr) 280px !important;
    grid-template-rows: minmax(0, 1fr) 188px !important;
    grid-template-areas:
      "tools workspace props"
      "output output props" !important;
    gap: 10px !important;
    padding: 10px !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  body.mobile-desktop-viewer-active .workstation:has(.nav-tab[data-nav="reader"].active) .main-grid {
    grid-template-columns: 220px minmax(420px, 1fr) 320px !important;
    grid-template-rows: minmax(0, 1fr) 170px !important;
    grid-template-areas:
      "tools workspace props"
      "output output props" !important;
    gap: 12px !important;
    padding: 0 20px 14px !important;
    height: calc(1080px - 74px) !important;
    max-height: calc(1080px - 74px) !important;
    overflow: hidden !important;
  }

  body.mobile-desktop-viewer-active .tool-panel {
    grid-area: tools !important;
  }

  body.mobile-desktop-viewer-active .workspace-panel {
    grid-area: workspace !important;
  }

  body.mobile-desktop-viewer-active .properties-panel {
    grid-area: props !important;
  }

  body.mobile-desktop-viewer-active .output-panel {
    grid-area: output !important;
  }

  body.mobile-desktop-viewer-active .tool-list {
    grid-auto-flow: row !important;
    grid-auto-columns: initial !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.mobile-desktop-viewer-active .tool-btn {
    min-width: 0 !important;
  }

  body.mobile-desktop-viewer-active .workspace-body {
    grid-template-rows: auto minmax(0, 1fr) !important;
  }

  body.mobile-desktop-viewer-active .action-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.mobile-desktop-viewer-active .segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.mobile-desktop-viewer-active .segmented.three {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.mobile-desktop-viewer-active .home-main {
    width: 1920px !important;
    min-width: 1920px !important;
    height: 1080px !important;
    min-height: 1080px !important;
    padding: 14px 20px !important;
    overflow: hidden !important;
  }

  body.mobile-desktop-viewer-active .home-dashboard {
    max-width: 1760px !important;
    min-height: calc(1080px - 28px) !important;
    height: calc(1080px - 28px) !important;
    margin: 0 auto !important;
  }

  body.mobile-desktop-viewer-active .home-media-grid {
    grid-template-columns: minmax(270px, 22%) minmax(560px, 1fr) minmax(270px, 22%) !important;
    height: auto !important;
    min-height: 0 !important;
  }

  body.mobile-desktop-viewer-active .home-banner {
    min-height: 240px !important;
    border-radius: 24px !important;
  }

  body.mobile-desktop-viewer-active .home-banner-overlay {
    padding: 38px 84px !important;
  }

  body.mobile-desktop-viewer-active .home-banner h1 {
    font-size: clamp(38px, 5.5vw, 72px) !important;
  }

  body.mobile-desktop-viewer-active .home-youtube-add,
  body.mobile-desktop-viewer-active .home-music-actions,
  body.mobile-desktop-viewer-active .home-music-nav {
    flex-wrap: nowrap !important;
  }

  body.mobile-desktop-viewer-active .home-youtube-add input,
  body.mobile-desktop-viewer-active .home-youtube-add button,
  body.mobile-desktop-viewer-active .home-music-actions button,
  body.mobile-desktop-viewer-active .home-music-nav button {
    width: auto !important;
  }

  body.mobile-desktop-viewer-active .home-video-list,
  body.mobile-desktop-viewer-active .home-music-list {
    min-height: 0 !important;
  }
}

/* Mobile panel UI: phones use drawers, desktop remains unchanged. */
.mobile-drawer-toggle {
  display: none;
}

.mobile-edge {
  display: none;
}

.mobile-help-toast {
  display: none;
}

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-tap-highlight-color: transparent;
  }

  #mobileViewport,
  #desktopCanvas {
    display: contents;
  }

  #app,
  .app-shell,
  .workstation {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
  }

  .workstation {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    overflow-x: hidden !important;
    background:
      radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.14), transparent 34%),
      radial-gradient(circle at 92% 14%, rgba(168, 85, 247, 0.16), transparent 38%),
      #020617 !important;
  }

  .titlebar,
  .statusbar {
    display: none !important;
  }

  .navbar {
    display: flex !important;
    width: 100vw !important;
    min-height: 56px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    justify-content: flex-start !important;
    border-radius: 0 !important;
    border-width: 0 0 1px !important;
    scrollbar-width: none;
  }

  .navbar::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    height: 40px !important;
    padding: 0 13px !important;
    font-size: 13px !important;
    border-radius: 13px !important;
  }

  #mainPageRoot {
    min-width: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
  }

  .main-grid,
  .workstation:has(.nav-tab[data-nav="calc"].active) .main-grid,
  .workstation:has(.nav-tab[data-nav="reader"].active) .main-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) 150px !important;
    grid-template-areas:
      "workspace"
      "output" !important;
    width: 100vw !important;
    min-width: 0 !important;
    height: calc(100vh - 56px) !important;
    max-height: calc(100vh - 56px) !important;
    min-height: 0 !important;
    padding: 8px !important;
    gap: 8px !important;
    overflow: hidden !important;
  }

  .workspace-panel {
    grid-area: workspace !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .workspace-panel .workspace-body {
    min-height: 0 !important;
    overflow: auto !important;
  }

  .output-panel {
    grid-area: output !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 150px !important;
    overflow: hidden !important;
  }

  .tool-panel,
  .properties-panel {
    position: fixed !important;
    top: 56px !important;
    bottom: 0 !important;
    width: 82vw !important;
    max-width: 360px !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    pointer-events: auto !important;
    touch-action: pan-y;
    border: 1px solid rgba(103, 232, 249, 0.24) !important;
    background:
      linear-gradient(150deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.96)),
      rgba(5, 15, 35, 0.96) !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48), 0 0 18px rgba(34, 211, 238, 0.1) !important;
    backdrop-filter: none !important;
    will-change: transform;
    transition: transform 180ms ease-out !important;
  }

  .tool-panel {
    left: 0 !important;
    transform: translate3d(-105%, 0, 0) !important;
    border-radius: 0 18px 18px 0 !important;
  }

  .properties-panel {
    right: 0 !important;
    transform: translate3d(105%, 0, 0) !important;
    border-radius: 18px 0 0 18px !important;
  }

  .workstation.mobile-left-open .tool-panel {
    transform: translate3d(0, 0, 0) !important;
  }

  .workstation.mobile-right-open .properties-panel {
    transform: translate3d(0, 0, 0) !important;
  }

  .tool-panel .tool-list,
  .properties-panel .properties-body,
  .reader-tool-list,
  .reader-properties-panel .program-reader-section {
    min-height: 0 !important;
    overflow-y: auto !important;
  }

  .properties-panel input,
  .properties-panel textarea,
  .properties-panel select,
  .tool-panel input,
  .tool-panel textarea,
  .tool-panel select {
    font-size: 16px !important;
  }

  .mobile-drawer-toggle {
    position: fixed;
    top: 45%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 70px;
    z-index: 100000;
    border: 1px solid rgba(103, 232, 249, 0.34);
    color: #a5f3fc;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(49, 46, 129, 0.82));
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.18);
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-50%);
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    user-select: none;
  }

  .mobile-drawer-toggle *,
  .mobile-arrow-left *,
  .mobile-arrow-right * {
    pointer-events: none !important;
  }

  .mobile-arrow-left {
    left: 0;
    border-left: 0;
    border-radius: 0 14px 14px 0;
  }

  .mobile-arrow-right {
    right: 0;
    border-right: 0;
    border-radius: 14px 0 0 14px;
  }

  .workstation.mobile-left-open .mobile-arrow-left,
  .workstation.mobile-right-open .mobile-arrow-right {
    color: #ffffff;
    border-color: rgba(216, 180, 254, 0.72);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.9), rgba(147, 51, 234, 0.92));
    box-shadow: 0 0 26px rgba(168, 85, 247, 0.5);
  }

  .mobile-drawer-toggle,
  .mobile-arrow-left,
  .mobile-arrow-right {
    display: none !important;
    pointer-events: none !important;
  }

  .mobile-edge {
    position: fixed;
    top: 70px;
    bottom: 0;
    display: block !important;
    width: 44px;
    z-index: 99999;
    pointer-events: auto;
    touch-action: pan-y;
    opacity: 0.55;
  }

  .mobile-edge-left {
    left: 0;
    background: linear-gradient(to right, rgba(0, 255, 255, 0.22), rgba(0, 255, 255, 0.08), transparent);
  }

  .mobile-edge-right {
    right: 0;
    background: linear-gradient(to left, rgba(0, 255, 255, 0.22), rgba(0, 255, 255, 0.08), transparent);
  }

  .mobile-edge.active {
    opacity: 0.35;
  }

  .mobile-help-toast {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 18px;
    z-index: 120000;
    display: block;
    padding: 12px 44px 12px 14px;
    border: 1px solid rgba(0, 255, 255, 0.35);
    border-radius: 14px;
    color: #dff;
    background: rgba(5, 15, 35, 0.92);
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.25);
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .mobile-help-toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .mobile-help-toast-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(125, 249, 255, 0.28);
    border-radius: 999px;
    color: #e0f2fe;
    background: rgba(15, 23, 42, 0.72);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
  }

  .workspace-panel,
  .workspace-body,
  .preview,
  .angle-r-preview-switcher,
  .cnc-preview,
  .cnc-image-preview,
  .cnc-preview-image-box,
  .cnc-illustration-box {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .preview {
    min-height: 0 !important;
    height: auto !important;
    padding: 10px !important;
  }

  .preview svg,
  .preview img.preview-img,
  .cnc-image-preview img,
  .cnc-preview-image-box img,
  .cnc-illustration-box img,
  .workspace-body img {
    display: block !important;
    max-width: 100% !important;
    max-height: 60vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: none !important;
  }
}
