/* ============================================================
   ArchiTail AI — Component Library
   ============================================================
   Complete UI component definitions with all states for both
   dark (default) and light themes. Uses design tokens from
   tokens.css and integrates with the glass system (glass.css).
   ============================================================

   TABLE OF CONTENTS
   -----------------
   1.  Buttons
   2.  Inputs
   3.  Cards
   4.  Panels
   5.  Tabs
   6.  Nav Items
   7.  Property Rows
   8.  Dropdowns
   9.  Tooltips
   10. Toasts
   11. Modals
   12. Badges & Chips
   13. Toggles
   14. Progress Bar
   15. Avatars
   16. Dividers
   17. AI Prompt Bar
   ============================================================ */


/* ============================================================
   1. BUTTONS
   ============================================================ */

/* --- Button Base --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all var(--duration-default) var(--ease-default);
  text-decoration: none;
  line-height: 1;
  position: relative;
  outline: none;
}

.btn:focus-visible {
  box-shadow: 0 0 0 2px var(--color-focus-ring);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

/* --- Button Sizes --- */

.btn-sm {
  height: var(--btn-height-sm);
  font-size: 13px;
  padding: var(--btn-padding-sm);
  border-radius: var(--radius-sm);
}

.btn-md {
  height: var(--btn-height-md);
  font-size: 13px;
  padding: var(--btn-padding-md);
  border-radius: var(--radius-md);
}

.btn-lg {
  height: var(--btn-height-lg);
  font-size: 14px;
  padding: var(--btn-padding-lg);
  border-radius: var(--radius-md);
}

/* --- Button Type: Primary (Dark Theme) --- */

.btn-primary {
  background: rgba(58, 58, 63, 0.20);
  border-color: rgba(58, 58, 63, 0.30);
  color: #D8D8D1;
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.btn-primary:hover {
  background: rgba(58, 58, 63, 0.28);
  border-color: rgba(58, 58, 63, 0.38);
  box-shadow: 0 2px 12px rgba(58, 58, 63, 0.12);
}

.btn-primary:active {
  background: rgba(58, 58, 63, 0.32);
  border-color: rgba(58, 58, 63, 0.42);
  box-shadow: none;
  transform: scale(0.98);
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 2px var(--color-focus-ring);
}

.btn-primary:disabled,
.btn-primary.disabled {
  background: rgba(58, 58, 63, 0.20);
  border-color: rgba(58, 58, 63, 0.30);
  box-shadow: none;
}

.btn-primary.loading {
  color: transparent;
  pointer-events: none;
}

/* Primary — Light Theme */

[data-theme="light"] .btn-primary {
  background: rgba(58, 58, 63, 0.16);
  border-color: rgba(58, 58, 63, 0.25);
  color: #1A1A19;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

[data-theme="light"] .btn-primary:hover {
  background: rgba(58, 58, 63, 0.24);
  border-color: rgba(58, 58, 63, 0.35);
  box-shadow: 0 2px 12px rgba(58, 58, 63, 0.10);
}

[data-theme="light"] .btn-primary:active {
  background: rgba(58, 58, 63, 0.28);
  border-color: rgba(58, 58, 63, 0.38);
  box-shadow: none;
}

[data-theme="light"] .btn-primary:disabled,
[data-theme="light"] .btn-primary.disabled {
  background: rgba(58, 58, 63, 0.16);
  border-color: rgba(58, 58, 63, 0.25);
  box-shadow: none;
}

/* --- Button Type: Secondary (Dark Theme) --- */

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #B7B7AF;
  border-radius: var(--radius-md);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
  color: #D8D8D1;
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.22);
  color: #D8D8D1;
  transform: scale(0.98);
}

.btn-secondary:focus-visible {
  box-shadow: 0 0 0 2px var(--color-focus-ring);
}

.btn-secondary:disabled,
.btn-secondary.disabled {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #B7B7AF;
}

.btn-secondary.loading {
  color: transparent;
  pointer-events: none;
}

/* Secondary — Light Theme */

[data-theme="light"] .btn-secondary {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: #6A6A63;
}

[data-theme="light"] .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1A1A19;
}

[data-theme="light"] .btn-secondary:active {
  background: rgba(0, 0, 0, 0.10);
  border-color: rgba(0, 0, 0, 0.15);
  color: #1A1A19;
}

[data-theme="light"] .btn-secondary:disabled,
[data-theme="light"] .btn-secondary.disabled {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: #6A6A63;
}

/* --- Button Type: Ghost (Dark Theme) --- */

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #B7B7AF;
  border-radius: var(--radius-md);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #D8D8D1;
}

.btn-ghost:active {
  background: rgba(255, 255, 255, 0.10);
  color: #D8D8D1;
  transform: scale(0.98);
}

.btn-ghost:focus-visible {
  box-shadow: 0 0 0 2px var(--color-focus-ring);
}

.btn-ghost:disabled,
.btn-ghost.disabled {
  background: transparent;
  color: #B7B7AF;
}

