/* ==========================================================================
   SMART ELECTRONICS WORKBENCH - ADVANCED DESIGN SYSTEM
   Modern, Eye-Friendly, High-Contrast, Dynamic Light/Dark Theme Support
   ========================================================================== */

/* --------------------------------------------------------------------------
   THEME VARIABLES
   -------------------------------------------------------------------------- */
:root,
[data-theme="dark"] {
  --color-mode: "dark";
  --bg-app: #090d16;
  --bg-surface: #0f172a;
  --bg-card: #131d31;
  --bg-card-hover: #19243d;
  --bg-card-subtle: #172238;
  --bg-input: #0c1424;
  --bg-glass: rgba(15, 23, 42, 0.85);

  --border-subtle: #1e293b;
  --border-color: #2a374f;
  --border-bright: #3b4d6b;
  --border-focus: #38bdf8;

  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-bright: #ffffff;
  --text-inverse: #0f172a;

  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-glow: rgba(56, 189, 248, 0.25);
  --accent-bg: rgba(56, 189, 248, 0.12);

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --success-bg: rgba(16, 185, 129, 0.12);

  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --warning-bg: rgba(245, 158, 11, 0.12);

  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --danger-bg: rgba(239, 68, 68, 0.12);

  --purple: #a855f7;
  --purple-bg: rgba(168, 85, 247, 0.12);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px -5px rgba(56, 189, 248, 0.3);

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

[data-theme="light"] {
  --color-mode: "light";
  --bg-app: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.88);

  --border-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-bright: #cbd5e1;
  --border-focus: #0284c7;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-bright: #0f172a;
  --text-inverse: #ffffff;

  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-glow: rgba(2, 132, 199, 0.2);
  --accent-bg: rgba(2, 132, 199, 0.08);

  --success: #059669;
  --success-glow: rgba(5, 150, 105, 0.18);
  --success-bg: rgba(5, 150, 105, 0.1);

  --warning: #d97706;
  --warning-glow: rgba(217, 119, 6, 0.18);
  --warning-bg: rgba(217, 119, 6, 0.1);

  --danger: #dc2626;
  --danger-glow: rgba(220, 38, 38, 0.18);
  --danger-bg: rgba(220, 38, 38, 0.1);

  --purple: #9333ea;
  --purple-bg: rgba(147, 51, 234, 0.08);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px -5px rgba(2, 132, 199, 0.2);
}

/* --------------------------------------------------------------------------
   GLOBAL RESETS & SMOOTH THEME TRANSITION
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.theme-transition,
body.theme-transition *,
body.theme-transition *::before,
body.theme-transition *::after {
  transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transition-delay: 0s !important;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  font-size: 14.5px;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

/* --------------------------------------------------------------------------
   SITE HEADER & NAVIGATION
   -------------------------------------------------------------------------- */
.site-header {
  background-color: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-bg);
  border: 1px solid var(--accent-glow);
}

.brand-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent));
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.2px;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Live Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 600;
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-glow);
  box-shadow: 0 0 10px -2px var(--success-glow);
}

.status-badge.disconnected {
  background-color: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-glow);
  box-shadow: 0 0 10px -2px var(--danger-glow);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.device-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.device-badge.listening {
  background-color: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.device-badge.connected {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 11px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
  color: var(--accent);
}

.theme-icon {
  width: 17px;
  height: 17px;
}

.mode-toggle-btn {
  background: var(--accent-bg);
  border: 1px solid var(--accent-glow);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mode-toggle-btn:hover {
  background: var(--accent);
  color: var(--text-inverse);
  box-shadow: var(--shadow-glow);
}

/* --------------------------------------------------------------------------
   TAB NAVIGATION (Segmented Control)
   -------------------------------------------------------------------------- */
.tab-nav-wrapper {
  padding: 16px 28px 0;
  background-color: var(--bg-app);
}

.tab-nav {
  display: inline-flex;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 4px;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-bright);
  background-color: var(--bg-card-hover);
}

.tab-btn.active {
  background-color: var(--bg-card);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.tab-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   MAIN LAYOUT & CARDS
   -------------------------------------------------------------------------- */
.dashboard-container {
  flex: 1;
  padding: 20px 28px 40px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.tab-content.active {
  display: block;
}

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

.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
  align-items: start;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  position: relative;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.card:hover {
  border-color: var(--border-bright);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -0.2px;
}

.card-title-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
  margin-right: 8px;
}

.card-title-text {
  display: flex;
  align-items: center;
}

/* --------------------------------------------------------------------------
   FORM CONTROLS & INPUTS
   -------------------------------------------------------------------------- */
.input-group {
  margin-bottom: 16px;
}

.input-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
  box-shadow: var(--shadow-glow);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.btn-accent:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-card-hover);
  border-color: var(--border-bright);
}

