/* ==========================================================================
   PhoneBoard Super Hardware Engineering UI (super_ui.css)
   Unified Omnisearch · Engineering Launchpad · Precision CAD Controls
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Top Command Bar Layout & Compact Precision Toolbar (1280px – 1920px+)
   -------------------------------------------------------------------------- */
.topbar {
  gap: 8px;
  padding: 0 10px;
}

.brand {
  min-width: 136px;
  max-width: 190px;
}

.brand-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #f1f5fb;
}

.brand-sub {
  font-size: 10.5px;
  color: var(--text-dim);
}

.toolbar {
  gap: 3px;
  flex-shrink: 1;
}

.tool-btn {
  height: 28px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  background: linear-gradient(180deg, #1d2431 0%, #171d27 100%);
  border: 1px solid #2a3446;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.tool-btn.icon-only {
  width: 27px;
  padding: 0;
}

.tool-btn:hover {
  background: linear-gradient(180deg, #263042 0%, #1e2635 100%);
  border-color: #3e4d66;
  color: #f3f6fc;
}

.tool-btn.active {
  background: linear-gradient(180deg, rgba(220, 160, 58, 0.2) 0%, rgba(220, 160, 58, 0.09) 100%);
  border-color: rgba(220, 160, 58, 0.65);
  color: #f8e3ba;
  box-shadow: inset 0 1px 0 rgba(255, 226, 168, 0.12);
}

.tool-btn.active .ic {
  color: #f4b649;
}

/* Highlighted "BIOS и Схемы" Button */
#btnBiosArchive,
.tool-btn-bios {
  background: linear-gradient(180deg, rgba(220, 160, 58, 0.22) 0%, rgba(220, 160, 58, 0.1) 100%);
  border-color: rgba(220, 160, 58, 0.58);
  color: #fbe5bc;
  font-weight: 600;
  box-shadow: 0 0 14px rgba(220, 160, 58, 0.14), inset 0 1px 0 rgba(255, 235, 190, 0.14);
}

#btnBiosArchive .ic,
.tool-btn-bios .ic {
  color: #f5b84b;
}

#btnBiosArchive:hover,
.tool-btn-bios:hover {
  background: linear-gradient(180deg, rgba(220, 160, 58, 0.32) 0%, rgba(220, 160, 58, 0.16) 100%);
  border-color: #eab34f;
  color: #fff6e5;
  box-shadow: 0 0 18px rgba(220, 160, 58, 0.24), inset 0 1px 0 rgba(255, 240, 200, 0.2);
}

/* Highlighted "DeepSeek" AI Button */
#btnOpenAiTab,
.tool-btn-ai {
  background: linear-gradient(180deg, rgba(44, 165, 104, 0.22) 0%, rgba(44, 165, 104, 0.09) 100%);
  border-color: rgba(44, 165, 104, 0.56);
  color: #dcfaec;
  font-weight: 600;
  box-shadow: 0 0 14px rgba(44, 165, 104, 0.14), inset 0 1px 0 rgba(167, 243, 208, 0.14);
}

#btnOpenAiTab .ic,
.tool-btn-ai .ic {
  color: #4ade80;
}

#btnOpenAiTab:hover,
.tool-btn-ai:hover {
  background: linear-gradient(180deg, rgba(44, 165, 104, 0.32) 0%, rgba(44, 165, 104, 0.16) 100%);
  border-color: #3dd68c;
  color: #f0fdf6;
  box-shadow: 0 0 18px rgba(44, 165, 104, 0.24), inset 0 1px 0 rgba(167, 243, 208, 0.2);
}

/* Responsive Toolbar Compaction — Zero Clipping on 1280px–1620px */
@media (max-width: 1640px) {
  #btnCmdPalette {
    width: 27px;
    padding: 0;
    justify-content: center;
  }
  #btnCmdPalette span {
    display: none;
  }
  #btnToggleFlylines span,
  #btnToggleLabels span,
  #btnToggleEquBoxes span,
  #btnToggleNetTraces span,
  #btnToggleBright span {
    display: none;
  }
  #btnToggleFlylines,
  #btnToggleLabels,
  #btnToggleEquBoxes,
  #btnToggleNetTraces,
  #btnToggleBright {
    width: 27px;
    padding: 0;
    justify-content: center;
  }
  .status-pill {
    max-width: 128px;
  }
}