.btn-ghost.loading {
  color: transparent;
  pointer-events: none;
}

/* Ghost — Light Theme */

[data-theme="light"] .btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #6A6A63;
}

[data-theme="light"] .btn-ghost:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #1A1A19;
}

[data-theme="light"] .btn-ghost:active {
  background: rgba(0, 0, 0, 0.07);
  color: #1A1A19;
}

[data-theme="light"] .btn-ghost:disabled,
[data-theme="light"] .btn-ghost.disabled {
  background: transparent;
  color: #6A6A63;
}

/* --- Button Type: AI (Dark Theme) --- */

.btn-ai {
  background: rgba(58, 58, 63, 0.12);
  border-color: rgba(58, 58, 63, 0.20);
  color: #4A4A50;
  border-radius: var(--radius-md);
}

.btn-ai:hover {
  background: rgba(58, 58, 63, 0.22);
  border-color: rgba(58, 58, 63, 0.32);
  box-shadow: 0 2px 16px rgba(58, 58, 63, 0.12);
}

.btn-ai:active {
  background: rgba(58, 58, 63, 0.26);
  border-color: rgba(58, 58, 63, 0.36);
  box-shadow: none;
  transform: scale(0.98);
}

.btn-ai:focus-visible {
  box-shadow: 0 0 0 2px var(--color-focus-ring);
}

.btn-ai:disabled,
.btn-ai.disabled {
  background: rgba(58, 58, 63, 0.12);
  border-color: rgba(58, 58, 63, 0.20);
  color: #4A4A50;
}

.btn-ai.loading {
  color: transparent;
  pointer-events: none;
}

/* AI — Light Theme */

[data-theme="light"] .btn-ai {
  background: rgba(58, 58, 63, 0.08);
  border-color: rgba(58, 58, 63, 0.16);
  color: var(--accent-ai-400);
}

[data-theme="light"] .btn-ai:hover {
  background: rgba(58, 58, 63, 0.16);
  border-color: rgba(58, 58, 63, 0.26);
  box-shadow: 0 2px 16px rgba(58, 58, 63, 0.10);
}

[data-theme="light"] .btn-ai:active {
  background: rgba(58, 58, 63, 0.20);
  border-color: rgba(58, 58, 63, 0.30);
  box-shadow: none;
}

[data-theme="light"] .btn-ai:disabled,
[data-theme="light"] .btn-ai.disabled {
  background: rgba(58, 58, 63, 0.08);
  border-color: rgba(58, 58, 63, 0.16);
}

/* --- Button Type: Danger (Dark Theme) --- */

.btn-danger {
  background: rgba(176, 109, 109, 0.12);
  border-color: rgba(176, 109, 109, 0.20);
  color: #B06D6D;
  border-radius: var(--radius-md);
}

.btn-danger:hover {
  background: rgba(176, 109, 109, 0.20);
  border-color: rgba(176, 109, 109, 0.30);
}

.btn-danger:active {
  background: rgba(176, 109, 109, 0.26);
  border-color: rgba(176, 109, 109, 0.36);
  transform: scale(0.98);
}

.btn-danger:focus-visible {
  box-shadow: 0 0 0 2px rgba(176, 109, 109, 0.40);
}

.btn-danger:disabled,
.btn-danger.disabled {
  background: rgba(176, 109, 109, 0.12);
  border-color: rgba(176, 109, 109, 0.20);
  color: #B06D6D;
}

.btn-danger.loading {
  color: transparent;
  pointer-events: none;
}

/* Danger — Light Theme */

[data-theme="light"] .btn-danger {
  background: rgba(176, 109, 109, 0.08);
  border-color: rgba(176, 109, 109, 0.16);
  color: #A05050;
}

[data-theme="light"] .btn-danger:hover {
  background: rgba(176, 109, 109, 0.15);
  border-color: rgba(176, 109, 109, 0.25);
}

[data-theme="light"] .btn-danger:active {
  background: rgba(176, 109, 109, 0.20);
  border-color: rgba(176, 109, 109, 0.30);
}

[data-theme="light"] .btn-danger:disabled,
[data-theme="light"] .btn-danger.disabled {
  background: rgba(176, 109, 109, 0.08);
  border-color: rgba(176, 109, 109, 0.16);
}

/* --- Button Type: Icon (Dark Theme) --- */

.btn-icon {
  background: transparent;
  border-color: transparent;
  color: #B7B7AF;
  border-radius: var(--radius-md);
  padding: 0;
  flex-shrink: 0;
}

.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
  padding: 0;
}

.btn-icon.btn-md {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-icon.btn-lg {
  width: 44px;
  height: 44px;
  padding: 0;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #D8D8D1;
}

.btn-icon:active {
  background: rgba(255, 255, 255, 0.10);
  color: #D8D8D1;
  transform: scale(0.98);
}

.btn-icon:focus-visible {
  box-shadow: 0 0 0 2px var(--color-focus-ring);
}

.btn-icon:disabled,
.btn-icon.disabled {
  background: transparent;
  color: #B7B7AF;
}

/* Icon — Light Theme */

[data-theme="light"] .btn-icon {
  color: #6A6A63;
}

[data-theme="light"] .btn-icon:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #1A1A19;
}