.btn-danger {
  background-color: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-glow);
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   CHIP / QUICK ACTION BUTTONS
   -------------------------------------------------------------------------- */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.chip:hover {
  background-color: var(--accent-bg);
  border-color: var(--accent-glow);
  color: var(--accent);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   BENCHTOP SCREEN MIRROR (Realistic hardware display)
   -------------------------------------------------------------------------- */
.mirror-bezel {
  background: #020617;
  border: 2px solid #1e293b;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.6);
}

.mirror-titlebar {
  background: #090e1a;
  border-bottom: 1px solid #1e293b;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mirror-dots {
  display: flex;
  gap: 6px;
}

.mirror-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.mirror-dot.red { background-color: #ef4444; }
.mirror-dot.yellow { background-color: #f59e0b; }
.mirror-dot.green { background-color: #10b981; }

.mirror-screen-title {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.mirror-screen-type {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.mirror-content-area {
  padding: 20px;
  min-height: 400px;
  max-height: 560px;
  overflow-y: auto;
  background-color: #050811;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
}

.mirror-content-area h1,
.mirror-content-area h2,
.mirror-content-area h3 {
  color: #38bdf8;
  margin-bottom: 12px;
  font-family: var(--font-family);
  font-weight: 700;
}

.mirror-content-area pre,
.mirror-content-area code {
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 10px;
  color: #7dd3fc;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-x: auto;
}

.mirror-content-area table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 12.5px;
}

.mirror-content-area th,
.mirror-content-area td {
  border: 1px solid #1e293b;
  padding: 8px 12px;
  text-align: left;
}

.mirror-content-area th {
  background: #0b1120;
  color: #38bdf8;
}

.mirror-footer {
  background: #090e1a;
  border-top: 1px solid #1e293b;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   SYSTEM STATUS & MCP TELEMETRY CARD
   -------------------------------------------------------------------------- */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.status-metric {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.metric-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-pill {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.metric-pill.online { background: var(--success); box-shadow: 0 0 6px var(--success); }
.metric-pill.offline { background: var(--danger); }

/* --------------------------------------------------------------------------
   INVENTORY TABLE & STATS
   -------------------------------------------------------------------------- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-bg);
  color: var(--accent);
}

.stat-number {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-bright);
}

.stat-caption {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.table-container,
.table-responsive {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  box-sizing: border-box;
}

.workbench-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.workbench-table th {
  background-color: var(--bg-card-subtle);
  color: var(--text-muted);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.workbench-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13.5px;
}

.workbench-table tr:hover td {
  background-color: var(--bg-card-hover);
}

.qty-control {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.qty-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 4px 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.qty-btn:hover {
  background-color: var(--accent);
  color: var(--text-inverse);
}

.category-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-glow);
}

/* --------------------------------------------------------------------------
   LOGBOOK TIMELINE
   -------------------------------------------------------------------------- */
.log-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-item {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.log-item.reading {
  border-left-color: var(--success);
}

.log-item.oscilloscope {
  border-left-color: var(--purple);
}

.log-item.issue {
  border-left-color: var(--danger);
}

.log-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.log-type-tag {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.log-content {
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: var(--bg-surface);
  color: var(--text-bright);
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow-lg);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --------------------------------------------------------------------------
   KIOSK MODE (FULLSCREEN BENCH DISPLAY)
   -------------------------------------------------------------------------- */
body.kiosk-mode .site-header,
body.kiosk-mode .tab-nav-wrapper,
body.kiosk-mode .dashboard-container {
  display: none !important;
}

.kiosk-view {
  display: none;
}

body.kiosk-mode .kiosk-view {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background-color: #030712;
  color: #f8fafc;
}

.kiosk-header {
  background-color: #090e1a;
  border-bottom: 2px solid #1e293b;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kiosk-title-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.kiosk-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.kiosk-type-tag {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.kiosk-clock {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.kiosk-body {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
  font-size: 18px;
  line-height: 1.6;
}

.kiosk-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 16px;
}

.kiosk-body th, .kiosk-body td {
  border: 1px solid #334155;
  padding: 12px 18px;
  text-align: left;
}

.kiosk-body th {
  background: #1e293b;
  color: #38bdf8;
}

.kiosk-body pre, .kiosk-body code {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  color: #7dd3fc;
}

.kiosk-footer {
  background-color: #090e1a;
  border-top: 2px solid #1e293b;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #94a3b8;
}

/* --------------------------------------------------------------------------
   RESPONSIVE DESIGN
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   PLAYGROUND NAV BUTTON
   -------------------------------------------------------------------------- */
.playground-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  color: #38bdf8;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.playground-nav-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.1), transparent);
  transform: translateX(-100%);
  animation: playground-shimmer 3s infinite;
}
@keyframes playground-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.playground-nav-btn:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(168, 85, 247, 0.25));
  border-color: #38bdf8;
  box-shadow: 0 0 16px -2px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}
[data-theme="light"] .playground-nav-btn {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08), rgba(126, 34, 206, 0.08));
  border-color: rgba(2, 132, 199, 0.3);
  color: #0284c7;
}

/* --------------------------------------------------------------------------
   MOBILE HAMBURGER MENU
   -------------------------------------------------------------------------- */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  z-index: 101;
}
.hamburger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.mobile-menu-toggle.active .hamburger-bar:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}
.mobile-menu-toggle.active .hamburger-bar:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active .hamburger-bar:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* --------------------------------------------------------------------------
   RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */

/* === TABLET: 980px and below === */
@media (max-width: 980px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .site-header {
    padding: 10px 16px;
  }
  .tab-nav-wrapper {
    padding: 12px 16px 0;
  }
  .dashboard-container {
    padding: 16px 16px 32px;
  }
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .status-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* === MOBILE: 768px and below === */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  .site-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  .brand-title {
    font-size: 14px;
  }
  .brand-subtitle {
    font-size: 10px;
  }
  .nav-controls {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 12px;
    gap: 8px;
    z-index: 100;
    box-shadow: var(--shadow-lg);
  }
  .nav-controls.mobile-open {
    display: flex;
  }
  .nav-controls .playground-nav-btn,
  .nav-controls .mode-toggle-btn,
  .nav-controls .theme-toggle-btn {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }
  .nav-controls .device-badge,
  .nav-controls .status-badge {
    justify-content: center;
  }

  /* Tab navigation horizontal scroll */
  .tab-nav-wrapper {
    padding: 8px 8px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tab-nav {
    flex-wrap: nowrap;
    min-width: max-content;
    gap: 4px;
  }
  .tab-btn {
    font-size: 11.5px;
    padding: 8px 10px;
    white-space: nowrap;
    gap: 4px;
  }
  .tab-btn svg {
    width: 12px;
    height: 12px;
  }
  .tab-btn span {
    font-size: 11px;
  }

  /* Dashboard padding */
  .dashboard-container {
    padding: 10px 10px 24px;
  }

  /* Cards */
  .card {
    padding: 14px;
  }

  /* Soldering mirror card responsive */
  .soldering-mirror-card .tft-bezel-frame {
    min-height: 140px;
  }
  .tft-content-body {
    font-size: 10px;
    max-height: 100px;
  }
  .tft-top-bar, .tft-bottom-bar {
    font-size: 8px;
    padding: 3px 6px;
  }
  .soldering-card-header {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }

  /* Mirror bezel responsive */
  .mirror-bezel {
    border-radius: var(--radius-md);
  }
  .mirror-content-area {
    min-height: 200px;
    padding: 16px;
    font-size: 13px;
  }

  /* PTT button sizing */
  .ptt-btn {
    width: 56px;
    height: 56px;
  }
  .ptt-box {
    padding: 14px;
    gap: 12px;
  }

  /* Text areas */
  textarea {
    min-height: 60px;
    font-size: 13px;
  }

  /* Stats bar */
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .stat-box {
    padding: 10px;
  }
  .stat-number {
    font-size: 20px;
  }

  /* Tables horizontal scroll */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .workbench-table {
    min-width: 520px;
    font-size: 12px;
  }

  /* Forms responsive */
  #form-add-project,
  #form-add-inventory {
    grid-template-columns: 1fr !important;
  }

  /* Log feed */
  .log-feed {
    max-height: 400px;
  }

  /* Projects grid */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* Filter pills scroll */
  .filter-pill-bar,
  .inv-filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 6px;
  }
  .filter-pill,
  .inv-tab-pill {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 11px;
    padding: 5px 10px;
  }

  /* Chip list */
  .chip-list {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Status grid */
  .status-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Kiosk mode full screen mobile */
  .kiosk-container {
    border-radius: 0;
  }
  .kiosk-header {
    padding: 8px 12px;
    font-size: 11px;
  }
  .kiosk-body {
    padding: 16px;
    font-size: 14px;
  }
  .kiosk-footer {
    font-size: 9px;
    padding: 6px 12px;
    flex-wrap: wrap;
    gap: 4px;
  }

  /* Modal responsive */
  .modal-card {
    width: 95vw;
    max-width: 95vw;
    max-height: 85vh;
    margin: 10px;
  }
  .modal-body {
    padding: 12px;
  }
  .table-responsive {
    overflow-x: auto;
  }
}

/* === SMALL PHONE: 480px and below === */
@media (max-width: 480px) {
  .logo-group {
    gap: 8px;
  }
  .brand-icon-wrapper {
    width: 28px;
    height: 28px;
  }
  .brand-title {
    font-size: 12.5px;
  }
  .brand-subtitle {
    display: none;
  }
  .tab-btn {
    font-size: 10.5px;
    padding: 6px 8px;
  }
  .tab-btn svg {
    display: none;
  }
  .stats-bar {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .stat-box {
    padding: 8px;
  }
  .stat-number {
    font-size: 18px;
  }
  .stat-caption {
    font-size: 10px;
  }
  .card-title {
    font-size: 13px;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }
  .input-label {
    font-size: 11px;
  }
  input[type="text"],
  input[type="number"],
  select,
  textarea {
    font-size: 13px;
    padding: 8px 10px;
  }
  .btn {
    font-size: 12px;
    padding: 8px 12px;
  }
  .ptt-btn {
    width: 48px;
    height: 48px;
  }
  .ptt-status-title {
    font-size: 12px;
  }
  .ptt-transcript-text {
    font-size: 11px;
  }

  /* Soldering station even more compact */
  .soldering-mirror-card .card-title-text {
    font-size: 11px;
  }
  .tft-bezel-frame {
    border-radius: 6px;
  }
  .tft-screw {
    width: 6px;
    height: 6px;
  }

  /* Mirror content */
  .mirror-content-area {
    min-height: 160px;
    padding: 12px;
    font-size: 12px;
  }
  .mirror-titlebar {
    padding: 6px 10px;
    font-size: 10px;
  }

  /* Kiosk */
  .kiosk-body h1 {
    font-size: 20px;
  }
}

/* === TINY PHONE: 360px and below === */
@media (max-width: 360px) {
  .site-header {
    padding: 6px 8px;
  }
  .brand-title {
    font-size: 11px;
  }
  .dashboard-container {
    padding: 6px 6px 16px;
  }
  .card {
    padding: 10px;
    border-radius: var(--radius-sm);
  }
  .tab-btn {
    padding: 5px 6px;
    font-size: 10px;
  }
  .stats-bar {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   PUSH-TO-TALK (PTT) VOICE ASSISTANT STYLES (Objective 7)
   ========================================================================== */
.ptt-panel {
  background: linear-gradient(135deg, rgba(19, 29, 49, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.ptt-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, #a855f7, transparent);
}

.ptt-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tts-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.tts-toggle-label input {
  cursor: pointer;
  accent-color: var(--accent);
}

.ptt-box {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 4px;
}

.ptt-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
  flex-shrink: 0;
  outline: none;
}

.ptt-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.6);
}

.ptt-btn:active,
.ptt-btn.recording {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.7);
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.6);
}

.ptt-wave-ring {
  position: absolute;
  top: -6px; left: -6px; right: -6px; bottom: -6px;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  opacity: 0;
  pointer-events: none;
}

.ptt-btn.recording .ptt-wave-ring {
  border-color: #ef4444;
  animation: ptt-pulse 1.2s infinite ease-out;
}

.ptt-btn.recording .ptt-wave-ring.outer {
  animation: ptt-pulse 1.2s infinite ease-out 0.4s;
}

@keyframes ptt-pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.ptt-mic-icon {
  width: 26px;
  height: 26px;
}

.ptt-info {
  flex: 1;
}

.ptt-status-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.ptt-transcript-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.ptt-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.compaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-xl);
  font-size: 11px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* ==========================================================================
   CONTEXTUAL SUGGESTIONS STYLES (Objective 4)
   ========================================================================== */
.suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.btn-icon-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
}

