/* ==========================================================================
   MonitorLayout.com — Core Stylesheet
   ========================================================================== */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --bg-card: rgba(15, 23, 42, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(16, 185, 129, 0.5);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.25);
  --accent-amber: #f59e0b;
  --accent-violet: #8b5cf6;
  --accent-rose: #f43f5e;

  --monitor-1: #10b981;
  --monitor-2: #38bdf8;
  --monitor-3: #a855f7;
  --monitor-4: #f59e0b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: #fff;
  cursor: pointer;
  user-select: none;
}

.logo .highlight {
  color: var(--accent-emerald);
}

.logo .tld {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.badge-tag {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.preset-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.2rem;
}

.preset-pill {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.preset-pill.active {
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
  box-shadow: 0 0 12px var(--accent-emerald-glow);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.network-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.network-badge:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: var(--accent-cyan);
}

.network-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

/* ==========================================================================
   Toolbar Strip
   ========================================================================== */
.toolbar-strip {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.65rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.group-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.segmented-control {
  display: flex;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.seg-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.seg-btn:hover {
  color: var(--text-primary);
}

.seg-btn.active {
  background: var(--bg-tertiary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border-subtle);
}

.toolbar-select {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.toolbar-select:focus {
  border-color: var(--accent-emerald);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.toggle-label input {
  display: none;
}

.toggle-custom {
  width: 32px;
  height: 18px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-custom::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle-label input:checked + .toggle-custom {
  background: var(--accent-emerald);
}

.toggle-label input:checked + .toggle-custom::after {
  transform: translateX(14px);
}

.toolbar-spacer {
  flex: 1;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent-emerald);
  color: #042f22;
  border: none;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #34d399;
  box-shadow: 0 0 16px var(--accent-emerald-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: #fff;
  border-color: var(--text-muted);
}

/* ==========================================================================
   Workspace & Canvas Viewport
   ========================================================================== */
.workspace-section {
  width: 100%;
  background: #060911;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
}

.canvas-viewport {
  width: 100%;
  height: 520px;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
}

.workspace-svg {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  touch-action: none;
}

/* Desk Styling */
.desk-surface {
  fill: #141c2c;
  stroke: #25334c;
  stroke-width: 2;
  filter: url(#dropShadow);
}

.desk-label {
  fill: rgba(255, 255, 255, 0.22);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-anchor: middle;
}

.desk-mat {
  fill: #0c121e;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1.5;
}

.draggable-accessory {
  cursor: grab;
  transition: filter 0.18s ease;
}

.draggable-accessory:hover {
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.45));
}

.draggable-accessory:active {
  cursor: grabbing;
}

.scale-keyboard .kb-case {
  fill: #182336;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 1;
}

.scale-keyboard .kb-keybed {
  fill: #0d1522;
}

.scale-keyboard .kb-row {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.scale-keyboard .kb-text {
  fill: rgba(255, 255, 255, 0.4);
  font-family: var(--font-mono);
  font-size: 8px;
  text-anchor: middle;
  pointer-events: none;
}

.scale-mouse .mouse-case {
  fill: #182336;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1;
}

.scale-mouse .mouse-split {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.scale-mouse .mouse-wheel {
  fill: #0d1522;
  stroke: var(--accent-cyan);
  stroke-width: 0.8;
}

/* Monitor SVG Node Elements */
.monitor-node {
  cursor: grab;
  transition: filter 0.2s ease;
}

.monitor-node:active {
  cursor: grabbing;
}

.monitor-node .bezel {
  fill: #090e17;
  stroke: #2b394f;
  stroke-width: 1.5;
  filter: url(#dropShadow);
}

.monitor-node.selected .bezel {
  stroke: var(--accent-emerald);
  stroke-width: 2;
}

.monitor-node .screen-glass {
  fill: #0d131f;
  transition: fill 0.2s ease;
}

.monitor-node .screen-gradient {
  opacity: 0.12;
}

.monitor-node .stand-pole {
  fill: #222f44;
}

.monitor-node .stand-base {
  fill: #1a2436;
  stroke: #2e3d55;
  stroke-width: 1;
}

.monitor-node .screen-text-title {
  fill: #ffffff;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  text-anchor: middle;
}

.monitor-node .screen-text-sub {
  fill: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  text-anchor: middle;
}

.monitor-node .screen-text-ppi {
  fill: var(--accent-emerald);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10px;
  text-anchor: middle;
}

.monitor-node .screen-tag {
  fill: rgba(255, 255, 255, 0.06);
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 1;
  rx: 4;
}

/* One-Click Rotate Button */
.btn-rotate-mon {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-rotate-mon:hover {
  transform: scale(1.15);
}

.btn-rotate-mon:hover .rotate-btn-bg {
  fill: var(--accent-cyan);
  stroke: #ffffff;
}

.btn-rotate-mon:hover path,
.btn-rotate-mon:hover polyline {
  stroke: #090e17;
}

/* Direct Overlay Mode SVG Elements */
.overlay-ghost {
  fill-opacity: 0.15;
  stroke-width: 2.5;
  stroke-dasharray: 4 4;
  rx: 6;
}

.overlay-badge-bg {
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.dim-line {
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1.5;
  stroke-dasharray: 2 2;
}

.dim-text {
  fill: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-anchor: middle;
}

/* Viewport HUD */
.viewport-hud {
  position: absolute;
  bottom: 1rem;
  left: 1.5rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.hud-sep {
  color: var(--text-muted);
}

.hud-status.ok {
  color: var(--accent-emerald);
  font-weight: 600;
}

.hud-status.warning {
  color: var(--accent-rose);
  font-weight: 700;
}

.drag-hint {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* ==========================================================================
   Dashboard Section & Tabs
   ========================================================================== */
.dashboard-section {
  max-width: 1360px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem 1.5rem;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dash-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dash-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dash-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.dash-tab.active {
  color: #fff;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
}

.unit-toggle {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.unit-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
}

.unit-btn.active {
  background: var(--bg-tertiary);
  color: #fff;
}

.tab-pane {
  display: none;
}

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

/* ==========================================================================
   Monitor Configurator Cards (Tab 1)
   ========================================================================== */
.monitor-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.monitor-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.monitor-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.monitor-card.card-mon-0 { border-top: 3px solid var(--monitor-1); }
.monitor-card.card-mon-1 { border-top: 3px solid var(--monitor-2); }
.monitor-card.card-mon-2 { border-top: 3px solid var(--monitor-3); }
.monitor-card.card-mon-3 { border-top: 3px solid var(--monitor-4); }

.card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.color-dot-0 { background: var(--monitor-1); box-shadow: 0 0 8px var(--monitor-1); }
.color-dot-1 { background: var(--monitor-2); box-shadow: 0 0 8px var(--monitor-2); }
.color-dot-2 { background: var(--monitor-3); box-shadow: 0 0 8px var(--monitor-3); }
.color-dot-3 { background: var(--monitor-4); box-shadow: 0 0 8px var(--monitor-4); }

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.btn-card-del {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-card-del:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

.field-group {
  margin-bottom: 1rem;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.field-val-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-emerald);
}

.field-slider {
  width: 100%;
  accent-color: var(--accent-emerald);
  cursor: pointer;
}

.btn-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ratio-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
}

.ratio-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.ratio-btn.active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.card-select {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
}

.card-select:focus {
  border-color: var(--accent-emerald);
}

.card-specs-summary {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.spec-mini-item {
  display: flex;
  flex-direction: column;
}

.spec-mini-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spec-mini-val {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

/* ==========================================================================
   Matrix Comparison Table (Tab 2)
   ========================================================================== */
.matrix-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.matrix-table th,
.matrix-table td {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.matrix-table th {
  background: rgba(15, 23, 42, 0.95);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.matrix-table td {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.matrix-table tr:last-child td {
  border-bottom: none;
}

.matrix-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.metric-highlight {
  color: var(--accent-emerald);
  font-weight: 700;
}

.delta-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.4rem;
}

.delta-tag.positive {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.delta-tag.negative {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.badge-curve {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-flat {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Text Clarity Preview (Tab 3)
   ========================================================================== */
.clarity-explainer {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.clarity-explainer h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #fff;
}

.clarity-explainer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.clarity-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.25rem;
}

.clarity-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.clarity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.clarity-title {
  font-weight: 700;
  font-size: 1rem;
}

.clarity-ppi {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-emerald);
  font-weight: 700;
}

.code-simulation-box {
  background: #060911;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #94a3b8;
  position: relative;
  overflow: hidden;
}

.code-simulation-box .code-kw { color: #f43f5e; }
.code-simulation-box .code-fn { color: #38bdf8; }
.code-simulation-box .code-str { color: #34d399; }
.code-simulation-box .code-num { color: #fbbf24; }

.clarity-footer-note {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Ergonomics & Viewing Distance (Tab 4)
   ========================================================================== */
.ergo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.ergo-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
}

.ergo-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ergo-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.ergo-stat-large {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-emerald);
  margin-bottom: 0.2rem;
}

.ergo-stat-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ergo-card.highlight-card {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-secondary) 100%);
}

.ergo-card.highlight-card .ergo-stat-large {
  color: var(--accent-amber);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #10b981;
  color: #042f22;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border-subtle);
  background: #060911;
  padding: 3.5rem 1.5rem 2rem 1.5rem;
}

.footer-content {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-left {
  max-width: 480px;
}

.footer-brand {
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 0.75rem;
}

.footer-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-right {
  display: flex;
  gap: 3.5rem;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--accent-emerald);
}

.footer-bottom {
  max-width: 1360px;
  margin: 0 auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .canvas-viewport {
    height: 440px;
  }
}

@media (max-width: 768px) {
  .top-nav {
    padding: 0.75rem 1rem;
  }
  .preset-bar {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.4rem;
  }
  .toolbar-strip {
    padding: 0.65rem 1rem;
    gap: 0.75rem;
  }
  .accessories-group {
    display: none;
  }
  .canvas-viewport {
    height: 380px;
  }
  .dashboard-section {
    padding: 1.5rem 1rem;
  }
  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }
  .footer-right {
    gap: 2rem;
  }
}