[data-theme="light"] .btn-icon:active {
  background: rgba(0, 0, 0, 0.07);
  color: #1A1A19;
}

[data-theme="light"] .btn-icon:disabled,
[data-theme="light"] .btn-icon.disabled {
  background: transparent;
  color: #6A6A63;
}

/* --- Button Loading Spinner --- */

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

/* --- Button Group --- */

.btn-group {
  display: inline-flex;
  gap: 0;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.btn-group .btn + .btn {
  margin-left: -1px;
}


/* ============================================================
   2. INPUTS
   ============================================================ */

/* --- Input Base --- */

.input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-primary);
  outline: none;
  transition: border-color var(--duration-default) var(--ease-default),
              box-shadow var(--duration-default) var(--ease-default);
}

.input::placeholder {
  color: var(--color-text-muted);
}

.input:hover {
  border-color: var(--color-border-strong);
}

.input:focus {
  border-color: var(--accent-ai-500);
  box-shadow: 0 0 0 2px var(--color-focus-ring);
}

.input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Input Sizes */

.input-sm {
  height: 32px;
  font-size: 13px;
  padding: 0 10px;
}

.input-lg {
  height: 48px;
  font-size: 15px;
  padding: 0 16px;
}

/* Input States */

.input-error {
  border-color: var(--state-danger);
}

.input-error:focus {
  border-color: var(--state-danger);
  box-shadow: 0 0 0 2px rgba(176, 109, 109, 0.30);
}

.input-success {
  border-color: var(--state-success);
}

.input-success:focus {
  border-color: var(--state-success);
  box-shadow: 0 0 0 2px rgba(111, 154, 133, 0.30);
}

/* Input Light Theme */

[data-theme="light"] .input {
  background: transparent;
  color: var(--color-text-primary);
}

[data-theme="light"] .input::placeholder {
  color: var(--color-text-muted);
}

/* --- Input Search --- */

.input-search-wrap {
  position: relative;
  display: block;
}

.input-search-wrap .input-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.input-search {
  padding-left: 40px;
}

/* --- Input Textarea --- */

.input-textarea {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}

/* --- Input AI Prompt --- */

.input-ai-prompt {
  height: 56px;
  padding: 0 20px;
  font-size: 16px;
  border-radius: var(--radius-xl);
  -webkit-backdrop-filter: blur(20px) saturate(1.20);
  backdrop-filter: blur(20px) saturate(1.20);
  background: rgba(58, 58, 63, 0.08);
  border: 1px solid rgba(58, 58, 63, 0.15);
}

.input-ai-prompt:focus {
  border-color: rgba(58, 58, 63, 0.35);
  box-shadow: 0 0 0 2px var(--color-focus-ring),
              0 4px 24px rgba(58, 58, 63, 0.08);
}

.input-ai-prompt::placeholder {
  color: var(--accent-ai-400);
  opacity: 0.6;
}

.input-ai-prompt-lg {
  height: 64px;
  font-size: 16px;
}

/* AI Prompt — Light Theme */

[data-theme="light"] .input-ai-prompt {
  background: rgba(58, 58, 63, 0.06);
  border-color: rgba(58, 58, 63, 0.12);
}

[data-theme="light"] .input-ai-prompt:focus {
  border-color: rgba(58, 58, 63, 0.30);
  box-shadow: 0 0 0 2px var(--color-focus-ring),
              0 4px 24px rgba(58, 58, 63, 0.06);
}

/* --- Input Label --- */

.input-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

/* --- Input Help Text --- */

.input-help {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.input-help-error {
  color: var(--state-danger);
}

/* --- Input Group (input + button or icon) --- */

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .input {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .btn {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-left: -1px;
}


/* ============================================================
   3. CARDS
   ============================================================ */

/* --- Card Base --- */

.card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration-default) var(--ease-default);
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-default);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.card:active {
  transform: translateY(-1px);
}

/* Card Cover */

.card-cover {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--neutral-200) 0%, var(--neutral-300) 100%);
  overflow: hidden;
  position: relative;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Card Body */

.card-body {
  padding: 14px 16px;
}

/* Card Title */

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.3;
  margin: 0;
}

/* Card Meta */

.card-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* Card Footer */

.card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Card Actions */

.card-actions {
  display: flex;
  gap: 4px;
}

/* Card — Clickable */

.card-clickable {
  cursor: pointer;
}

.card-clickable:focus-visible {
  box-shadow: 0 0 0 2px var(--color-focus-ring);
  outline: none;
}

/* Card — Selected */

.card.selected {
  border-color: rgba(58, 58, 63, 0.30);
  box-shadow: 0 0 0 1px rgba(58, 58, 63, 0.15);
}