@media (max-width: 1380px) {
  #btnFit span,
  #btnFlipX span,
  #btnFlipY span,
  #btnPinboard > span:not(.ct-pin-badge) {
    display: none;
  }
  #btnFit,
  #btnFlipX,
  #btnFlipY {
    width: 27px;
    padding: 0;
    justify-content: center;
  }
  .brand {
    min-width: 118px;
    max-width: 150px;
  }
  .status-pill {
    max-width: 105px;
  }
}

/* --------------------------------------------------------------------------
   2. Global Unified Omnisearch Bar & Glass-Matte Dropdown
   -------------------------------------------------------------------------- */
.omni-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 280px;
  min-width: 190px;
  max-width: 440px;
  height: 30px;
  padding: 0 7px 0 9px;
  background: #0c0f15;
  border: 1px solid #2d384b;
  border-radius: 6px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.omni-search-wrap:hover {
  border-color: #3d4b63;
}

.omni-search-wrap:focus-within {
  background: #0a0d12;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(220, 160, 58, 0.18), inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.omni-search-ic {
  width: 13.5px;
  height: 13.5px;
  color: var(--accent);
  flex-shrink: 0;
  opacity: 0.9;
}

.omni-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1;
}

.omni-search-input::placeholder {
  color: #6b788e;
}

.omni-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.omni-clear-btn {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.omni-clear-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.omni-kbd {
  cursor: pointer;
  font-size: 9.5px;
  padding: 1px 5px;
  color: #8b98ad;
  background: #161b24;
  border-color: #2f3a4e;
  flex-shrink: 0;
}

.omni-kbd:hover {
  color: #f6ce7b;
  border-color: rgba(220, 160, 58, 0.5);
}

/* Floating Glass-Matte Omnisearch Dropdown */
.omni-dropdown {
  position: fixed;
  top: 48px;
  left: 180px;
  width: min(640px, calc(100vw - 24px));
  max-height: min(74vh, 540px);
  z-index: 4500;
  display: flex;
  flex-direction: column;
  background: rgba(17, 21, 29, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid #3a475d;
  border-radius: 8px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
  user-select: none;
}

.omni-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(25, 31, 43, 0.92);
  border-bottom: 1px solid #293344;
  flex-shrink: 0;
}

.omni-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.omni-pill {
  background: #131821;
  color: var(--text-dim);
  border: 1px solid #2b3547;
  border-radius: 4px;
  padding: 3px 8px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s ease;
}

.omni-pill:hover {
  color: var(--text);
  border-color: #41506b;
  background: #1c2330;
}

.omni-pill.active {
  background: rgba(220, 160, 58, 0.18);
  border-color: rgba(220, 160, 58, 0.65);
  color: #fbe3b5;
}

.omni-status-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.omni-results-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0;
}

.omni-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid rgba(42, 52, 68, 0.42);
  cursor: pointer;
  transition: background 0.08s ease, border-color 0.08s ease;
}

.omni-item:last-child {
  border-bottom: none;
}

.omni-item:hover,
.omni-item.is-active {
  background: rgba(42, 53, 72, 0.65);
  border-left-color: var(--accent);
}

.omni-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

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

.omni-item-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: #eef3fa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.omni-item-title mark {
  background: rgba(220, 160, 58, 0.28);
  color: #ffe7b8;
  border-radius: 2px;
  padding: 0 2px;
}

.omni-item-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Colored Category Badges */
.omni-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.omni-badge--board {
  background: rgba(44, 165, 104, 0.17);
  border: 1px solid rgba(44, 165, 104, 0.52);
  color: #6ee7b7;
}

.omni-badge--bios {
  background: rgba(220, 160, 58, 0.17);
  border: 1px solid rgba(220, 160, 58, 0.52);
  color: #fcd385;
}

.omni-badge--pdf {
  background: rgba(59, 130, 246, 0.17);
  border: 1px solid rgba(59, 130, 246, 0.52);
  color: #93c5fd;
}

.omni-meta-chip {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 0 5px;
  border-radius: 3px;
  background: #1a212d;
  border: 1px solid #2e394d;
  color: #b7c3d6;
  flex-shrink: 0;
}

