


:root {
  
  --bg-base: #08080b;
  --bg-section: #101015;
  --bg-panel: #17171e;
  --bg-hover: #1f1f28;
  --bg-active: #292933;
  
  --bg-sunken: #0c0c11;
  --bg-well: #08080c;
  
  --bg-raised: #17171f;
  --bg-card: rgba(255, 255, 255, 0.03);
  
  --key-face: #16161c;
  --key-face-hover: #23232c;
  
  --case-color: #101014;
  --stripe-color: #8b0000;
  
  --tint: rgba(255, 255, 255, 0.05);
  --tint-hover: rgba(255, 255, 255, 0.08);
  
  --surface-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  --overlay: rgba(4, 4, 8, 0.66);

  
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);
  --line-strong: rgba(255, 255, 255, 0.16);

  
  --text-main: #f2f2f5;
  --text-dim: #babac6;
  --text-muted: #8e8e9e;
  
  --text-strong: #ffffff;

  
  --accent: #9d8df0;
  --accent-blue: #6280e8;
  --accent-purple: #a877e6;
  --accent-hover: #b7abf6;
  --accent-bright: #b7abf6;
  --accent-soft: rgba(157, 141, 240, 0.14);
  --accent-line: rgba(157, 141, 240, 0.42);
  --accent-text: #c6bcf8;
  
  --accent-contrast: #ffffff;
  
  --accent-gradient: linear-gradient(45deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  
  --accent-gradient-fill: linear-gradient(45deg, #4e63c2 0%, #8a5cbe 100%);
  
  --accent-gradient-bar: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  --accent-gradient-flow: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-blue));
  
  --accent-wash: rgba(157, 141, 240, 0.045);
  --accent-select: rgba(157, 141, 240, 0.3);

  
  --success: #5fb884;
  --success-soft: rgba(95, 184, 132, 0.12);
  --success-line: rgba(95, 184, 132, 0.34);
  --success-text: #90d4ac;
  --warning: #d9ab63;
  --warning-soft: rgba(217, 171, 99, 0.12);
  --warning-line: rgba(217, 171, 99, 0.32);
  --warning-text: #e9c991;
  --danger: #e08585;
  --danger-soft: rgba(224, 133, 133, 0.12);
  --danger-line: rgba(224, 133, 133, 0.34);
  --danger-text: #f0afaf;
  --danger-solid: #c26363;
  --info: #7ba0dd;
  --info-soft: rgba(123, 160, 221, 0.1);
  --info-line: rgba(123, 160, 221, 0.28);
  --info-text: #a7c3ea;
  --discord: #7b86e6;
  --discord-soft: rgba(123, 134, 230, 0.14);
  --discord-line: rgba(123, 134, 230, 0.38);
  --discord-text: #aeb6f2;
  --obs: #b7aae8;
  
  --accent-glow: transparent;
  --success-glow: transparent;
  --danger-glow: transparent;

  --scroll-thumb: rgba(255, 255, 255, 0.12);
  --scroll-thumb-hover: rgba(255, 255, 255, 0.22);
  
  --canvas-dot: rgba(255, 255, 255, 0.05);
  
  --native-scheme: dark;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  
  --edge-width: 3px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: all 0.22s var(--ease);
  
  --shadow-premium: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 20px 50px -30px rgba(0, 0, 0, 0.9);
  --shadow-card: 0 18px 40px -28px rgba(0, 0, 0, 0.85);
  --shadow-pop: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
  
  --shadow-inset: inset 0 2px 18px rgba(0, 0, 0, 0.7);
  
  --knob: #ffffff;
  
  --shadow-key: 0 2px 6px rgba(0, 0, 0, 0.3);

  --sans: 'Archivo', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
}