/* Card — Light Theme */

[data-theme="light"] .card {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .card:hover {
  border-color: rgba(0, 0, 0, 0.10);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .card-cover {
  background: linear-gradient(135deg, var(--neutral-900) 0%, var(--neutral-800) 100%);
}

[data-theme="light"] .card.selected {
  border-color: rgba(58, 58, 63, 0.35);
  box-shadow: 0 0 0 1px rgba(58, 58, 63, 0.20);
}

/* Card Grid */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.card-grid-lg {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}


/* ============================================================
   4. PANELS
   ============================================================ */

/* --- Panel Base --- */

.panel {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 0;
}

/* Panel Header */

.panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: inherit;
  z-index: var(--z-base);
}

.panel-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Panel Section */

.panel-section {
  padding: 12px 16px;
}

.panel-section + .panel-section {
  border-top: 1px solid var(--color-border-subtle);
}

/* Panel Group Title */

.panel-group-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

/* Panel Scrollbar */

.panel::-webkit-scrollbar {
  width: 6px;
}

.panel::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.panel::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

.panel::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Panel Footer */

.panel-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border-subtle);
  position: sticky;
  bottom: 0;
  background: inherit;
}

/* Panel — Collapsible */

.panel-collapsible .panel-header {
  cursor: pointer;
  user-select: none;
}

.panel-collapsible .panel-header:hover {
  color: var(--color-text-secondary);
}

.panel-collapse-icon {
  width: 16px;
  height: 16px;
  transition: transform var(--duration-default) var(--ease-default);
}

.panel-collapsible.collapsed .panel-collapse-icon {
  transform: rotate(-90deg);
}

.panel-collapsible.collapsed .panel-section {
  display: none;
}


/* ============================================================
   5. TABS
   ============================================================ */

/* --- Tab Bar --- */

.tab-bar {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
}

/* Tab Item */

.tab-item {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-default) var(--ease-default);
  white-space: nowrap;
  user-select: none;
  border: none;
  background: transparent;
  line-height: 1.4;
}

.tab-item:hover {
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.06);
}

.tab-item.active {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.10);
}

.tab-item:focus-visible {
  box-shadow: 0 0 0 2px var(--color-focus-ring);
  outline: none;
}

/* Tab Item with count badge */

.tab-item .tab-count {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  opacity: 0.7;
}

.tab-item.active .tab-count {
  opacity: 1;
}

/* Tabs — Light Theme */

[data-theme="light"] .tab-bar {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .tab-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-text-secondary);
}

[data-theme="light"] .tab-item.active {
  background: #FFFFFF;
  color: var(--color-text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Tab Bar — Underline Variant */

.tab-bar-underline {
  display: flex;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border-subtle);
  border-radius: 0;
}

.tab-bar-underline .tab-item {
  padding: 8px 16px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-bar-underline .tab-item:hover {
  background: transparent;
  border-bottom-color: var(--color-border-default);
}

.tab-bar-underline .tab-item.active {
  background: transparent;
  border-bottom-color: var(--accent-ai-500);
  color: var(--accent-ai-500);
}

[data-theme="light"] .tab-bar-underline {
  background: transparent;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .tab-bar-underline .tab-item.active {
  background: transparent;
  box-shadow: none;
}


/* ============================================================
   6. NAV ITEMS
   ============================================================ */

/* --- Nav Item --- */

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--duration-default) var(--ease-default);
  text-decoration: none;
  user-select: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
}

.nav-item.active {
  background: rgba(58, 58, 63, 0.10);
  color: var(--accent-ai-500);
  font-weight: 500;
}

.nav-item:focus-visible {
  box-shadow: 0 0 0 2px var(--color-focus-ring);
  outline: none;
}

/* Nav Icon */

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Nav Item — With badge/count */

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  min-width: 20px;
  text-align: center;
}

/* Nav Item — Nested / indented */

.nav-item-nested {
  padding-left: 42px;
  font-size: 13px;
}

/* Nav Item — Section Header */

.nav-section {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 16px 12px 6px;
  cursor: default;
}

/* Nav — Light Theme */

[data-theme="light"] .nav-item.active {
  background: rgba(58, 58, 63, 0.10);
  color: var(--accent-ai-400);
}


/* ============================================================
   7. PROPERTY ROWS
   ============================================================ */

/* --- Property Row --- */

.prop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  min-height: 32px;
}

.prop-row:hover {
  background: var(--color-bg-hover);
  border-radius: var(--radius-xs);
}

/* Property Label */

.prop-label {
  font-size: 12px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  margin-right: 16px;
}

/* Property Value */

.prop-value {
  font-size: 13px;
  color: var(--color-text-primary);
  text-align: right;
}

/* Property Value — Editable */

.prop-value-editable {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: background var(--duration-fast) var(--ease-default);
}

.prop-value-editable:hover {
  background: var(--color-bg-hover);
}