.omni-meta-chip--plat {
  color: #f6ce7b;
  border-color: rgba(220, 160, 58, 0.4);
  background: rgba(220, 160, 58, 0.1);
}

.omni-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.omni-size {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
}

.omni-action-hint {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: #1b2230;
  border: 1px solid #2f3b50;
  color: #cbd5e1;
  transition: all 0.1s ease;
}

.omni-item:hover .omni-action-hint,
.omni-item.is-active .omni-action-hint {
  background: rgba(220, 160, 58, 0.2);
  border-color: rgba(220, 160, 58, 0.6);
  color: #fde4b4;
}

.omni-empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

.omni-quick-hints {
  padding: 12px 12px 14px;
}

.omni-quick-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.omni-sample-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.omni-sample-btn {
  background: #181f2b;
  color: #cdd7e6;
  border: 1px solid #2d384c;
  border-radius: 4px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
}

.omni-sample-btn:hover {
  border-color: var(--accent);
  color: #fde4b4;
  background: rgba(220, 160, 58, 0.14);
}

.omni-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(20, 25, 35, 0.95);
  border-top: 1px solid #273142;
  font-size: 10.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.omni-footer-open-db {
  background: transparent;
  border: none;
  color: #f4b649;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.omni-footer-open-db:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   3. Engineering Launchpad Card (#canvasOverlay)
   -------------------------------------------------------------------------- */
.canvas-overlay {
  background:
    radial-gradient(circle at 50% 38%, rgba(28, 38, 56, 0.55) 0%, rgba(11, 14, 19, 0.92) 72%),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px;
  backdrop-filter: blur(4px);
  padding: 18px;
  overflow-y: auto;
}

.overlay-card.hub-card {
  max-width: 690px;
  width: 100%;
  background: linear-gradient(180deg, #161c27 0%, #121720 100%);
  border: 1px solid #334055;
  border-radius: 10px;
  padding: 22px 24px 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hub-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.overlay-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  font-size: 10px;
  letter-spacing: 1.1px;
  color: #f4b649;
}

.hub-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}

.hub-kpi-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.hub-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 5px;
  background: #0e131b;
  border: 1px solid #293446;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.hub-stat-pill strong {
  color: #eef3fa;
  font-weight: 700;
}

.hub-stat-pill--boards {
  border-color: rgba(44, 165, 104, 0.4);
}
.hub-stat-pill--boards strong {
  color: #6ee7b7;
}

.hub-stat-pill--bios {
  border-color: rgba(220, 160, 58, 0.42);
}
.hub-stat-pill--bios strong {
  color: #fcd385;
}

.hub-stat-pill--pdf {
  border-color: rgba(59, 130, 246, 0.42);
}
.hub-stat-pill--pdf strong {
  color: #93c5fd;
}

.hub-card .overlay-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #f3f6fc;
  margin-bottom: 6px;
}

.hub-card .overlay-text {
  font-size: 12.5px;
  color: #9ba8bc;
  line-height: 1.5;
  margin-bottom: 14px;
}

/* Hero Omnisearch Input inside Launchpad */
.hub-search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 12px;
  background: #0b0e14;
  border: 1.5px solid #344258;
  border-radius: 7px;
  margin-bottom: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.hub-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(220, 160, 58, 0.18), inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hub-search-ic {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.hub-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #f1f5fb;
  font-family: var(--sans);
  font-size: 13px;
}

.hub-search-input::placeholder {
  color: #68768c;
}

.hub-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

/* 3 Hardware Launchpad Action Buttons */
.hub-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .hub-actions-grid {
    grid-template-columns: 1fr;
  }
}

.hub-action-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 11px;
  background: linear-gradient(180deg, #1b2230 0%, #151b26 100%);
  border: 1px solid #2e3a4e;
  border-radius: 7px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.hub-action-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #222b3d 0%, #1a2230 100%);
  border-color: #4a5b78;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.hub-action-btn--bios:hover {
  border-color: rgba(220, 160, 58, 0.7);
}

.hub-action-btn--pdf:hover {
  border-color: rgba(59, 130, 246, 0.7);
}