:root[data-theme="light"] {
  --bg-base: #f1ede4;
  --bg-section: #fdfbf7;
  --bg-panel: #f5f1e9;
  --bg-hover: #ebe5d9;
  --bg-active: #ded6c6;
  --bg-sunken: #f8f5ef;
  --bg-well: #efeae0;
  --bg-raised: #fffdf9;
  --bg-card: rgba(62, 53, 38, 0.035);
  --tint: rgba(62, 53, 38, 0.05);
  --tint-hover: rgba(62, 53, 38, 0.09);
  --surface-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.35));
  --overlay: rgba(58, 50, 38, 0.38);

  --border: #e0d8c9;
  --border-hover: #c2b8a4;
  --line-strong: #d2c9b7;

  --text-main: #262320;
  --text-dim: #544e45;
  --text-muted: #6b6457;
  --text-strong: #14120f;

  --accent: #6a58bf;
  --accent-blue: #4560c6;
  --accent-purple: #8a55bf;
  --accent-hover: #54439e;
  --accent-bright: #54439e;
  --accent-soft: rgba(106, 88, 191, 0.1);
  --accent-line: rgba(106, 88, 191, 0.36);
  --accent-text: #5a49a8;
  --accent-gradient-fill: linear-gradient(45deg, #4f63c2 0%, #8a5cbe 100%);
  --accent-wash: rgba(106, 88, 191, 0.05);
  --accent-select: rgba(106, 88, 191, 0.22);

  --success: #2f8f5b;
  --success-soft: rgba(47, 143, 91, 0.12);
  --success-line: rgba(47, 143, 91, 0.35);
  --success-text: #226b44;
  --warning: #9a6b18;
  --warning-soft: rgba(154, 107, 24, 0.12);
  --warning-line: rgba(154, 107, 24, 0.32);
  --warning-text: #7d5612;
  --danger: #b4443f;
  --danger-soft: rgba(180, 68, 63, 0.1);
  --danger-line: rgba(180, 68, 63, 0.34);
  --danger-text: #96322e;
  --danger-solid: #b4443f;
  --info: #35629e;
  --info-soft: rgba(53, 98, 158, 0.09);
  --info-line: rgba(53, 98, 158, 0.28);
  --info-text: #2c5286;
  --discord: #4a53c4;
  --discord-soft: rgba(74, 83, 196, 0.1);
  --discord-line: rgba(74, 83, 196, 0.34);
  --discord-text: #3f47ab;
  --obs: #6a58bf;

  --scroll-thumb: rgba(62, 53, 38, 0.2);
  --scroll-thumb-hover: rgba(62, 53, 38, 0.36);
  --canvas-dot: rgba(62, 53, 38, 0.1);
  --native-scheme: light;

  --shadow-premium: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 12px 26px -20px rgba(63, 54, 40, 0.5);
  --shadow-card: 0 12px 26px -20px rgba(63, 54, 40, 0.45);
  --shadow-pop: 0 20px 44px -22px rgba(63, 54, 40, 0.5);
  --shadow-inset: inset 0 1px 5px rgba(63, 54, 40, 0.14);
}

body {
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0;
}

body::before {
  background:
    radial-gradient(60% 50% at 85% 0%, var(--accent-wash), transparent 60%),
    radial-gradient(50% 45% at 10% 100%, var(--accent-wash), transparent 60%);
}
input, select, textarea, button { font-family: inherit; }
::selection { background: var(--accent-select); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }



.nav-btn.active::after,
.dv-card.is-active::after,
.lay-card.is-active::after,
.afl-board.active::after,
.afl-driver.active::after,
.afl-step.is-active .afl-step-no::after,
.icon-style-option.active::after,
.st-seg .hw-chip.active::after {
  content: ""; position: absolute; inset: 0; padding: var(--edge-width); border-radius: inherit; pointer-events: none;
  background: var(--accent-gradient);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}


.sidebar-header h2,
.category-header,
.insp-header,
.insp-label,
.settings-group-title,
.chip-inner span {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


#app-nav,
#main-sidebar,
.canvas-area,
#inspector-pane {
  background: var(--bg-section);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-premium);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}


#app-nav { width: 64px; gap: 10px; }
.nav-logo-segment { margin-bottom: 8px; }
.logo-image { width: 40px; height: 40px; }

:root[data-theme="light"] .logo-image {
  box-sizing: content-box; padding: 5px; border-radius: 13px; background: var(--key-face);
}
.nav-btn {
  width: 42px; height: 42px; border: 0; border-radius: 12px; font-size: 16px; color: var(--text-muted);
  position: relative;
}
.nav-btn:hover { transform: none; background: var(--bg-hover); color: var(--text-main); }
.nav-btn:active { transform: scale(0.94); }

.nav-btn.active {
  background: transparent !important;
  color: var(--text-main) !important;
}

.nav-btn[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  white-space: nowrap; padding: 6px 10px; border-radius: var(--radius-xs); font-size: 12px; font-weight: 500; color: var(--text-main);
  background: var(--bg-raised); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop);
  pointer-events: none; z-index: 100;
}