/* Property Value — Input (inline editing) */

.prop-value .input {
  height: 28px;
  font-size: 13px;
  text-align: right;
  width: 120px;
}

/* Property Row — Group */

.prop-group {
  padding: 8px 0;
}

.prop-group + .prop-group {
  border-top: 1px solid var(--color-border-subtle);
}

.prop-group-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 4px 8px 8px;
}


/* ============================================================
   8. DROPDOWNS
   ============================================================ */

/* --- Dropdown Container --- */

.dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown Menu */

.dropdown-menu {
  position: absolute;
  min-width: 200px;
  padding: 4px;
  border-radius: var(--radius-xl);
  z-index: var(--z-dropdown);
  animation: dropdownOpen 160ms ease-out;

  /* glass-surface properties */
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  backdrop-filter: blur(20px) saturate(1.15);
  background: rgba(44, 44, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.30),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dropdown-menu[hidden] {
  display: none;
}

/* Dropdown placement */

.dropdown-menu-top {
  bottom: 100%;
  margin-bottom: 4px;
}

.dropdown-menu-bottom {
  top: 100%;
  margin-top: 4px;
}

.dropdown-menu-left {
  left: 0;
}

.dropdown-menu-right {
  right: 0;
}

/* Dropdown Item */

.dropdown-item {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.dropdown-item:active {
  background: rgba(255, 255, 255, 0.10);
}

.dropdown-item:focus-visible {
  box-shadow: 0 0 0 2px var(--color-focus-ring);
  outline: none;
}

/* Dropdown Item Icon */

.dropdown-item .dropdown-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

/* Dropdown Item Shortcut */

.dropdown-item .dropdown-shortcut {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* Dropdown Item — Selected */

.dropdown-item.selected {
  color: var(--accent-ai-500);
}

.dropdown-item.selected::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-ai-500);
  flex-shrink: 0;
}

/* Dropdown Item — Danger */

.dropdown-item-danger {
  color: var(--state-danger);
}

.dropdown-item-danger:hover {
  background: rgba(176, 109, 109, 0.10);
  color: var(--state-danger);
}

/* Dropdown Divider */

.dropdown-divider {
  height: 1px;
  background: var(--color-border-subtle);
  margin: 4px 8px;
}

/* Dropdown Label (non-interactive section heading) */

.dropdown-label {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  cursor: default;
}

/* Dropdown — Light Theme */

[data-theme="light"] .dropdown-menu {
  background: rgba(255, 255, 255, 0.70);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.60);
}

[data-theme="light"] .dropdown-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .dropdown-item:active {
  background: rgba(0, 0, 0, 0.07);
}


/* ============================================================
   9. TOOLTIPS
   ============================================================ */

/* --- Tooltip --- */

.tooltip {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text-primary);
  max-width: 240px;
  z-index: var(--z-tooltip);
  pointer-events: none;
  position: absolute;
  white-space: normal;

  /* glass-ephemeral properties */
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
  backdrop-filter: blur(12px) saturate(1.05);
  background: rgba(44, 44, 42, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.20);

  animation: fadeIn var(--duration-fast) var(--ease-default);
}

/* Tooltip Arrow */

.tooltip-arrow {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(44, 44, 42, 0.80);
  transform: rotate(45deg);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tooltip-top .tooltip-arrow {
  bottom: -5px;
  left: 50%;
  margin-left: -4px;
  border-top: none;
  border-left: none;
}

.tooltip-bottom .tooltip-arrow {
  top: -5px;
  left: 50%;
  margin-left: -4px;
  border-bottom: none;
  border-right: none;
}

/* Tooltip — Light Theme */

[data-theme="light"] .tooltip {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  color: var(--color-text-primary);
}

[data-theme="light"] .tooltip-arrow {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.06);
}


/* --- Instant Tooltip (global, JS-driven on [title]) --- */

.ahub-tip {
  position: fixed;
  padding: 5px 10px;
  background: #1A1A1C;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  border-radius: 5px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 100ms;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.ahub-tip.show { opacity: 1; }


/* ============================================================
   10. TOASTS
   ============================================================ */

/* --- Toast Container --- */

.toast-container {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  padding: 24px;
  pointer-events: none;
}

/* Toast Base */

.toast {
  padding: 12px 16px;
  min-width: 300px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-xl);
  pointer-events: auto;
  animation: toastSlideIn var(--duration-toast) var(--ease-default);

  /* glass-ephemeral properties */
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
  backdrop-filter: blur(12px) saturate(1.05);
  background: rgba(44, 44, 42, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.20);
}

.toast-exiting {
  animation: toastSlideOut 180ms var(--ease-in) forwards;
}

