.duke-badge.badge-success { background: rgba(34,197,94,.15); color: #22c55e; border-color: rgba(34,197,94,.3); }
.duke-badge.badge-warning { background: rgba(234,179,8,.15); color: #eab308; border-color: rgba(234,179,8,.3); }
.duke-badge.badge-error   { background: rgba(239,68,68,.15); color: #ef4444; border-color: rgba(239,68,68,.3); }
.duke-badge.badge-info    { background: rgba(91,154,255,.15); color: #5b9aff; border-color: rgba(91,154,255,.3); }
.duke-badge.badge-neutral { background: rgba(107,114,128,.15); color: #6b7280; border-color: rgba(107,114,128,.3); }
.duke-badge.badge-primary { background: var(--primary-light); color: var(--primary); border-color: var(--primary-border); }
.duke-badge.badge-purple  { background: rgba(139,92,246,.15); color: #8b5cf6; border-color: rgba(139,92,246,.3); }
.duke-metric:hover { box-shadow: var(--card-inset), var(--shadow); transform: translateY(-1px); }
body.light .duke-metric:hover { box-shadow: var(--shadow); }
.duke-metric-sub { font-size: var(--text-sm); color: var(--gray-500); margin-top: var(--space-2); }

/* ── Duke Icon Box ── */
.duke-icon {
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); flex-shrink: 0;
}
.duke-icon-lg { width: 40px; height: 40px; }
.duke-icon svg { width: 50%; height: 50%; }
.duke-icon.icon-blue    { background: var(--primary-light); color: var(--primary); }
.duke-icon.icon-green   { background: var(--success-light); color: var(--success); }
.duke-icon.icon-orange  { background: var(--warning-light); color: var(--warning); }
.duke-icon.icon-red     { background: var(--danger-light); color: var(--danger); }
.duke-icon.icon-purple  { background: rgba(139,92,246,.15); color: #8b5cf6; }
.duke-icon.icon-cyan    { background: rgba(0,212,255,.12); color: var(--accent-cyan); }
.duke-form-group .helper { font-size: var(--text-sm); color: var(--gray-400); margin-top: var(--space-1); }
.duke-toolbar .search-input {
  flex: 1; min-width: 180px; padding: var(--space-2) var(--space-3);
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); font-size: var(--text-base);
  color: var(--text-heading); outline: none; transition: border-color var(--transition);
}
.duke-toolbar .search-input:focus { border-color: var(--primary); }
body.light .duke-toolbar .search-input { background: #fff; border-color: #e5e7eb; }
.duke-chip.active, .duke-chip.selected {
  background: var(--primary-light); border-color: var(--primary); color: var(--primary);
}
body.light .duke-chip.active, body.light .duke-chip.selected {
  background: rgba(37,99,235,.08); border-color: var(--primary); color: #1d4ed8;
}

/* ── Duke Card (extended) ── */
.duke-card {
  background: var(--bg-card); backdrop-filter: var(--card-blur);
  border: var(--glass-border); border-radius: var(--radius);
  padding: var(--space-6); margin-bottom: var(--space-5);
  transition: all var(--transition); box-shadow: var(--card-inset);
}
body.light .duke-card { background: #fff; backdrop-filter: none; border: 1px solid #e5e7eb; box-shadow: none; }

/* ── Duke Divider ── */
.duke-divider { height: 1px; background: var(--border-color); margin: var(--space-4) 0; }
body.light .duke-divider { background: #e5e7eb; }

/* ── Duke Grid helpers ── */
.duke-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.duke-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.duke-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }

/* ═══════════════════════════════════════════════════════════════════
   MOBILE APP EXPERIENCE
   Bottom sheets, action sheets, native-feel interactions
   ═══════════════════════════════════════════════════════════════════ */


/* ── Inline-replacement component classes ── */

/* Status messages / loading / empty inline patterns */
.duke-status-msg { padding: var(--space-5); text-align: center; color: var(--gray-500); }
.duke-status-msg.error { color: var(--danger); }
.duke-status-msg.success { color: var(--success); }

/* Inline card used in template literals */
.duke-inline-card {
  background: var(--bg-card); border: var(--glass-border); border-radius: var(--radius-sm);
  padding: var(--space-4); transition: border-color .15s; cursor: pointer;
}
.duke-inline-card:hover { border-color: var(--primary-border); }
body.light .duke-inline-card { background: #fff; border-color: #e5e7eb; }
body.light .duke-inline-card:hover { border-color: var(--primary); }

/* Inline card title */
.duke-inline-title { font-size: var(--text-md); font-weight: var(--font-semibold); display: block; margin-bottom: var(--space-1); color: var(--text-heading); }

/* Inline meta text */
.duke-meta { font-size: var(--text-sm); color: var(--gray-500); }
.duke-meta-xs { font-size: var(--text-xs); color: var(--gray-500); }

/* Tag/keyword container */
.duke-tags { display: flex; gap: var(--space-1); flex-wrap: wrap; }

/* Priority badge inline */
.duke-priority {
  font-size: var(--text-xs); display: inline-block; padding: 2px var(--space-2);
  border-radius: 10px; margin-top: var(--space-2);
}
.duke-priority.high { background: rgba(239,68,68,.15); color: #ef4444; }
.duke-priority.medium { background: rgba(245,158,11,.15); color: #f59e0b; }
.duke-priority.low { background: rgba(107,114,128,.15); color: #6b7280; }

/* Result container with info */
.duke-result-card {
  background: var(--bg-card); border: var(--glass-border); border-radius: var(--radius-sm); padding: var(--space-4);
}
body.light .duke-result-card { background: #fff; border-color: #e5e7eb; }

/* Result item row */
.duke-result-row {
  padding: var(--space-2) 0; border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: var(--text-sm); color: var(--gray-500);
}
body.light .duke-result-row { border-bottom-color: #f3f4f6; }

/* Auto plan item */
.duke-plan-item {
  background: var(--bg-card); border: var(--glass-border); border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4); margin-bottom: var(--space-2);
}
body.light .duke-plan-item { background: #fff; border-color: #e5e7eb; }

/* Performance metric grid */
.duke-perf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin-bottom: var(--space-4); }
.duke-perf-cell {
  background: var(--bg-card); border: var(--glass-border); border-radius: var(--radius-sm);
  padding: var(--space-3); text-align: center;
}
body.light .duke-perf-cell { background: #fff; border-color: #e5e7eb; }
.duke-perf-value { font-size: var(--text-2xl); font-weight: var(--font-bold); color: var(--primary); }
.duke-perf-label { font-size: var(--text-sm); color: var(--gray-500); }

/* Social post list item */
.duke-post-item {
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-color);
  display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer;
  transition: background var(--transition);
}
.duke-post-item:hover { background: var(--gray-50); }

/* Social platform icon */
.duke-platform-icon { min-width: 32px; text-align: center; padding-top: 2px; flex-shrink: 0; }
.duke-icon-fb { color: #1877F2; font-weight: var(--font-bold); }
.duke-icon-ig { background: linear-gradient(45deg,#f09433,#dc2743); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: var(--font-bold); }

/* Status pill (dynamic color via inline style) */
.duke-status-pill {
  font-size: var(--text-xs); font-weight: var(--font-semibold);
  padding: 3px var(--space-2); border-radius: var(--radius-xs);
}

/* Social caption card */
.duke-caption-card {
  background: var(--bg-card); border: var(--glass-border); border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3);
}
body.light .duke-caption-card { background: #fff; border-color: #e5e7eb; }

/* Caption textarea */
.duke-caption-textarea {
  width: 100%; padding: var(--space-3); border-radius: var(--radius-xs);
  border: 1px solid var(--border-color); background: var(--bg-input);
  color: var(--text-heading); font-size: var(--text-base);
  font-family: inherit; resize: vertical;
}
body.light .duke-caption-textarea { background: #fff; border-color: #e5e7eb; color: #111827; }

/* Noor knowledge editable input */
.duke-editable-input {
  width: 100%; background: transparent; border: none; color: var(--text-heading);
  outline: none; border-bottom: 1px dashed rgba(255,255,255,.1); padding: 2px 0; margin-bottom: var(--space-1);
}
body.light .duke-editable-input { border-bottom-color: #e5e7eb; color: #111827; }
.duke-editable-input:focus { border-bottom-color: var(--primary); }

/* Knowledge hook item */
.duke-hook-item {
  padding: var(--space-3); border-radius: var(--radius-xs); border: 1px solid var(--border-color);
  background: rgba(255,255,255,.02);
}
body.light .duke-hook-item { background: #f9fafb; border-color: #e5e7eb; }

/* Platform rule card */
.duke-platform-card {
  padding: var(--space-4); border-radius: var(--radius-sm); border: 1px solid var(--border-color);
  background: rgba(255,255,255,.02);
}
body.light .duke-platform-card { background: #f9fafb; border-color: #e5e7eb; }

/* Branch profile section */
.duke-branch-section { margin-bottom: var(--space-4); }
.duke-branch-section strong { font-size: var(--text-base); }
.duke-branch-section p { font-size: var(--text-md); color: var(--gray-500); margin-top: var(--space-1); }

/* Branch time card */
.duke-time-card {
  padding: var(--space-3); border-radius: var(--radius-xs); border: 1px solid var(--border-color);
  background: rgba(255,255,255,.02);
}
body.light .duke-time-card { background: #f9fafb; border-color: #e5e7eb; }

/* Season card */
.duke-season-card {
  padding: var(--space-3); border-radius: var(--radius-xs); border: 1px solid var(--border-color);
  background: rgba(255,255,255,.02); font-size: var(--text-sm);
}
body.light .duke-season-card { background: #f9fafb; border-color: #e5e7eb; }

/* Gallery image card */
.duke-gallery-item {
  cursor: pointer; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border-color); transition: transform .2s; position: relative;
}
.duke-gallery-item:hover { transform: scale(1.02); }

/* Gallery image thumb */
.duke-gallery-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }

/* Gallery image info */
.duke-gallery-info { padding: var(--space-2) var(--space-3); }

/* Lightbox */
.duke-lightbox {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.85); display: flex; align-items: center;
  justify-content: center; flex-direction: column; gap: var(--space-4);
  backdrop-filter: blur(8px); opacity: 0; transition: opacity .2s;
}
.duke-lightbox.show { opacity: 1; }
.duke-lightbox-close {
  position: absolute; top: var(--space-4); right: var(--space-4);
  background: rgba(255,255,255,.1); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.duke-lightbox-img {
  max-width: 90vw; max-height: 75vh; border-radius: var(--radius-sm);
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.duke-lightbox-caption {
  color: rgba(255,255,255,.7); font-size: var(--text-base);
  max-width: 600px; text-align: center; padding: 0 var(--space-5);
}
.duke-lightbox-download {
  background: var(--primary); color: #fff; border: none;
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-xs);
  font-size: var(--text-md); cursor: pointer; display: flex;
  align-items: center; gap: var(--space-2); text-decoration: none;
}
.duke-lightbox-download:hover { background: var(--primary-hover); }

/* Color swatch button */
.duke-color-swatch {
  width: 32px; height: 32px; border-radius: var(--radius-xs);
  border: 2px solid rgba(255,255,255,.1); cursor: pointer;
}
body.light .duke-color-swatch { border-color: #e5e7eb; }

/* Brand reference image */
.duke-brand-thumb {
  width: 100%; height: 120px; object-fit: cover;
  border-radius: var(--radius-xs); border: 1px solid var(--border-color);
}

/* Remove button overlay (for brand images etc) */
.duke-remove-overlay {
  position: absolute; top: var(--space-1); right: var(--space-1);
  background: rgba(0,0,0,.6); color: white; border: none; border-radius: 50%;
  width: 24px; height: 24px; cursor: pointer; font-size: var(--text-md); line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

/* Content mix slider row */
.duke-mix-row { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.duke-mix-label { width: 140px; flex-shrink: 0; }
.duke-mix-label strong { font-size: var(--text-base); font-weight: var(--font-semibold); color: var(--text-heading); }
.duke-mix-label span { font-size: var(--text-xs); color: var(--gray-500); display: block; margin-top: 1px; }
.duke-mix-track {
  flex: 1; position: relative; height: 32px;
  background: rgba(255,255,255,.04); border-radius: var(--radius-xs); overflow: hidden; cursor: pointer;
}
body.light .duke-mix-track { background: #f3f4f6; }
.duke-mix-bar { position: absolute; top: 0; left: 0; height: 100%; border-radius: var(--radius-xs); transition: width .2s; }
.duke-mix-range {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; margin: 0;
}
.duke-mix-val {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: var(--text-base); font-weight: var(--font-bold); pointer-events: none;
}
.duke-table thead tr { border-bottom: 2px solid var(--gray-200); }
.duke-table tbody tr { border-bottom: 1px solid var(--gray-100); }
.duke-table .td-muted { color: var(--gray-500); font-size: var(--text-sm); }
.duke-table .td-bold { font-weight: var(--font-medium); }
.duke-table .td-right { text-align: right; }
.duke-table .td-center { text-align: center; }
body.light .duke-table thead tr { border-bottom-color: #e5e7eb; }
body.light .duke-table tbody tr { border-bottom-color: #f3f4f6; }

/* Avatar image */
.duke-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* AI Modus card */
.duke-modus-card {
  border-radius: var(--radius); padding: var(--space-5); cursor: pointer;
  transition: all .2s; position: relative;
}
.duke-modus-card.selected { border: 2px solid var(--primary); background: var(--primary-light); }
.duke-modus-card:not(.selected) { border: 2px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); }
body.light .duke-modus-card:not(.selected) { border-color: #e5e7eb; background: #f9fafb; }
.duke-modus-check {
  position: absolute; top: var(--space-3); right: var(--space-3);
  background: var(--primary); color: #fff; border-radius: 50%;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
}
.duke-modus-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-3); color: var(--gray-500);
}
.duke-modus-card.selected .duke-modus-icon { background: var(--primary); color: #fff; }
.duke-modus-card:not(.selected) .duke-modus-icon { background: rgba(255,255,255,.06); }

/* Appointment item */
.duke-appointment-item {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: rgba(255,255,255,.03); border-radius: var(--radius-sm);
}
body.light .duke-appointment-item { background: #f9fafb; }

/* Inline data entry */
.duke-data-entry { margin-top: var(--space-1); }
.duke-data-entry span.label { color: var(--gray-400); }

/* Flow status dot */
.duke-flow-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.duke-flow-dot.active { background: #22c55e; }
.duke-flow-dot.inactive { background: var(--danger); }

/* Plan card */
.duke-plan-card {
  border-radius: var(--radius); padding: var(--space-6);
  display: flex; flex-direction: column;
}

/* Module card */
.duke-module-card {
  border: 1px solid var(--border-color); border-radius: var(--radius);
  padding: var(--space-5); background: var(--bg-card);
  display: flex; flex-direction: column;
}
body.light .duke-module-card { background: #fff; border-color: #e5e7eb; }

/* Promo section */
.duke-promo-section {
  margin-top: var(--space-4); padding: var(--space-4);
  background: var(--bg-input); border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
body.light .duke-promo-section { background: #f9fafb; }

/* Active tenant indicator */
.duke-active-tenant { border-left: 3px solid var(--primary); padding-left: 13px; }

/* Mobile adjustments for new components */
@media (max-width: 768px) {
  .duke-perf-grid { grid-template-columns: 1fr; }
  .duke-mix-row { flex-direction: column; align-items: stretch; }
  .duke-mix-label { width: auto; }
  .duke-platform-card + .duke-platform-card { margin-top: var(--space-3); }
  .duke-gallery-item:hover { transform: none; }
  .duke-post-item { min-height: var(--tap-min); }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .duke-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .duke-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .duke-perf-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════════════
   DESIGN SYSTEM — Tokens, Utilities & Component Classes
   ══════════════════════════════════════════════════════════════ */


/* ── duke-list-item ── */
.duke-list-item {
  display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color); cursor: pointer; transition: background var(--transition);
}
.duke-list-item:hover { background: rgba(255,255,255,.03); }
body.light .duke-list-item:hover { background: rgba(0,0,0,.02); }
.duke-list-item:last-child { border-bottom: none; }

/* ── duke-section-header ── */
.duke-section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4);
}
.duke-section-header h2, .duke-section-header h3 {
  font-size: var(--text-lg); font-weight: var(--font-semibold); color: var(--text-heading);
}
.duke-section-header p { font-size: var(--text-base); color: var(--gray-500); }

/* ── duke-badge ── */
.duke-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: var(--text-xs);
  font-weight: var(--font-semibold); padding: 2px 8px; border-radius: 10px;
  backdrop-filter: blur(8px); border: 1px solid transparent;
}
.badge-success { background: rgba(34,197,94,.15); color: #22c55e; border-color: rgba(34,197,94,.3); }
.badge-warning { background: rgba(245,158,11,.15); color: #f59e0b; border-color: rgba(245,158,11,.3); }
.badge-error { background: rgba(239,68,68,.15); color: #ef4444; border-color: rgba(239,68,68,.3); }
.badge-info { background: rgba(91,154,255,.15); color: #5b9aff; border-color: rgba(91,154,255,.3); }
.badge-neutral { background: rgba(107,114,128,.15); color: #6b7280; border-color: rgba(107,114,128,.3); }
.badge-primary { background: rgba(37,99,235,.15); color: var(--primary); border-color: rgba(37,99,235,.3); }
body.light .badge-success { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
body.light .badge-warning { background: #fffbeb; color: #d97706; border-color: #fde68a; }
body.light .badge-error { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
body.light .badge-info { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }

/* ── duke-metric ── */
.duke-metric {
  background: var(--bg-card); border: var(--glass-border); border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4); text-align: center;
}
.duke-metric-value { font-size: var(--text-2xl); font-weight: var(--font-bold); color: var(--text-heading); }
.duke-metric-label { font-size: var(--text-sm); color: var(--gray-500); margin-top: var(--space-1); }
body.light .duke-metric { background: #fff; border: 1px solid #e5e7eb; }

/* ── duke-empty ── */
.duke-empty {
  text-align: center; padding: var(--space-10) var(--space-5); color: var(--gray-400); font-size: var(--text-base);
}
.duke-empty svg { width: 48px; height: 48px; color: var(--gray-300); margin-bottom: var(--space-3); }
.duke-empty h3 { font-size: 15px; font-weight: var(--font-semibold); color: var(--text-heading); margin-bottom: var(--space-1); }
.duke-empty p { margin-bottom: var(--space-4); }

/* ── duke-form-group ── */
.duke-form-group { margin-bottom: var(--space-4); }
.duke-form-group label { display: block; font-size: var(--text-base); font-weight: var(--font-medium); color: var(--gray-700); margin-bottom: var(--space-1); }

/* ── duke-form-label: standalone label ── */
.duke-form-label { display: block; margin-bottom: var(--space-1); font-size: var(--text-sm); color: var(--gray-500); }
.duke-form-label-md { display: block; margin-bottom: var(--space-2); font-weight: var(--font-medium); color: var(--text-heading); font-size: var(--text-base); }

/* ── duke-input: standard input styling ── */
.duke-input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 10px; color: var(--text-primary); font-size: var(--text-md);
}
.duke-input-textarea { resize: vertical; font-family: inherit; padding: 12px; }
.duke-input-mono { font-family: monospace; font-size: var(--text-sm); }

/* ── duke-ai-suggestion: AI suggestion box ── */
.duke-ai-suggestion {
  margin-top: var(--space-2); padding: 8px 12px; background: rgba(37,99,235,.1);
  border: 1px solid rgba(37,99,235,.2); border-radius: 8px; font-size: var(--text-sm); color: var(--primary);
}

/* ── duke-ai-tag: inline AI-generated tag ── */
.duke-ai-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  background: var(--primary-light); color: var(--primary); border: 1px solid var(--primary-border);
  border-radius: 20px; font-size: var(--text-sm); font-weight: var(--font-medium);
}

/* ── duke-dropzone ── */
.duke-dropzone {
  padding: var(--space-6); text-align: center; color: var(--gray-500); font-size: var(--text-base);
  border: 2px dashed var(--border-color); border-radius: var(--radius-sm);
}

/* ── duke-remove-btn: small x button ── */
.duke-remove-btn { cursor: pointer; opacity: .6; font-size: var(--text-md); line-height: 1; }
.duke-remove-btn:hover { opacity: 1; }

/* ── duke-toolbar ── */
.duke-toolbar {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  padding: var(--space-3) 0; margin-bottom: var(--space-4);
}

/* ── duke-chip ── */
.duke-chip {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-1) var(--space-3); border-radius: 20px;
  border: 1px solid var(--border-color); background: rgba(255,255,255,.04);
  color: var(--text-body); font-size: var(--text-base); cursor: pointer; transition: all .15s;
  user-select: none;
}
.duke-chip:hover { border-color: rgba(255,255,255,.25); }
.duke-chip.selected, .duke-chip.active { background: rgba(37,99,235,.15); border-color: var(--primary); color: var(--primary); }
body.light .duke-chip { border-color: #d1d5db; background: #f9fafb; color: #374151; }
body.light .duke-chip:hover { border-color: #9ca3af; }
body.light .duke-chip.selected, body.light .duke-chip.active { background: rgba(37,99,235,.1); border-color: var(--primary); color: #1d4ed8; }

/* ── duke-card-item: card used in lists/grids ── */
.duke-card-item {
  background: var(--bg-card); border: var(--glass-border); border-radius: var(--radius-sm);
  padding: var(--space-4); transition: border-color .15s;
}
.duke-card-item:hover { border-color: rgba(255,255,255,.15); }
body.light .duke-card-item { background: #fff; border: 1px solid #e5e7eb; }
body.light .duke-card-item:hover { border-color: #d1d5db; }

/* ── duke-icon-circle ── */
.duke-icon-circle {
  width: 32px; height: 32px; border-radius: var(--radius-xs); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.duke-icon-circle svg { width: 16px; height: 16px; }

/* ── duke-info-card: bordered info block ── */
.duke-info-card {
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-xs); border: 1px solid var(--border-color);
  background: rgba(255,255,255,.02);
}
body.light .duke-info-card { background: #f9fafb; border-color: #e5e7eb; }

/* ── duke-hook-input: transparent editable input ── */
.duke-hook-input {
  width: 100%; background: transparent; border: none; color: var(--text-primary);
  outline: none; border-bottom: 1px dashed rgba(255,255,255,.1); padding: 2px 0; margin-bottom: var(--space-1);
}
body.light .duke-hook-input { color: #111827; border-bottom-color: #e5e7eb; }

/* ── duke-loading / duke-error ── */
.duke-loading { padding: var(--space-5); text-align: center; color: var(--gray-500); font-size: var(--text-base); }

/* ── duke-inline-icon: small inline SVG icon ── */
.duke-icon-sm { width: 14px; height: 14px; margin-right: 4px; }
.duke-icon-md { width: 16px; height: 16px; margin-right: 6px; }
.duke-icon-sm.spinning, .duke-icon-md.spinning { animation: spin 1s linear infinite; }

/* ── duke-table ── */
.duke-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.duke-table th { padding: 8px 10px; font-weight: var(--font-semibold); color: var(--gray-500); font-size: var(--text-xs); text-transform: uppercase; }
.duke-table td { padding: 10px 12px; }
.duke-table-row { border-bottom: 1px solid var(--border-color); transition: background var(--transition); }
.duke-table-row:hover { background: rgba(255,255,255,.03); }
body.light .duke-table-row:hover { background: rgba(0,0,0,.02); }
.duke-error { padding: var(--space-5); color: var(--danger); font-size: var(--text-base); }

/* ── duke-tag: small keyword/tag pill ── */
.duke-tag {
  display: inline-block; font-size: var(--text-xs); padding: 2px 8px;
  background: rgba(255,255,255,.06); border-radius: 10px; color: var(--gray-500);
}
body.light .duke-tag { background: #f3f4f6; color: #6b7280; }

/* ── duke-priority-badge ── */
.duke-priority-badge {
  display: inline-block; font-size: var(--text-xs); padding: 2px 8px; border-radius: 10px;
}
.duke-priority-badge.priority-high { background: rgba(239,68,68,.15); color: #ef4444; }
.duke-priority-badge.priority-medium { background: rgba(245,158,11,.15); color: #f59e0b; }
.duke-priority-badge.priority-low { background: rgba(107,114,128,.15); color: #6b7280; }

/* ══════════════════════════════════════════════════════════════
   Mobile App Components
   ══════════════════════════════════════════════════════════════ */

/* ── duke-bottom-sheet ── */
.duke-bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 210;
  background: var(--bg-card); backdrop-filter: var(--card-blur);
  border: var(--glass-border); border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: var(--space-4) var(--space-5); padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(0,0,0,.3);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.duke-bottom-sheet.open { transform: translateY(0); }
body.light .duke-bottom-sheet { background: #fff; border: 1px solid #e5e7eb; border-bottom: none; box-shadow: 0 -8px 40px rgba(0,0,0,.1); }

.duke-bottom-sheet-handle {
  width: 36px; height: 4px; background: var(--gray-400); border-radius: 2px;
  margin: 0 auto var(--space-4);
}

/* ── duke-action-sheet (iOS style) ── */
.duke-action-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 220;
  padding: var(--space-2); padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.duke-action-sheet.open { transform: translateY(0); }
.duke-action-sheet-group {
  background: var(--bg-card); backdrop-filter: var(--card-blur); border-radius: var(--radius);
  overflow: hidden; margin-bottom: var(--space-2);
}
body.light .duke-action-sheet-group { background: #fff; }
.duke-action-sheet-item {
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4); font-size: var(--text-lg); font-weight: var(--font-medium);
  color: var(--primary); cursor: pointer; border-bottom: 1px solid var(--border-subtle);
  min-height: var(--tap-min); transition: background .15s;
}
.duke-action-sheet-item:last-child { border-bottom: none; }
.duke-action-sheet-item:active { background: var(--gray-100); }
.duke-action-sheet-item.destructive { color: var(--danger); }
.duke-action-sheet-cancel {
  background: var(--bg-card); backdrop-filter: var(--card-blur); border-radius: var(--radius);
  padding: var(--space-4); text-align: center; font-size: var(--text-lg);
  font-weight: var(--font-semibold); color: var(--primary); cursor: pointer;
  min-height: var(--tap-min);
}
body.light .duke-action-sheet-cancel { background: #fff; }

/* ── Slide animations ── */
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideDown { from { transform: translateY(0); } to { transform: translateY(100%); } }
.duke-slide-up { animation: slideUp .3s cubic-bezier(.4,0,.2,1) forwards; }
.duke-slide-down { animation: slideDown .3s cubic-bezier(.4,0,.2,1) forwards; }

/* ── duke-pull-header: sticky header with blur ── */
.duke-pull-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg-topbar); backdrop-filter: blur(20px);
  border-bottom: var(--glass-border); padding: var(--space-3) var(--space-4);
}
body.light .duke-pull-header { background: rgba(255,255,255,.9); border-bottom: 1px solid #e5e7eb; }

/* ── Swipe indicator ── */
.duke-swipe-hint { width: 36px; height: 4px; background: var(--gray-300); border-radius: 2px; margin: var(--space-2) auto; }

/* ══════════════════════════════════════════════════════════════
   Mobile Overrides
   ══════════════════════════════════════════════════════════════ */

/* Touch-friendly: no hover on touch devices */
@media (hover: none) {
  .card:hover { transform: none; box-shadow: var(--card-inset); }
  .duke-card-item:hover { border-color: rgba(255,255,255,.07); }
  body.light .card:hover { box-shadow: none; }
}

@media (max-width: 768px) {
  /* Bottom sheet modal override */
  .modal-overlay.show {
    align-items: flex-end;
  }
  .modal-overlay.show .modal {
    max-width: 100%; width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: var(--space-5); padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
    animation: slideUp .3s cubic-bezier(.4,0,.2,1);
  }
  .modal-overlay.show .modal::before {
    content: ''; display: block; width: 36px; height: 4px;
    background: var(--gray-400); border-radius: 2px; margin: 0 auto var(--space-4);
  }

  /* Buttons: tap targets */
  .btn { min-height: var(--tap-min); }

  /* Grid collapses */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* duke-card-item less padding */
  .duke-card-item { padding: var(--space-3); }

  /* Momentum scrolling */
  .duke-bottom-sheet, .duke-action-sheet, .dash-card-body, .notification-dropdown-list {
    -webkit-overflow-scrolling: touch;
  }

  /* Safe area bottom padding for fixed elements */
  .duke-bottom-sheet, .duke-action-sheet {
    padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  }
}