.status-indicator-dot .dot { width: 9px; height: 9px; box-shadow: none; }
.nav-btn.connected-glow { filter: none; }


#main-sidebar { width: 288px; }

.sidebar-header {
  justify-content: flex-start; padding: 16px 18px 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-header h2 { font-size: 11px; color: var(--text-dim); }
.toolbox-search {
  display: flex; align-items: center; gap: 10px; margin: 2px 14px 0; padding: 0 10px 0 12px; height: 38px;
  border-radius: var(--radius-sm); background: var(--bg-sunken); border: 1px solid var(--border);
  transition: border-color 160ms, box-shadow 160ms;
}
.toolbox-search:hover { border-color: var(--border-hover); }
.toolbox-search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbox-search i { color: var(--text-muted); font-size: 13px; }
.toolbox-search input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text-main); font-size: 13.5px;
}
.toolbox-search input::placeholder { color: var(--text-muted); }
.toolbox-search input::-webkit-search-cancel-button { filter: invert(1) opacity(0.5); }
.toolbox-search kbd {
  font-family: var(--mono); font-size: 11px; color: var(--text-muted); padding: 1px 7px; border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}
.toolbox-empty { margin: 18px; font-size: 13px; color: var(--text-muted); text-align: center; }
.category[hidden], .action-item[hidden], .toolbox-empty[hidden] { display: none !important; }

.sidebar-content-scroll { padding: 0 14px 48px; gap: 18px; }
.category-header { justify-content: flex-start; font-size: 10.5px; color: var(--text-muted); margin: 0 2px 8px; }
.category-header i { color: var(--accent); font-size: 11px; }
.action-list { gap: 6px; }

.action-item {
  background: var(--bg-panel); border: 1.5px solid var(--border); border-radius: var(--radius-md);
  font-size: 10.5px; font-weight: 500; color: var(--text-dim); text-align: center; line-height: 1.2;
  transition: background-color 160ms, border-color 160ms, color 160ms, transform 160ms var(--ease);
}
.action-item:hover {
  transform: translateY(-2px); background: var(--bg-hover); border-color: var(--border-hover);
  color: var(--text-strong);
}
.action-item:focus-visible { border-color: var(--accent-line); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.action-item:active { cursor: grabbing; transform: scale(0.97); }

.action-item .icon {
  width: 38px; height: 38px; border-radius: var(--radius-xs); border: 1px solid var(--border) !important;
  background-color: var(--key-face) !important; background-repeat: no-repeat;
  background-position: center; background-size: 30px 30px !important;
  transition: border-color 160ms;
}
.action-item:hover .icon { border-color: var(--border-hover) !important; }


.canvas-area {
  background:
    radial-gradient(60% 70% at 50% 45%, var(--accent-wash), transparent 70%),
    radial-gradient(var(--canvas-dot) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--bg-section);
}
.workspace-chip .chip-inner {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 999px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.workspace-chip:hover .chip-inner { border-color: var(--border-hover); background: var(--bg-hover); box-shadow: none; }
.chip-inner span { font-size: 11.5px; color: var(--text-main); }
.chip-inner i { color: var(--accent); }
.chip-dropdown {
  background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
}
.dropdown-item { border-radius: var(--radius-xs); }
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.active { background: var(--accent-soft); }
.dropdown-item .dropdown-app-icon { width: 20px; height: 20px; flex: none; object-fit: contain; border-radius: 4px; }
.dropdown-item .dropdown-app-name {
  margin-left: auto; flex: none; font-family: var(--mono); font-size: 9.5px; font-style: normal;
  letter-spacing: 0.04em; color: var(--text-muted); max-width: 11ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.grid-cell { transition: transform 160ms var(--ease), box-shadow 160ms, border-color 160ms; }
.grid-cell:hover { transform: translateY(-2px); }

.grid-cell.active { box-shadow: 0 0 0 2px var(--accent) !important; }

.cell-content.has-image { justify-content: flex-end; padding-bottom: 12%; }
.cell-content.has-image .cell-title { font-size: 10px; letter-spacing: 0.02em; }

.cell-content.has-image.has-caption { padding-bottom: 0; }
.cell-content.has-image.has-caption .cell-title {
    width: 100%; margin-top: auto; padding: 14% 6px 9%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.62) 38%, rgba(0, 0, 0, 0.62) 100%);
    font-size: clamp(10px, 1.05vw, 13px); font-weight: 700; line-height: 1.12; letter-spacing: 0.01em;
    color: #f0f0f0; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.9); white-space: pre-line;
    font-variant-numeric: tabular-nums;
}
.cell-content.has-image.caption-big .cell-title { font-size: clamp(15px, 1.7vw, 21px); padding-bottom: 6%; letter-spacing: 0; }
.grid-cell.drag-over, .grid-cell.dragover { box-shadow: 0 0 0 2px var(--accent-blue) !important; }





#icon-style-popup { width: 402px; padding: 8px; max-height: none; }
.icon-style-list {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  max-height: 356px; overflow-y: auto; overscroll-behavior: contain;
  
  padding-right: 2px;
}
.icon-style-head {
  padding: 6px 8px; font-size: 9px; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em; display: flex; align-items: center; gap: 8px;
}
.icon-style-head i { color: var(--accent-purple); font-size: 10px; }
.icon-style-option {
  
  position: relative;
  display: block; width: 100%; padding: 6px; text-align: left; cursor: pointer;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-main); font-family: var(--sans);
  transition: background-color 160ms, border-color 160ms;
}
.icon-style-option:hover { background: var(--bg-hover); border-color: var(--border); }
.icon-style-option.active { background: var(--accent-soft); border-color: var(--accent-line); }
.icon-style-option:focus-visible {
  outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft);
}
.icon-style-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 5px; }