/* Toast Icon */

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Toast Content */

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.toast-message {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* Toast Close */

.toast-close {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color var(--duration-fast) var(--ease-default);
  background: none;
  border: none;
  padding: 0;
}

.toast-close:hover {
  color: var(--color-text-secondary);
}

/* Toast Variants */

.toast-success {
  border-left: 3px solid var(--state-success);
}

.toast-success .toast-icon {
  color: var(--state-success);
}

.toast-error {
  border-left: 3px solid var(--state-danger);
}

.toast-error .toast-icon {
  color: var(--state-danger);
}

.toast-info {
  border-left: 3px solid var(--accent-ai-500);
}

.toast-info .toast-icon {
  color: var(--accent-ai-500);
}

.toast-warning {
  border-left: 3px solid var(--state-warning);
}

.toast-warning .toast-icon {
  color: var(--state-warning);
}

/* Toast — Light Theme */

[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}


/* ============================================================
   11. MODALS
   ============================================================ */

/* --- Modal Scrim --- */

.modal-scrim {
  position: fixed;
  inset: 0;
  background: var(--color-scrim);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-scrim);
  animation: fadeIn var(--duration-default) var(--ease-default);
}

.modal-scrim-exiting {
  animation: fadeOut var(--duration-default) var(--ease-in) forwards;
}

/* Modal */

.modal {
  max-width: 560px;
  width: 90%;
  border-radius: var(--radius-2xl);
  padding: 32px;
  z-index: var(--z-modal);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: scaleIn var(--duration-moderate) var(--ease-panel-open);

  /* glass-surface properties */
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  backdrop-filter: blur(20px) saturate(1.15);
  background: rgba(44, 44, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.30),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modal:focus-visible {
  outline: none;
}

/* Modal Sizes */

.modal-sm {
  max-width: 400px;
}

.modal-lg {
  max-width: 720px;
}

.modal-xl {
  max-width: 960px;
}

/* Modal Title */

.modal-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 16px;
  line-height: 1.3;
}

/* Modal Description */

.modal-description {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Modal Body */

.modal-body {
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* Modal Actions */

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

/* Modal Close Button */

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

/* Modal — Light Theme */

[data-theme="light"] .modal {
  background: rgba(255, 255, 255, 0.70);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.60);
}

[data-theme="light"] .modal-scrim {
  background: var(--color-scrim);
}


/* ============================================================
   12. BADGES & CHIPS
   ============================================================ */

/* --- Badges --- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  line-height: 1.4;
  white-space: nowrap;
  color: var(--color-text-secondary);
}

/* Badge Variants */

.badge-ai {
  background: rgba(58, 58, 63, 0.12);
  color: var(--accent-ai-500);
  border-color: rgba(58, 58, 63, 0.20);
}

.badge-success {
  background: rgba(111, 154, 133, 0.12);
  color: var(--state-success);
  border-color: rgba(111, 154, 133, 0.20);
}

.badge-warning {
  background: rgba(181, 146, 101, 0.12);
  color: var(--state-warning);
  border-color: rgba(181, 146, 101, 0.20);
}

.badge-danger {
  background: rgba(176, 109, 109, 0.12);
  color: var(--state-danger);
  border-color: rgba(176, 109, 109, 0.20);
}

.badge-info {
  background: rgba(126, 151, 183, 0.12);
  color: var(--state-info);
  border-color: rgba(126, 151, 183, 0.20);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-muted);
  border-color: var(--color-border-subtle);
}

/* Badge with dot */

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  flex-shrink: 0;
}

/* Badge — Light Theme */

[data-theme="light"] .badge-ai {
  background: rgba(58, 58, 63, 0.10);
}

[data-theme="light"] .badge-success {
  background: rgba(111, 154, 133, 0.10);
}

[data-theme="light"] .badge-warning {
  background: rgba(181, 146, 101, 0.10);
}

[data-theme="light"] .badge-danger {
  background: rgba(176, 109, 109, 0.10);
}

[data-theme="light"] .badge-info {
  background: rgba(126, 151, 183, 0.10);
}

[data-theme="light"] .badge-neutral {
  background: rgba(0, 0, 0, 0.04);
}

/* --- Chips --- */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 400;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-default);
  cursor: pointer;
  transition: all var(--duration-default) var(--ease-default);
  color: var(--color-text-secondary);
  background: transparent;
  user-select: none;
  gap: 6px;
  line-height: 1.4;
}

.chip:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.chip:active {
  transform: scale(0.97);
}

.chip:focus-visible {
  box-shadow: 0 0 0 2px var(--color-focus-ring);
  outline: none;
}

.chip.selected {
  background: rgba(58, 58, 63, 0.12);
  border-color: rgba(58, 58, 63, 0.25);
  color: var(--accent-ai-500);
}

.chip:disabled,
.chip.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Chip with remove button */

.chip-remove {
  width: 14px;
  height: 14px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color var(--duration-fast) var(--ease-default);
  flex-shrink: 0;
}

.chip-remove:hover {
  color: var(--state-danger);
}

/* Chip — Light Theme */

[data-theme="light"] .chip.selected {
  background: rgba(58, 58, 63, 0.10);
  border-color: rgba(58, 58, 63, 0.22);
}