.hub-action-btn--upload:hover {
  border-color: rgba(44, 165, 104, 0.7);
}

.hub-action-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #f1f5fb;
}

.hub-action-btn--bios .hub-action-head .ic {
  color: #f5b84b;
}

.hub-action-btn--pdf .hub-action-head .ic {
  color: #60a5fa;
}

.hub-action-btn--upload .hub-action-head .ic {
  color: #34d399;
}

.hub-action-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

.hub-quick-section {
  border-top: 1px solid #252f40;
  padding-top: 11px;
}

.hub-quick-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.quick-btn {
  background: #181f2c;
  border: 1px solid #2d384c;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #dce4f0;
  transition: all 0.12s ease;
}

.quick-btn:hover {
  border-color: var(--accent);
  background: rgba(220, 160, 58, 0.16);
  color: #fff2d6;
}

/* Loading / Decoding Progress State on #canvasOverlay */
.hub-decode-progress {
  display: none;
  height: 4px;
  width: 100%;
  background: #0d1118;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.hub-decode-bar {
  width: 38%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #f4b649, #34d399, transparent);
  animation: hubDecodeSlide 1.1s infinite ease-in-out;
}

@keyframes hubDecodeSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(280%); }
}

.canvas-overlay.is-loading .hub-launchpad-body,
.canvas-overlay.is-loading .hub-kpi-row {
  display: none !important;
}

.canvas-overlay.is-loading .overlay-card.hub-card {
  max-width: 460px;
}

.canvas-overlay.is-loading .hub-decode-progress {
  display: block;
}

/* --------------------------------------------------------------------------
   4. Native Hardware CAD Segmented Control (#blockTabs)
   -------------------------------------------------------------------------- */
#blockTabs,
.block-tabs {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 3px;
  background: rgba(15, 19, 27, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #344156;
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#blockTabs button,
.block-tab {
  background: transparent;
  color: #9ba8bc;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 4px 11px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

#blockTabs button:hover,
.block-tab:hover {
  color: #eef3fa;
  background: rgba(255, 255, 255, 0.05);
}

#blockTabs button.active,
#blockTabs button[aria-pressed="true"],
.block-tab.active {
  background: linear-gradient(180deg, rgba(220, 160, 58, 0.26) 0%, rgba(220, 160, 58, 0.14) 100%);
  border-color: rgba(220, 160, 58, 0.68);
  color: #ffe7ba;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 232, 185, 0.16);
}

/* --------------------------------------------------------------------------
   5. Refined Catalog Chips & Tree Items
   -------------------------------------------------------------------------- */
.brand-quick-bar {
  gap: 4px;
  padding: 7px 8px;
  background: #161b24;
}

.brand-chip {
  border-radius: 4px;
  padding: 2.5px 7px;
  font-size: 10.5px;
  font-weight: 500;
  background: #11151d;
  border-color: #273142;
  transition: all 0.1s ease;
}

.brand-chip[data-brand="__fav__"],
.brand-chip[data-brand="__recent__"] {
  border-color: rgba(220, 160, 58, 0.3);
  color: #d6c39e;
}

.brand-chip.active {
  background: rgba(220, 160, 58, 0.18);
  border-color: var(--accent);
  color: #ffe5b4;
  font-weight: 600;
}

.folder-header {
  padding: 5px 8px;
  border-radius: 0;
  transition: background 0.08s ease;
}

.board-item {
  padding: 5px 8px 5px 10px;
  transition: background 0.08s ease, color 0.08s ease;
}

/* --------------------------------------------------------------------------
   6. Sleek Hardware Toast Notifications
   -------------------------------------------------------------------------- */
.super-toast-stack {
  position: fixed;
  right: 16px;
  bottom: 38px;
  z-index: 99980;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 32px));
}

.super-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  background: rgba(18, 23, 32, 0.97);
  backdrop-filter: blur(12px);
  border: 1px solid #3a4860;
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.62);
  color: #eef3fa;
  font-size: 12px;
  line-height: 1.4;
  animation: superToastIn 0.18s ease-out;
}

.super-toast--pdf {
  border-left-color: #3b82f6;
}

.super-toast--ok {
  border-left-color: #2ca568;
}

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