.icon-style-name {
  font-size: 11px; font-weight: 700; color: var(--text-main);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-style-option.active .icon-style-name { color: var(--accent-text); }
.icon-style-check { font-size: 10px; color: var(--accent); opacity: 0; }
.icon-style-option.active .icon-style-check { opacity: 1; }

.icon-style-hint {
  min-height: 26px; padding: 6px 4px 2px; font-size: 10.5px; line-height: 1.3;
  color: var(--text-muted);
}

.icon-style-keys { display: flex; gap: 3px; }
.icon-style-key {
  flex: 1; aspect-ratio: 1; border-radius: var(--radius-xs); border: 1px solid var(--border);
  background-color: var(--key-face); background-repeat: no-repeat; background-position: center;
  background-size: 72%;
}


.insp-header { font-size: 10.5px; color: var(--text-dim); }
.insp-header i { color: var(--accent); }
.insp-label { font-size: 10px; color: var(--text-muted); margin-bottom: 6px; }
.insp-input {
  background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-main);
  font-size: 13.5px; transition: border-color 160ms, box-shadow 160ms;
}
.insp-input::placeholder { color: var(--text-muted); }
.insp-input:hover { border-color: var(--border-hover) !important; }
.insp-input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.insp-btn {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-dim);
  transition: background-color 160ms, border-color 160ms, color 160ms;
}
.insp-btn:hover { background: var(--bg-hover); border-color: var(--border-hover); color: var(--text-strong); }
.insp-btn:focus-visible { border-color: var(--accent-line); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.insp-btn.primary { background: var(--accent-gradient-fill); border-color: transparent; color: var(--accent-contrast); }
.insp-btn.danger:hover { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-text); }
.insp-placeholder { font-family: var(--sans); }
.insp-placeholder span { font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-main); }
.insp-placeholder-text { display: block; margin-top: 6px; font-size: 13px; font-weight: 400; color: var(--text-muted); }
.insp-placeholder i { color: var(--accent); opacity: 0.7; }
.insp-advanced-placeholder span { font-size: 12.5px; letter-spacing: 0; text-transform: none; }



.btn-primary, .btn.btn-primary {
  background: var(--accent-gradient-fill); border: 0; color: var(--accent-contrast); box-shadow: none;
}
.btn-primary:hover { filter: brightness(1.08); }
.settings-group-title { font-size: 10.5px; color: var(--text-muted); }
.settings-list-box {
  background: var(--bg-section); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.settings-list-item { border-color: var(--border); }
.modal-overlay { background: var(--overlay); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal-content, .custom-dialog-card {
  background: var(--bg-raised) !important; border: 1px solid var(--line-strong) !important; border-radius: var(--radius-lg) !important;
}
.switch input:checked + .slider { background: var(--accent-gradient-fill); }


.toast-notification, .sync-toast {
  background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