/* ============================================================
   13. TOGGLES
   ============================================================ */

/* --- Toggle Switch --- */

.toggle {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--neutral-300);
  cursor: pointer;
  position: relative;
  transition: background var(--duration-default) var(--ease-default);
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  width: 18px;
  height: 18px;
  background: #FFFFFF;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform var(--duration-default) var(--ease-default);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle.active {
  background: var(--accent-ai-500);
}

.toggle.active::after {
  transform: translateX(18px);
}

.toggle:hover {
  background: var(--neutral-400);
}

.toggle.active:hover {
  background: var(--accent-ai-400);
}

.toggle:focus-visible {
  box-shadow: 0 0 0 2px var(--color-focus-ring);
  outline: none;
}

.toggle:disabled,
.toggle.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Toggle — Light Theme */

[data-theme="light"] .toggle {
  background: var(--neutral-800);
}

[data-theme="light"] .toggle:hover {
  background: var(--neutral-700);
}

[data-theme="light"] .toggle.active {
  background: var(--accent-ai-500);
}

[data-theme="light"] .toggle.active:hover {
  background: var(--accent-ai-400);
}

[data-theme="light"] .toggle::after {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10);
}

/* Toggle — Small */

.toggle-sm {
  width: 32px;
  height: 18px;
  border-radius: 9px;
}

.toggle-sm::after {
  width: 14px;
  height: 14px;
}

.toggle-sm.active::after {
  transform: translateX(14px);
}

/* Toggle — with Label */

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.toggle-label:has(.toggle:disabled) {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ============================================================
   14. PROGRESS BAR
   ============================================================ */

/* --- Progress --- */

.progress {
  height: 4px;
  background: var(--neutral-300);
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
}

.progress-fill {
  height: 100%;
  background: var(--accent-ai-500);
  border-radius: 2px;
  transition: width 300ms ease-out;
  min-width: 0;
}

/* Progress — Sizes */

.progress-sm {
  height: 2px;
}

.progress-lg {
  height: 8px;
  border-radius: 4px;
}

.progress-lg .progress-fill {
  border-radius: 4px;
}

/* Progress — Variants */

.progress-success .progress-fill {
  background: var(--state-success);
}

.progress-warning .progress-fill {
  background: var(--state-warning);
}

.progress-danger .progress-fill {
  background: var(--state-danger);
}

/* Progress — Indeterminate (animated) */

.progress-indeterminate .progress-fill {
  width: 30%;
  animation: aiLineProgress 3s linear infinite;
}

/* Progress — Light Theme */

[data-theme="light"] .progress {
  background: var(--neutral-900);
}

/* Progress — With Label */

.progress-labeled {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-labeled .progress {
  flex: 1;
}

.progress-labeled .progress-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}


/* ============================================================
   15. AVATARS
   ============================================================ */

/* --- Avatar --- */

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--neutral-300);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  position: relative;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Avatar Sizes */

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.avatar-lg {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.avatar-xl {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

/* Avatar — Online Status */

.avatar-online {
  box-shadow: 0 0 0 2px var(--state-success);
}

.avatar-offline {
  box-shadow: 0 0 0 2px var(--neutral-400);
}

.avatar-busy {
  box-shadow: 0 0 0 2px var(--state-danger);
}

/* Avatar — Status Dot */

.avatar-status {
  position: relative;
}

.avatar-status::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--color-bg-canvas);
}

.avatar-status.online::after {
  background: var(--state-success);
}

.avatar-status.offline::after {
  background: var(--neutral-400);
}

.avatar-status.busy::after {
  background: var(--state-danger);
}

/* Avatar Stack */

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar {
  margin-left: -8px;
  border: 2px solid var(--color-bg-canvas);
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

/* Avatar Stack — hover expand */

.avatar-stack:hover .avatar {
  margin-left: -4px;
  transition: margin-left var(--duration-default) var(--ease-default);
}

.avatar-stack:hover .avatar:first-child {
  margin-left: 0;
}

/* Avatar — Light Theme */

[data-theme="light"] .avatar {
  background: var(--neutral-900);
  color: var(--color-text-secondary);
}

[data-theme="light"] .avatar-stack .avatar {
  border-color: var(--color-bg-canvas);
}

[data-theme="light"] .avatar-status::after {
  border-color: var(--color-bg-canvas);
}


/* ============================================================
   16. DIVIDERS
   ============================================================ */

/* --- Divider --- */

.divider {
  height: 1px;
  background: var(--color-border-subtle);
  margin: 8px 0;
  border: none;
}

/* Divider — with spacing variants */

.divider-sm {
  margin: 4px 0;
}

.divider-lg {
  margin: 16px 0;
}

.divider-xl {
  margin: 24px 0;
}

/* Divider — Vertical */

.divider-vertical {
  width: 1px;
  height: auto;
  align-self: stretch;
  margin: 0 8px;
}

/* Divider — With Text */

.divider-text {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--color-text-muted);
  background: none;
  height: auto;
  margin: 12px 0;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border-subtle);
}