.super-toast-spinner {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 2px solid rgba(220, 160, 58, 0.25);
  border-top-color: #f5b84b;
  border-radius: 50%;
  animation: superSpin 0.75s linear infinite;
  flex-shrink: 0;
}

.super-toast--pdf .super-toast-spinner {
  border-color: rgba(59, 130, 246, 0.25);
  border-top-color: #60a5fa;
}

@keyframes superSpin {
  to { transform: rotate(360deg); }
}

.super-toast-body {
  flex: 1;
  min-width: 0;
}

.super-toast-title {
  font-weight: 600;
  color: #f3f6fc;
  word-break: break-word;
}

.super-toast-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   6. Precision 2-Tier Workstation Layout (Zero Overlap · Zero Clipping)
   -------------------------------------------------------------------------- */
.hidden-compat {
  display: none !important;
}

.topbar {
  height: 46px !important;
  padding: 0 12px !important;
  gap: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: linear-gradient(180deg, #151b26 0%, #10151e 100%) !important;
  border-bottom: 1px solid #242e3f !important;
}

.brand-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.nav-mode-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #0b0e14;
  border: 1px solid #283346;
  border-radius: 7px;
}

.nav-mode-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #96a4b8;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.nav-mode-btn .ic {
  width: 13.5px;
  height: 13.5px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.45;
}

.nav-mode-btn:hover {
  color: #e8eef7;
  background: rgba(255, 255, 255, 0.04);
}

.nav-mode-btn.active {
  background: linear-gradient(180deg, rgba(220, 160, 58, 0.24) 0%, rgba(220, 160, 58, 0.1) 100%);
  border-color: rgba(220, 160, 58, 0.62);
  color: #ffefd0;
  box-shadow: inset 0 1px 0 rgba(255, 232, 184, 0.15);
}

.nav-mode-pill {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.topbar .omni-search-wrap {
  flex: 1 1 320px !important;
  max-width: 520px !important;
  min-width: 210px !important;
  height: 32px !important;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 1220px) {
  .topbar-actions #btnUploadFile span,
  .topbar-actions #btnControllerAtlas span {
    display: none;
  }
  .topbar-actions #btnUploadFile,
  .topbar-actions #btnControllerAtlas {
    width: 30px;
    padding: 0;
    justify-content: center;
  }
}

/* Single Clean Left Explorer Panel (284px) + Spacious Right Inspector (318px) */
.sidebar-left {
  width: 284px !important;
}

.sidebar-left.inboard-mode .tab-btn[data-tab="devices"] {
  display: none;
}

.sidebar-left.inboard-mode .tabs {
  grid-template-columns: repeat(3, 1fr);
}

.sidebar-right {
  width: 318px !important;
}

.sidebar-laptops {
  width: 284px;
  background: linear-gradient(180deg, #111620 0%, #0e121a 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 0;
}

.sidebar-laptops.collapsed {
  display: none;
}

/* Center PCB Workstation: Docked Top Toolbar + Stage + Docked Bottom Status Bar */
.viewport-wrap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex !important;
  flex-direction: column !important;
  position: relative;
  background: #070b10;
}

.canvas-boardbar {
  min-height: 32px;
  padding: 3px 10px;
  background: #0f141e;
  border-bottom: 1px solid #1e2738;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  z-index: 9;
}

.cbb-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.canvas-toolbar {
  height: 34px;
  padding: 0 10px;
  background: #131925;
  border-bottom: 1px solid #232d3f;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-shrink: 0;
  z-index: 8;
  overflow-x: auto;
  scrollbar-width: none;
}

.canvas-toolbar::-webkit-scrollbar {
  display: none;
}

.ctb-board-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 60px;
}

.ctb-tools {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.ctb-tools .tool-btn {
  height: 26px !important;
  padding: 0 7px !important;
  font-size: 11px !important;
}

.ctb-tools .tool-btn.icon-only {
  width: 26px !important;
  padding: 0 !important;
}

/* Hide redundant injected toolbar zoom pill inside compact canvas toolbar */
.ctb-tools .ct-tb-zoom {
  display: none !important;
}

/* Dock #blockTabs (Side A / Side B / Both) inline inside .canvas-boardbar instead of floating over the PCB! */
.canvas-boardbar #blockTabs,
.canvas-boardbar .block-tabs {
  position: static !important;
  top: auto !important;
  left: auto !important;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap !important;
  padding: 2px;
  background: #090c12 !important;
  border: 1px solid #2e3b50 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  flex-shrink: 0;
}

.canvas-boardbar #blockTabs.hidden {
  display: none !important;
}