.btn-icon-link:hover {
  text-decoration: underline;
}

.suggestion-chip {
  background: var(--bg-card-subtle);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.suggestion-chip:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--text-bright);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
}

/* ==========================================================================
   PROJECTS TAB STYLES (Objective 8)
   ========================================================================== */
.filter-pill-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover,
.filter-pill.active {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.project-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
}

.project-hw-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.project-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-xl);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.project-status-badge.in_progress {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.project-status-badge.planning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.project-status-badge.completed {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.project-bom-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.project-bom-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-bom-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.project-bom-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.project-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   INVENTORY & LAB LOGS AESTHETIC OVERHAUL (Objective 2)
   ========================================================================== */
.inv-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.inv-tab-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 13px;
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inv-tab-pill:hover,
.inv-tab-pill.active {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.inv-tab-pill.alert {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--warning);
}
.inv-tab-pill.alert.active {
  background: var(--warning);
  color: #000;
}

.inv-tab-pill.ok {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--success);
}
.inv-tab-pill.ok.active {
  background: var(--success);
  color: #000;
}

/* Category Badge Colors */
.category-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-xl);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.cat-microcontrollers { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.cat-sensors         { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.cat-power           { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.cat-audio           { background: rgba(244, 63, 94, 0.15);  color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.cat-displays        { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.cat-passive         { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.cat-semiconductors  { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.cat-connectors      { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.3); }
.cat-general        { background: rgba(148, 163, 184, 0.12); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.25); }

/* Stock Level Badges */
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.stock-badge.out {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.stock-badge.low {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.stock-badge.in_stock {
  background: rgba(100, 116, 139, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(100, 116, 139, 0.4);
}

.stock-badge.abundant {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

/* Stepper Controls */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-stepper-btn {
  background: none;
  border: none;
  color: var(--text-main);
  padding: 4px 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.qty-stepper-btn:hover {
  background: var(--accent);
  color: var(--text-inverse);
}

.qty-stepper-val {
  min-width: 32px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  color: var(--text-bright);
}

/* Measurement Chips in Logs */
.meas-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  margin: 0 3px;
  vertical-align: baseline;
}

.meas-volt {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.meas-curr {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.meas-freq {
  background: rgba(168, 85, 247, 0.18);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.45);
}

.meas-pin {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

/* ==========================================================================
   2.8-INCH SPI TFT SOLDERING STATION DISPLAY MIRROR
   ========================================================================== */
.soldering-mirror-card {
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  position: relative;
}

.soldering-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card-hover);
  border-bottom: 1px solid var(--border-color);
}

.soldering-icon {
  color: #f59e0b;
}

.soldering-header-chips {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tft-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-xl);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Realistic Hardware TFT Acrylic Bezel Frame */
.tft-bezel-frame {
  margin: 14px 16px;
  background: #111418;
  border: 3px solid #1f2937;
  border-radius: 10px;
  padding: 12px;
  position: relative;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8), 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Corner Screws */
.tft-screw {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #64748b 30%, #334155 70%);
  border: 1px solid #1e293b;
  position: absolute;
}
.tft-screw.top-left { top: 4px; left: 4px; }
.tft-screw.top-right { top: 4px; right: 4px; }
.tft-screw.bottom-left { bottom: 4px; left: 4px; }
.tft-screw.bottom-right { bottom: 4px; right: 4px; }

/* LCD Glass Screen (320x240 Aspect Ratio Simulation) */
.tft-screen-glass {
  background: #060b10;
  border: 1px solid #0f172a;
  border-radius: 4px;
  padding: 12px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 0 16px rgba(14, 165, 233, 0.08);
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  position: relative;
  overflow: hidden;
}

/* Scanline Overlay */
.tft-screen-glass::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.4;
}

.tft-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(56, 189, 248, 0.3);
  padding-bottom: 6px;
  margin-bottom: 8px;
  z-index: 1;
}

.tft-title {
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tft-temp-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 3px;
}

.tft-content-body {
  font-size: 12px;
  line-height: 1.5;
  color: #e2e8f0;
  flex: 1;
  overflow-y: auto;
  max-height: 220px;
  z-index: 1;
}

.tft-content-body p {
  margin: 0 0 6px 0;
}

.tft-content-body strong {
  color: #38bdf8;
}

.tft-content-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin: 6px 0;
}

.tft-content-body th, .tft-content-body td {
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 3px 6px;
  text-align: left;
}

.tft-content-body th {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
}

.tft-bullet-line {
  margin-bottom: 4px;
}

.tft-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed rgba(100, 116, 139, 0.3);
  padding-top: 6px;
  margin-top: 8px;
  font-size: 10px;
  color: #64748b;
  z-index: 1;
}

.tft-res-badge {
  color: #10b981;
  font-weight: 700;
}

.soldering-mirror-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px 12px;
}

/* Wiring Guide Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card-hover);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
}

.btn-icon-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-icon-close:hover {
  color: var(--text-bright);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card-hover);
}

/* ============================================================================
   WORKSTATION LIVE ADAFRUIT WIDGET BAR (RESPONSIVE & CLEAN FORMATTING)
   ============================================================================ */
.workstation-live-bar {
  background: rgba(14, 20, 32, 0.95);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  padding: 6px 16px;
  position: relative;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 12px;
}

.workstation-live-bar::-webkit-scrollbar {
  display: none;
}

.ws-bar-left, .ws-bar-center, .ws-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Radar Presence Badge */
.ws-radar-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.ws-radar-badge.active {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.ws-radar-badge.idle {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.radar-ping {
  position: relative;
  width: 8px;
  height: 8px;
}

.radar-ping-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.ws-radar-badge.active .radar-ping-dot {
  animation: radar-pulse 1.8s ease-out infinite;
}

.ws-radar-badge.idle .radar-ping-dot {
  background: #64748b;
}

@keyframes radar-pulse {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Tool Relay Chips (Soldering Iron & Glue Gun) */
.ws-tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.ws-tool-chip:hover {
  transform: translateY(-1px);
}

.ws-tool-chip.soldering.hot {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
  animation: iron-glow 2s ease-in-out infinite alternate;
}

.ws-tool-chip.soldering.cold {
  color: var(--text-muted);
}

@keyframes iron-glow {
  from { box-shadow: 0 0 8px rgba(239, 68, 68, 0.2); }
  to { box-shadow: 0 0 18px rgba(239, 68, 68, 0.5); }
}

.ws-tool-chip.gluegun.hot {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
  animation: glue-glow 2s ease-in-out infinite alternate;
}

.ws-tool-chip.gluegun.cold {
  color: var(--text-muted);
}

@keyframes glue-glow {
  from { box-shadow: 0 0 8px rgba(245, 158, 11, 0.2); }
  to { box-shadow: 0 0 18px rgba(245, 158, 11, 0.5); }
}

.ws-toggle-switch {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ws-tool-chip.hot .ws-toggle-switch {
  background: currentColor;
  color: #0f172a;
}

.ws-tool-chip.cold .ws-toggle-switch {
  background: rgba(100, 116, 139, 0.25);
  color: #94a3b8;
}

/* Telemetry Pills */
.ws-telemetry-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  flex-shrink: 0;
  white-space: nowrap;
}

.ws-telemetry-chip .val {
  color: var(--accent);
  font-weight: 700;
}

.ws-sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #64748b;
  flex-shrink: 0;
  white-space: nowrap;
}

.ws-sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.ws-sync-dot.pulsing {
  animation: ping-tiny 1s ease-in-out infinite;
}

@keyframes ping-tiny {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@media (max-width: 900px) {
  .workstation-live-bar {
    padding: 5px 12px;
    gap: 8px;
    overflow-x: auto;
    justify-content: flex-start;
  }
}

/* ==========================================================================
   2.8" SOLDERING STATION SPI DISPLAY (ILI9341) - THEMED MODAL
   ========================================================================== */
.soldering-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modal-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-fade-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.soldering-modal-window {
  background: #0b1120;
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(56, 189, 248, 0.22);
  display: flex;
  flex-direction: column;
  max-width: 95vw;
}

.soldering-modal-header {
  background: #0f172a;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  gap: 12px;
}

.smh-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.3px;
}

.smh-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: smh-ping 1.5s infinite;
}

@keyframes smh-ping {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.smh-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.smh-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.smh-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.4);
}

.smh-btn.sm-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.soldering-modal-frame {
  width: 320px;
  height: 240px;
  background: #030712;
  position: relative;
}

.soldering-modal-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ==========================================================================
   ALWAYS-VISIBLE BOTTOM RIGHT: DUAL DOCK (VOICE BUTTON + CHAT BUBBLE)
   ========================================================================== */
.wb-bottom-dock {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dock-fab {
  border: none;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  position: relative;
}

/* 1. Voice Button (Mic FAB) */
.dock-fab-voice {
  height: 48px;
  padding: 0 16px 0 12px;
  border-radius: 24px;
  background: linear-gradient(135deg, #065f46 0%, #059669 50%, #10b981 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35), 0 2px 8px rgba(0, 0, 0, 0.4);
  gap: 8px;
  border: 1.5px solid rgba(52, 211, 153, 0.4);
}

.dock-fab-voice:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.45), 0 0 16px rgba(52, 211, 153, 0.4);
}

.dock-fab-voice.recording {
  background: linear-gradient(135deg, #991b1b 0%, #dc2626 50%, #ef4444 100%);
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.6);
  animation: recording-pulse 1s infinite alternate;
}

@keyframes recording-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.voice-dock-badge {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  font-family: var(--font-mono, monospace);
  color: #ecfdf5;
}

.dock-fab-voice.recording .voice-dock-badge {
  color: #fff;
}

.voice-ripple-ring {
  position: absolute;
  inset: -6px;
  border-radius: 30px;
  border: 2px solid #10b981;
  opacity: 0;
  pointer-events: none;
}

.voice-ripple-ring.active {
  animation: voice-ring 1.2s infinite ease-out;
}

@keyframes voice-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* 2. Chat Bubble Button (Chat FAB) */
.dock-fab-chat {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 50%, #38bdf8 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.35), 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  position: relative;
}

.dock-fab-chat:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.5), 0 0 18px rgba(56, 189, 248, 0.4);
}

.chat-fab-avatar {
  font-size: 17px;
  line-height: 1;
}

.chat-fab-svg {
  display: none;
}

.chat-fab-status-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #0b1120;
  box-shadow: 0 0 6px #10b981;
}

/* ==========================================================================
   LIGHTWEIGHT FEYNMAN CHAT PANEL
   ========================================================================== */
.chat-panel {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: min(380px, calc(100% - 24px));
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  height: 520px;
  max-height: calc(100vh - 110px);
  background: rgba(11, 17, 32, 0.96);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(56, 189, 248, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9980;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

.chat-panel.active {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.chat-header {
  padding: 12px 14px;
  background: #0f172a;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.chat-title {
  font-weight: 700;
  font-size: 13.5px;
  color: #f8fafc;
  line-height: 1.2;
}

.chat-subtitle {
  font-size: 10.5px;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  margin-top: 2px;
}

.chat-latency-badge {
  color: #38bdf8;
  font-weight: 600;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-action-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #ffffff;
}

/* Quick Prompt Pills */
.chat-quick-pills {
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.chat-quick-pills::-webkit-scrollbar {
  display: none;
}

.chat-pill {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #93c5fd;
  font-size: 10.5px;
  padding: 4px 9px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-mono, monospace);
  flex-shrink: 0;
}

.chat-pill:hover {
  background: rgba(56, 189, 248, 0.22);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.45);
}

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}

.chat-msg {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.45;
  word-break: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-bottom-right-radius: 3px;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.chat-msg.assistant {
  align-self: flex-start;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-bottom-left-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-msg.assistant strong {
  color: #38bdf8;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #1e293b;
  border-radius: 12px;
  align-self: flex-start;
  margin: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.typing-indicator span {
  width: 5px;
  height: 5px;
  background: #38bdf8;
  border-radius: 50%;
  animation: chat-bounce 1.2s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes chat-bounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
.chat-input-area {
  padding: 10px 12px;
  background: #0f172a;
  border-top: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-input {
  flex: 1;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 20px;
  padding: 8px 14px;
  color: #f8fafc;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.chat-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.chat-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #1e293b;
  color: #94a3b8;
  transition: all 0.15s ease;
}

.chat-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.chat-btn.send-btn {
  background: #0284c7;
  color: #ffffff;
}

.chat-btn.send-btn:hover {
  background: #0369a1;
  transform: scale(1.05);
}

@media (max-width: 600px) {
  .chat-panel {
    bottom: 74px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    height: 65vh;
  }
  .wb-bottom-dock {
    bottom: 14px;
    right: 14px;
  }
}

/* Light Theme Overrides for Floating Widgets & Live Bar */
[data-theme="light"] .workstation-live-bar {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(2, 132, 199, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .ws-telemetry-chip {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}
[data-theme="light"] .chat-panel {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(2, 132, 199, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 0 25px rgba(2, 132, 199, 0.1);
}
[data-theme="light"] .chat-header {
  background: #f8fafc;
  border-bottom-color: rgba(2, 132, 199, 0.2);
}
[data-theme="light"] .chat-title {
  color: #0f172a;
}
[data-theme="light"] .chat-quick-pills {
  background: rgba(241, 245, 249, 0.8);
  border-bottom-color: rgba(203, 213, 225, 0.5);
}
[data-theme="light"] .chat-msg.assistant {
  background: #f1f5f9;
  color: #1e293b;
  border-color: rgba(203, 213, 225, 0.8);
}
[data-theme="light"] .chat-msg.assistant strong {
  color: #0284c7;
}
[data-theme="light"] .chat-input-area {
  background: #f8fafc;
  border-top-color: rgba(2, 132, 199, 0.2);
}
[data-theme="light"] .chat-input {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}
[data-theme="light"] .chat-btn {
  background: #e2e8f0;
  color: #475569;
}
[data-theme="light"] .soldering-modal-header {
  background: #f8fafc;
  border-bottom-color: rgba(2, 132, 199, 0.2);
}


/* =========================================================================
   AESTHETIC UPGRADE & MODERN ANIMATIONS SUITE (2026 COCKPIT THEME)
   ========================================================================= */

/* Ambient Subtle Background Gradient & Animated Grid Glow */
body {
  background-attachment: fixed;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(168, 85, 247, 0.05) 0%, transparent 40%),
    linear-gradient(to bottom, var(--bg-body), var(--bg-body-dark, #060911));
}

/* Glassmorphism Card Elevations & Micro-interactions */
.card {
  background: rgba(15, 23, 42, 0.72) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(56, 189, 248, 0.16) !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.5) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.25s ease, 
              box-shadow 0.25s ease !important;
}

.card:hover {
  border-color: rgba(56, 189, 248, 0.38) !important;
  box-shadow: 0 10px 32px -4px rgba(56, 189, 248, 0.14), 0 4px 20px rgba(0, 0, 0, 0.6) !important;
  transform: translateY(-2px);
}

/* Main Brand Header - Solid High Contrast White */
.brand-title {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: none !important;
  animation: none !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
}

@keyframes brandShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Card Entrance Staggered Animation */
@keyframes cardFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-container .card {
  animation: cardFadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dashboard-container .card:nth-child(1) { animation-delay: 0.05s; }
.dashboard-container .card:nth-child(2) { animation-delay: 0.10s; }
.dashboard-container .card:nth-child(3) { animation-delay: 0.15s; }
.dashboard-container .card:nth-child(4) { animation-delay: 0.20s; }

/* Glowing Live Node Status Indicators */
.device-badge, .status-badge {
  transition: all 0.25s ease !important;
  backdrop-filter: blur(8px);
}

.device-badge.connected, .status-badge.connected {
  border-color: rgba(16, 185, 129, 0.5) !important;
  box-shadow: 0 0 14px -2px rgba(16, 185, 129, 0.35) !important;
}

.device-badge.listening {
  border-color: rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 0 12px -2px rgba(245, 158, 11, 0.2) !important;
}

/* Modern Tab Navigation Pills with Smooth Sliding Feel */
.tab-btn {
  position: relative;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  border-radius: 8px !important;
  overflow: hidden;
}

.tab-btn:hover {
  background: rgba(56, 189, 248, 0.08) !important;
  color: #38bdf8 !important;
  transform: translateY(-1px);
}

.tab-btn.active {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #00f0ff !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  box-shadow: 0 0 16px -4px rgba(0, 240, 255, 0.3) !important;
}

/* Interactive Task Items Styling */
#widget-tasks-list .task-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: 8px;
  transition: all 0.2s ease;
}

#widget-tasks-list .task-card-item:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(30, 41, 59, 0.75);
  transform: translateX(3px);
}

#widget-tasks-list .task-card-item.completed {
  opacity: 0.55;
  text-decoration: line-through;
  background: rgba(15, 23, 42, 0.35);
}

/* Button Micro-Interactions & Glow */
.btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.08);
}

.btn:active {
  transform: scale(0.97);
}

.btn-accent, .btn-primary {
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25) !important;
}

.btn-accent:hover, .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45) !important;
}

/* Workstation Live Bar Pulsing Glow */
.workstation-live-bar {
  background: rgba(11, 17, 32, 0.88) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

/* Custom Cockpit Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 12, 20, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

/* Workbench Layout Sidebar */
.workbench-layout {
  display: flex;
  flex: 1 1 0%;
  min-height: 0;
  height: auto;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
.sidebar {
  width: 220px;
  min-width: 220px;
  background: rgba(8, 12, 20, 0.95);
  border-right: 1px solid rgba(56, 189, 248, 0.15);
  padding: 16px 0;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 8px;
  margin: 2px 8px;
  transition: all 0.2s;
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
  min-height: 44px;
}
.sidebar-nav-item.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-left: 3px solid #38bdf8;
}
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.section-panel {
  display: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.section-panel.active { display: block; }
.dashboard-overview {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Home Screen Featured Articles Grid & Thumbnail Cards */
.home-articles-section {
  margin-top: 20px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.home-articles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.home-articles-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-bright, #ffffff);
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-articles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}
.home-article-card {
  background: var(--bg-card, #131d31);
  border: 1px solid var(--border-color, #2a374f);
  border-radius: var(--radius-md, 12px);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.2s ease;
  min-height: 110px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.home-article-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 8px 24px -4px rgba(56, 189, 248, 0.22), 0 0 12px rgba(56, 189, 248, 0.1);
  background: var(--bg-card-hover, rgba(20, 30, 50, 0.85));
}
.home-article-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.home-article-thumb-mini {
  width: 44px;
  height: 44px;
  min-width: 44px;
  max-width: 44px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #060913;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.home-article-mini-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.home-article-card:hover .home-article-mini-img {
  transform: scale(1.1);
}
.home-article-tags-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.home-article-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(3, 7, 18, 0.65);
  white-space: nowrap;
}
.home-article-cat {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-article-type-icon {
  margin-left: auto;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.home-article-card:hover .home-article-type-icon {
  opacity: 1;
  transform: scale(1.1);
}
.home-article-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  justify-content: space-between;
}
.home-article-card-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main, #e2e8f0);
  line-height: 1.32;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--accent, #38bdf8);
  font-weight: 600;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.home-article-footer-label {
  letter-spacing: 0.02em;
}
.home-article-footer-icon {
  transition: transform 0.2s ease;
}
.home-article-card:hover .home-article-footer-icon {
  transform: translateX(3px);
}

@media (max-width: 1200px) {
  .home-articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .home-articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .workbench-layout {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 56px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .sidebar {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-top: 1px solid rgba(56, 189, 248, 0.15);
    display: flex;
    flex-direction: row;
    padding: 6px 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    order: 2;
    height: auto;
    position: sticky;
    bottom: 0;
    z-index: 90;
    background: rgba(8, 12, 20, 0.98);
    backdrop-filter: blur(12px);
    gap: 6px;
  }
  .sidebar-nav-item {
    padding: 6px 10px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 3px;
    border-left: none !important;
    font-size: 10.5px;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 48px;
    margin: 0 !important;
  }
  .sidebar-nav-item img,
  .sidebar-nav-item svg,
  .sidebar-nav-item i {
    width: 18px;
    height: 18px;
    margin-right: 0 !important;
    margin-bottom: 2px !important;
    flex-shrink: 0;
  }
  .sidebar-nav-item.active {
    border-bottom: 2px solid #38bdf8;
    border-left: none;
    background: rgba(56, 189, 248, 0.2);
  }
  .main-content {
    order: 1;
    flex: 1;
    overflow-y: visible;
    padding: 12px 10px 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .wb-bottom-dock {
    bottom: 68px !important;
    right: 14px;
  }
  .chat-panel {
    bottom: 124px !important;
  }
  .stats-bar {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .node-status {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .relay-grid {
    grid-template-columns: 1fr !important;
  }
  .home-articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .home-article-card {
    padding: 11px 12px !important;
    min-height: auto !important;
    border-radius: 10px !important;
    min-width: 0 !important;
  }
  .home-article-thumb-mini {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 6px !important;
  }
  .home-article-badge {
    font-size: 0.60rem !important;
    padding: 1px 5px !important;
  }
  .home-article-cat {
    font-size: 0.66rem !important;
  }
  .home-article-card-title {
    font-size: 0.82rem !important;
    line-height: 1.30 !important;
  }
  .home-article-footer {
    padding-top: 3px !important;
    font-size: 0.70rem !important;
  }
  .workstation-live-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .ws-bar-left, .ws-bar-center, .ws-bar-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }
}

@media (max-width: 600px) {
  .home-articles-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .home-article-card {
    padding: 12px 14px !important;
    min-height: auto !important;
    border-radius: 12px !important;
  }
  .home-article-top {
    gap: 12px !important;
    margin-bottom: 6px !important;
  }
  .home-article-thumb-mini {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 8px !important;
  }
  .home-article-badge {
    font-size: 0.62rem !important;
    padding: 2px 6px !important;
  }
  .home-article-cat {
    font-size: 0.70rem !important;
  }
  .home-article-card-title {
    font-size: 0.86rem !important;
    line-height: 1.34 !important;
  }
  .home-article-footer {
    padding-top: 4px !important;
    font-size: 0.72rem !important;
  }
}

/* ============================================================================
   ADVANCED SYMMETRY, HARMONIZED DESIGN SYSTEM & ANIMATIONS (2026 POLISH)
   ============================================================================ */

/* Seamless Smooth Scrolling & Font Rendering */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Lucide Icon Alignment Utility */
.lucide-icon,
[data-lucide] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  stroke-width: 2px;
  stroke: currentColor;
  flex-shrink: 0;
}

/* Symmetrical Navbar Enhancement */
.site-header {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links-hub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-color);
  padding: 4px 6px;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.playground-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-main);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.playground-nav-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--accent);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

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

.playground-nav-btn img,
.playground-nav-btn i,
.playground-nav-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  object-fit: contain;
}

/* Symmetrical Status & System Badges */
.nav-system-hub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.device-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-xl);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

/* Workstation Bar Symmetry Polish */
.workstation-live-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: rgba(10, 15, 26, 0.94);
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: all 0.3s ease;
}

.ws-tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.7);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.ws-tool-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ws-tool-chip.soldering.hot {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.3);
}

.ws-tool-chip.gluegun.hot {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

.ws-telemetry-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.15);
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.ws-telemetry-chip .val {
  font-weight: 700;
  color: var(--cyan-glow);
}

/* Card Symmetry & Micro-Interaction */
.card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease;
}

.card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

/* Stats Box Symmetry */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-box:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-number {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.stat-caption {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Node Status Cards 3-Column Symmetry */
.node-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}

.node-card {
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.22s ease,
              box-shadow 0.22s ease;
  min-width: 0;
}

.node-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.node-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.node-card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.node-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Symmetrical 2-Column Dashboard Cards Grid */
.dashboard-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

.dashboard-cards-grid > .card {
  margin: 0 !important;
  display: flex;
  flex-direction: column;
}

.dashboard-cards-grid > .mirror-bezel {
  grid-column: 1 / -1;
  margin: 0 !important;
}

.dashboard-cards-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.dashboard-cards-col .card,
.dashboard-cards-col .mirror-bezel {
  margin: 0 !important;
}

@media (max-width: 960px) {
  .dashboard-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .dashboard-cards-grid > .mirror-bezel {
    grid-column: auto;
  }
}

/* Workbench & Optimizer Asset Banners */
.workbench-asset-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 16px 0;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.optimizer-boost-banner {
  display: flex;
  gap: 14px;
  align-items: center;
  background: radial-gradient(circle at left, rgba(245,158,11,0.15) 0%, rgba(15,23,42,0.6) 80%);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  box-sizing: border-box;
}

/* Comprehensive Responsive Breakpoints */
@media (max-width: 1280px) {
  .site-header {
    padding: 10px 18px;
  }
  .nav-controls {
    gap: 8px;
  }
  .playground-nav-btn {
    padding: 5px 9px;
    font-size: 11.5px;
  }
}

@media (max-width: 1080px) {
  .mobile-menu-toggle {
    display: flex;
  }
  .nav-controls {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(13, 20, 36, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-color);
    padding: 18px 20px;
    gap: 12px;
    z-index: 1000;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  }
  .nav-controls.mobile-open {
    display: flex;
    animation: navDrop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .nav-links-hub {
    flex-direction: column;
    align-items: stretch;
    background: transparent;
    border: none;
    padding: 0;
    gap: 8px;
  }
  .nav-controls .playground-nav-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 11px 16px;
    font-size: 13.5px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
  }
  .nav-system-hub {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .nav-controls .device-badge,
  .nav-controls .status-badge,
  .nav-controls .theme-toggle-btn,
  .nav-controls .mode-toggle-btn {
    width: 100%;
    justify-content: center;
    padding: 11px;
    font-size: 13px;
    box-sizing: border-box;
  }
}

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

@media (max-width: 820px) {
  .stats-bar {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
  .node-status {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }
  .workstation-live-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px;
    gap: 10px;
  }
  .ws-bar-left,
  .ws-bar-center,
  .ws-bar-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 680px) {
  .workbench-asset-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
  }
  .workbench-asset-banner .btn {
    width: 100%;
    justify-content: center;
  }
  .optimizer-boost-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }
}

@media (max-width: 640px) {
  .token-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 8px 12px;
  }
  .brand-title {
    font-size: 14px;
  }
  .brand-subtitle {
    font-size: 10px;
  }
  .stat-box {
    padding: 12px 14px;
    gap: 10px;
  }
  .stat-number {
    font-size: 18px;
  }
  .stat-caption {
    font-size: 10px;
  }
  .stat-icon-wrap {
    width: 36px;
    height: 36px;
  }
  .node-card {
    padding: 10px 12px;
  }
}

/* ============================================================================
   GLOBAL COMMAND PALETTE (Ctrl+K / Cmd+K)
   ============================================================================ */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 20px;
  animation: fadeInCmd 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInCmd {
  from { opacity: 0; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
}
.cmd-palette-card {
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--border-glow, rgba(56, 189, 248, 0.4));
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 30px rgba(56, 189, 248, 0.15);
  border-radius: 14px;
  width: 100%;
  max-width: 600px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleInCmd 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes scaleInCmd {
  from { transform: scale(0.95) translateY(-6px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.cmd-palette-search-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color, rgba(56, 189, 248, 0.2));
  background: rgba(0, 0, 0, 0.25);
}
.cmd-palette-search-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text-bright, #fff);
  font-family: inherit;
}
.cmd-kbd-esc {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
}
.cmd-palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cmd-item-group-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted, #64748b);
  padding: 6px 12px 2px;
  font-weight: 700;
}
.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-main, #e2e8f0);
  font-size: 13.5px;
  transition: all 0.15s ease;
  user-select: none;
}
.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cmd-item:hover, .cmd-item.selected {
  background: rgba(56, 189, 248, 0.12);
  color: #fff;
}
.cmd-item.selected .cmd-item-left svg {
  color: var(--accent-neon, #00f0ff);
}
.cmd-item-shortcut {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted, #94a3b8);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}
.cmd-palette-footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  font-size: 11px;
  color: var(--text-muted, #64748b);
  background: rgba(0, 0, 0, 0.2);
}
.cmd-palette-footer kbd {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono, monospace);
}

button { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