/* Divider — Strong */

.divider-strong {
  background: var(--color-border-default);
}


/* ============================================================
   17. AI PROMPT BAR
   ============================================================ */

/* --- AI Prompt Bar --- */

.ai-prompt-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 90vw);
  z-index: var(--z-prompt-bar);
  padding: 12px;
}

/* AI Prompt Input */

.ai-prompt-bar .ai-prompt-input {
  height: 56px;
  padding: 0 20px;
  font-size: 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 400;
  width: 100%;
  border-radius: var(--radius-xl);
  outline: none;
  color: var(--color-text-primary);
  transition: all var(--duration-default) var(--ease-default);

  /* glass-ai properties */
  -webkit-backdrop-filter: blur(20px) saturate(1.20);
  backdrop-filter: blur(20px) saturate(1.20);
  background: rgba(58, 58, 63, 0.08);
  border: 1px solid rgba(58, 58, 63, 0.20);
  box-shadow: inset 0 0 0 1px rgba(58, 58, 63, 0.05),
              0 8px 32px rgba(0, 0, 0, 0.20);
}

.ai-prompt-bar .ai-prompt-input::placeholder {
  color: var(--accent-ai-400);
  opacity: 0.5;
}

.ai-prompt-bar .ai-prompt-input:hover {
  border-color: rgba(58, 58, 63, 0.28);
}

.ai-prompt-bar .ai-prompt-input:focus {
  border-color: rgba(58, 58, 63, 0.35);
  box-shadow: inset 0 0 0 1px rgba(58, 58, 63, 0.05),
              0 0 0 2px var(--color-focus-ring),
              0 8px 32px rgba(0, 0, 0, 0.20);
}

/* AI Prompt Bar — Active State */

.ai-prompt-bar.active .ai-prompt-input {
  border-color: rgba(58, 58, 63, 0.40);
  box-shadow: inset 0 0 0 1px rgba(58, 58, 63, 0.08),
              0 0 0 3px rgba(58, 58, 63, 0.12),
              0 12px 40px rgba(0, 0, 0, 0.25);
}

/* AI Prompt Bar — Suggestions Dropdown */

.ai-prompt-suggestions {
  margin-top: 4px;
  padding: 4px;
  border-radius: var(--radius-xl);

  /* glass-surface properties */
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  backdrop-filter: blur(20px) saturate(1.15);
  background: rgba(44, 44, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.30),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ai-prompt-suggestion {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-prompt-suggestion:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.ai-prompt-suggestion .suggestion-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-ai-500);
  flex-shrink: 0;
}

.ai-prompt-suggestion .suggestion-shortcut {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-text-muted);
}

/* AI Prompt Bar — Actions */

.ai-prompt-actions {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* AI Prompt Bar — Light Theme */

[data-theme="light"] .ai-prompt-bar .ai-prompt-input {
  background: rgba(58, 58, 63, 0.06);
  border-color: rgba(58, 58, 63, 0.16);
  box-shadow: inset 0 0 0 1px rgba(58, 58, 63, 0.05),
              0 8px 32px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .ai-prompt-bar .ai-prompt-input:hover {
  border-color: rgba(58, 58, 63, 0.22);
}

[data-theme="light"] .ai-prompt-bar .ai-prompt-input:focus {
  border-color: rgba(58, 58, 63, 0.30);
  box-shadow: inset 0 0 0 1px rgba(58, 58, 63, 0.05),
              0 0 0 2px var(--color-focus-ring),
              0 8px 32px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .ai-prompt-bar.active .ai-prompt-input {
  border-color: rgba(58, 58, 63, 0.35);
  box-shadow: inset 0 0 0 1px rgba(58, 58, 63, 0.08),
              0 0 0 3px rgba(58, 58, 63, 0.10),
              0 12px 40px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ai-prompt-suggestions {
  background: rgba(255, 255, 255, 0.70);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.60);
}

[data-theme="light"] .ai-prompt-suggestion:hover {
  background: rgba(0, 0, 0, 0.04);
}


/* ============================================================
   UTILITY — Focus Visible Global
   ============================================================ */

/* Remove default focus outline for mouse users; show for keyboard */
:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-focus-ring);
}


/* ============================================================
   UTILITY — Reduced Motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .btn,
  .input,
  .card,
  .tab-item,
  .nav-item,
  .dropdown-item,
  .chip,
  .toggle,
  .toggle::after,
  .progress-fill {
    transition-duration: 0ms;
  }

  .btn:active {
    transform: none;
  }

  .card:hover {
    transform: none;
  }

  .chip:active {
    transform: none;
  }

  .dropdown-menu {
    animation-duration: 0ms;
  }

  .toast {
    animation-duration: 0ms;
  }

  .modal {
    animation-duration: 0ms;
  }

  .modal-scrim {
    animation-duration: 0ms;
  }
}