.canvas-boardbar #blockTabs button,
.canvas-boardbar .block-tab {
  padding: 2px 8px !important;
  font-size: 11px !important;
  white-space: nowrap !important;
}

@media (max-width: 1460px) {
  .ctb-tools #btnToggleFlylines span,
  .ctb-tools #btnToggleLabels span,
  .ctb-tools #btnToggleEquBoxes span,
  .ctb-tools #btnToggleNetTraces span,
  .ctb-tools #btnFit span {
    display: none !important;
  }
  .ctb-tools #btnToggleFlylines,
  .ctb-tools #btnToggleLabels,
  .ctb-tools #btnToggleEquBoxes,
  .ctb-tools #btnToggleNetTraces,
  .ctb-tools #btnFit {
    width: 26px !important;
    padding: 0 !important;
    justify-content: center;
  }
}

.canvas-stage {
  flex: 1;
  min-height: 0;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.canvas-stage #pcbCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Docked Single-Row Bottom Status Bar (Never floats over PCB, never wraps Zoom!) */
.viewport-wrap > .canvas-hud-bottom {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  height: 26px;
  padding: 0 10px !important;
  background: #10151e !important;
  border: none !important;
  border-top: 1px solid #222b3a !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  flex-shrink: 0;
  white-space: nowrap !important;
  overflow: hidden;
}

.hud-left,
.hud-right {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  white-space: nowrap;
}

.hud-status-txt {
  font-size: 11px;
  color: #94a3b8;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-seo-link {
  font-size: 10.5px;
  color: #64748b;
  text-decoration: none;
  border-left: 1px solid #242f42;
  padding-left: 8px;
}

.hud-seo-link:hover {
  color: #f5b84b;
  text-decoration: underline;
}

/* Right Inspector Header Polish — Keep Chip Action Buttons Compact & Unwrapped */
.chip-side-head {
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 8px !important;
}

.chip-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip-side-actions .mini-btn {
  padding: 2px 6px !important;
  font-size: 10.5px !important;
  height: 22px;
  white-space: nowrap;
}

.lap-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px 6px;
  background: #151c28;
  border-bottom: 1px solid #242f42;
  flex-shrink: 0;
}

.lap-col-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f1f5fb;
}

.lap-total-pill {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 10px;
  padding: 1px 7px;
}

.lap-mode-tabs {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 0.9fr 0.9fr;
  background: #131924;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.lap-tab {
  background: transparent;
  color: #8c9bb0;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 6px 4px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.lap-tab:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.03);
}

.lap-tab.active {
  color: #f5b84b;
  border-bottom-color: #f5b84b;
  background: rgba(245, 184, 75, 0.07);
}

.lap-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 20px;
  font-size: 11.5px;
  color: #cfd8e6;
  cursor: pointer;
  border-left: 2px solid transparent;
  border-bottom: 1px solid rgba(36, 46, 62, 0.38);
  transition: background 0.1s, color 0.1s;
}

.lap-item:hover {
  background: #1a2333;
  color: #ffffff;
}

.lap-item.active {
  background: rgba(245, 184, 75, 0.14);
  border-left-color: #f5b84b;
  color: #fff3d6;
}

.lap-item.loading {
  opacity: 0.65;
  pointer-events: none;
}

.lap-item-ic {
  color: #7d8da6;
  display: inline-flex;
  flex-shrink: 0;
}

.lap-item-txt {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lap-badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.lap-b-cad {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.38);
}

.lap-b-arch {
  color: #5eead4;
  background: rgba(20, 184, 166, 0.1);
  border-color: rgba(20, 184, 166, 0.32);
}

.lap-b-pdf {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.38);
}

.lap-b-bios {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.38);
}

.lap-more-btn {
  display: block;
  width: calc(100% - 24px);
  margin: 5px 12px 7px;
  padding: 5px 8px;
  background: #182030;
  color: #93c5fd;
  border: 1px solid #2b3952;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.lap-more-btn:hover {
  background: #202b40;
  border-color: #4b6591;
}

.lap-toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 9999;
  max-width: 380px;
  padding: 9px 14px;
  background: #171f2e;
  color: #f1f5f9;
  border: 1px solid #3b4c68;
  border-left: 3px solid #f5b84b;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.lap-toast.err {
  border-left-color: #ef4444;
}

.lap-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   10. Component Nominal Badges + Real Photo Overlay Studio (#photoOverlayPopover)
   -------------------------------------------------------------------------- */
.nom-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(15, 23, 36, 0.92);
  border: 1px solid rgba(103, 232, 249, 0.35);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nom-muted {
  color: #8292a8;
  font-size: 11px;
  margin-right: 4px;
}

.nom-pdf-btn {
  padding: 1px 6px !important;
  font-size: 10px !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, 0.45) !important;
}

.ht-nom {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}

.tool-btn-photo {
  border-color: rgba(16, 185, 129, 0.42) !important;
  color: #a7f3d0 !important;
}

.tool-btn-photo:hover,
.tool-btn-photo.active {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: #34d399 !important;
  color: #ecfdf5 !important;
}

.photo-overlay-pop {
  position: absolute;
  top: 10px;
  right: 58px;
  width: 280px;
  max-width: calc(100% - 70px);
  z-index: 38;
  background: rgba(16, 21, 30, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #35455e;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.65);
  color: #e2e8f0;
  font-size: 11.5px;
  user-select: none;
}

.photo-overlay-pop.drag-over {
  border-color: #34d399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.35), 0 18px 42px rgba(0, 0, 0, 0.65);
}

.po-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: #141b26;
  border-bottom: 1px solid #273347;
  border-radius: 8px 8px 0 0;
}

.po-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 11.5px;
  color: #f8fafc;
}

.po-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.75);
}

.po-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
}

.po-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.po-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.po-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  background: #0d131c;
  border: 1px solid #263347;
  border-radius: 6px;
  cursor: pointer;
}

.po-toggle-row input {
  margin-top: 2px;
  accent-color: #10b981;
}

.po-toggle-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.po-toggle-txt strong {
  font-size: 11.5px;
  color: #ecfdf5;
}

.po-toggle-txt small {
  font-size: 10px;
  color: #8b9bb3;
  line-height: 1.3;
}

.po-sec-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.po-loaded-pill {
  padding: 1px 6px;
  border-radius: 9px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  font-size: 9.5px;
  text-transform: none;
}

.po-upload-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.po-btn {
  flex: 1;
  min-width: 72px;
  padding: 5px 8px;
  border-radius: 5px;
  border: 1px solid #324158;
  background: #1b2434;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.po-btn:hover {
  background: #232f44;
  border-color: #4b6185;
}

.po-btn-primary {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.52);
  color: #d1fae5;
}

.po-btn-primary:hover {
  background: rgba(16, 185, 129, 0.28);
}

.po-btn-danger {
  flex: 0 0 auto;
  min-width: 54px;
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.po-btn-cal {
  width: 100%;
  background: rgba(245, 184, 75, 0.16);
  border-color: rgba(245, 184, 75, 0.55);
  color: #fde68a;
}

.po-drop-hint {
  font-size: 10px;
  color: #7d8da6;
  line-height: 1.35;
}

.po-slider-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.po-slider-lbl {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #cbd5e1;
}

.po-slider-group input[type="range"] {
  width: 100%;
  accent-color: #34d399;
  cursor: pointer;
}

.po-align-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.po-mini {
  padding: 4px 4px;
  border-radius: 4px;
  border: 1px solid #2b384d;
  background: #131a25;
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.po-mini:hover,
.po-mini.active {
  border-color: #f5b84b;
  color: #fde68a;
  background: rgba(245, 184, 75, 0.12);
}

.po-cal-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 4px;
  border-top: 1px solid #232e40;
}

.po-cal-sub {
  font-size: 9.8px;
  color: #7d8da6;
  line-height: 1.35;
}

.po-cal-active {
  padding: 6px 8px;
  border-radius: 5px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.48);
  color: #67e8f9;
  font-size: 10.5px;
  font-weight: 700;
}
