/* ============================================================================
   PROMPTASH — PREMIUM SAAS UI/UX DESIGN SYSTEM
   Palette: Refined Dark Navy (#0b1120 / #0f172a), Crisp White (#ffffff),
            Subtle Electric Violet (#6d5dfc / #7c3aed)
   ============================================================================ */

:root {
  /* Raw Light & Dark Primitives */
  --bg-canvas-light: #f4f6fb;
  --bg-canvas-dark: #080d1a;

  --bg-surface-light: #ffffff;
  --bg-surface-dark: #0f172a;

  --bg-elevated-light: #f8fafc;
  --bg-elevated-dark: #151f38;

  --bg-subtle-light: #eef2ff;
  --bg-subtle-dark: #1a2442;

  --text-primary-light: #0f172a;
  --text-primary-dark: #f1f5f9;

  --text-secondary-light: #475569;
  --text-secondary-dark: #94a3b8;

  --text-muted-light: #64748b;
  --text-muted-dark: #64748b;

  --border-subtle-light: #e2e8f0;
  --border-subtle-dark: #1e293b;

  --border-strong-light: #cbd5e1;
  --border-strong-dark: #334155;

  --brand-primary-light: #6d5dfc;
  --brand-primary-dark: #8b7cf8;

  --brand-hover-light: #5b4be8;
  --brand-hover-dark: #9d90ff;

  --brand-soft-light: rgba(109, 93, 252, 0.10);
  --brand-soft-dark: rgba(139, 124, 248, 0.16);

  --shadow-card-light: 0 1px 3px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.05);
  --shadow-card-dark: 0 1px 3px rgba(0, 0, 0, 0.28), 0 10px 28px rgba(0, 0, 0, 0.35);

  --scrollbar-track-light: #eef2f7;
  --scrollbar-track-dark: #0b1120;
  --scrollbar-thumb-light: #cbd5e1;
  --scrollbar-thumb-dark: #334155;

  /* Default (Light) fallback assignments */
  --pt-bg-canvas: var(--bg-canvas-light);
  --pt-bg-surface: var(--bg-surface-light);
  --pt-bg-elevated: var(--bg-elevated-light);
  --pt-bg-subtle: var(--bg-subtle-light);
  --pt-text-primary: var(--text-primary-light);
  --pt-text-secondary: var(--text-secondary-light);
  --pt-text-muted: var(--text-muted-light);
  --pt-border: var(--border-subtle-light);
  --pt-border-strong: var(--border-strong-light);
  --pt-brand: var(--brand-primary-light);
  --pt-brand-hover: var(--brand-hover-light);
  --pt-brand-soft: var(--brand-soft-light);
  --pt-shadow-card: var(--shadow-card-light);
  --pt-scrollbar-track: var(--scrollbar-track-light);
  --pt-scrollbar-thumb: var(--scrollbar-thumb-light);

  /* Layout metrics */
  --pt-sidebar-width: 264px;
  --pt-sidebar-collapsed-width: 78px;
  --pt-topbar-height: 66px;
  --pt-radius-sm: 8px;
  --pt-radius-md: 12px;
  --pt-radius-lg: 16px;
  --pt-radius-xl: 20px;

  /* Fallback for browsers without light-dark() support */
  @media (prefers-color-scheme: dark) {
    --pt-bg-canvas: var(--bg-canvas-dark);
    --pt-bg-surface: var(--bg-surface-dark);
    --pt-bg-elevated: var(--bg-elevated-dark);
    --pt-bg-subtle: var(--bg-subtle-dark);
    --pt-text-primary: var(--text-primary-dark);
    --pt-text-secondary: var(--text-secondary-dark);
    --pt-text-muted: var(--text-muted-dark);
    --pt-border: var(--border-subtle-dark);
    --pt-border-strong: var(--border-strong-dark);
    --pt-brand: var(--brand-primary-dark);
    --pt-brand-hover: var(--brand-hover-dark);
    --pt-brand-soft: var(--brand-soft-dark);
    --pt-shadow-card: var(--shadow-card-dark);
    --pt-scrollbar-track: var(--scrollbar-track-dark);
    --pt-scrollbar-thumb: var(--scrollbar-thumb-dark);
  }

  /* Modern automatic light-dark() token resolution */
  @supports (color: light-dark(white, black)) {
    --pt-bg-canvas: light-dark(var(--bg-canvas-light), var(--bg-canvas-dark));
    --pt-bg-surface: light-dark(var(--bg-surface-light), var(--bg-surface-dark));
    --pt-bg-elevated: light-dark(var(--bg-elevated-light), var(--bg-elevated-dark));
    --pt-bg-subtle: light-dark(var(--bg-subtle-light), var(--bg-subtle-dark));
    --pt-text-primary: light-dark(var(--text-primary-light), var(--text-primary-dark));
    --pt-text-secondary: light-dark(var(--text-secondary-light), var(--text-secondary-dark));
    --pt-text-muted: light-dark(var(--text-muted-light), var(--text-muted-dark));
    --pt-border: light-dark(var(--border-subtle-light), var(--border-subtle-dark));
    --pt-border-strong: light-dark(var(--border-strong-light), var(--border-strong-dark));
    --pt-brand: light-dark(var(--brand-primary-light), var(--brand-primary-dark));
    --pt-brand-hover: light-dark(var(--brand-hover-light), var(--brand-hover-dark));
    --pt-brand-soft: light-dark(var(--brand-soft-light), var(--brand-soft-dark));
    --pt-scrollbar-track: light-dark(var(--scrollbar-track-light), var(--scrollbar-track-dark));
    --pt-scrollbar-thumb: light-dark(var(--scrollbar-thumb-light), var(--scrollbar-thumb-dark));
  }

  /* Viewport-wide native color scheme declaration */
  color-scheme: light dark;
  accent-color: var(--pt-brand);
  scrollbar-width: thin;
  scrollbar-color: var(--pt-scrollbar-thumb) var(--pt-scrollbar-track);

  /* Reflect <meta name="color-scheme"> override directly into CSS cascade */
  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
    --pt-shadow-card: var(--shadow-card-dark);
  }
  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
    --pt-shadow-card: var(--shadow-card-light);
  }
}

@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--pt-scrollbar-thumb);
    border-radius: 999px;
  }
  ::-webkit-scrollbar-track {
    background: var(--pt-scrollbar-track);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: clip;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--pt-bg-canvas);
  color: var(--pt-text-primary);
  margin: 0;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: clip;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
}
code {
  overflow-wrap: anywhere;
}

a {
  color: var(--pt-brand);
  text-decoration: none;
}
a:hover {
  color: var(--pt-brand-hover);
}

/* Fluid Typography & Responsive Headings */
.pt-page-title {
  font-size: clamp(1.15rem, 0.96rem + 0.55vw, 1.62rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--pt-text-primary);
  margin: 0;
  text-wrap: balance;
}

.pt-hero-title {
  font-size: clamp(1.65rem, 1.25rem + 1.8vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  text-wrap: balance;
}

/* Responsive Heading Scale */
h1, .h1 {
  font-size: clamp(1.28rem, 1.12rem + 0.75vw, 2.15rem);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h2, .h2 {
  font-size: clamp(1.12rem, 1rem + 0.55vw, 1.65rem);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h3, .h3 {
  font-size: clamp(1rem, 0.94rem + 0.35vw, 1.3rem);
  letter-spacing: -0.015em;
}

h4, .h4 {
  font-size: clamp(0.92rem, 0.88rem + 0.25vw, 1.15rem);
}

h5, .h5 {
  font-size: clamp(0.86rem, 0.82rem + 0.2vw, 1.02rem);
}

h6, .h6 {
  font-size: clamp(0.8rem, 0.76rem + 0.15vw, 0.92rem);
}

/* Page Header & Adaptive Action Toolbar */
.pt-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pt-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================================================
   APP SHELL & COLLAPSIBLE DARK NAVY SIDEBAR
   ============================================================================ */
.pt-app-shell {
  display: flex;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.pt-sidebar {
  width: var(--pt-sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(180deg, #0b1120 0%, #0d1426 100%);
  color: #cbd5e1;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: 1030;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.24s ease;
  color-scheme: dark;
}

.pt-sidebar-brand {
  height: var(--pt-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.pt-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6d5dfc 0%, #9333ea 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(109, 93, 252, 0.45);
  flex-shrink: 0;
}

.pt-brand-text {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: #ffffff;
  white-space: nowrap;
}

.pt-brand-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(139, 124, 248, 0.18);
  color: #c4b5fd;
  border: 1px solid rgba(139, 124, 248, 0.28);
}

.pt-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pt-nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.75rem 0.75rem 0.35rem;
  white-space: nowrap;
}

.pt-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.62rem 0.8rem;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}

.pt-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.pt-nav-link.active {
  background: linear-gradient(90deg, rgba(109, 93, 252, 0.24) 0%, rgba(109, 93, 252, 0.10) 100%);
  color: #ffffff;
  border: 1px solid rgba(139, 124, 248, 0.32);
  box-shadow: inset 2px 0 0 #8b7cf8;
}

.pt-nav-link.active .pt-nav-icon {
  color: #a78bfa;
}

.pt-nav-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.pt-sidebar-footer {
  padding: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* Desktop Collapsed Sidebar State */
body.sidebar-collapsed .pt-sidebar {
  width: var(--pt-sidebar-collapsed-width);
}
body.sidebar-collapsed .pt-brand-text,
body.sidebar-collapsed .pt-brand-badge,
body.sidebar-collapsed .pt-nav-label,
body.sidebar-collapsed .pt-nav-section-label,
body.sidebar-collapsed .pt-sidebar-footer-text {
  display: none !important;
}
body.sidebar-collapsed .pt-nav-link {
  justify-content: center;
  padding: 0.68rem;
}
body.sidebar-collapsed .pt-sidebar-brand {
  justify-content: center;
  padding: 0 0.5rem;
}

/* Mobile Sidebar Backdrop & Drawer */
.pt-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 13, 26, 0.65);
  backdrop-filter: blur(3px);
  z-index: 1025;
}

@media (max-width: 991.98px) {
  .pt-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    transform: translateX(-100%);
    width: var(--pt-sidebar-width) !important;
  }
  body.sidebar-mobile-open .pt-sidebar {
    transform: translateX(0);
  }
  body.sidebar-mobile-open .pt-sidebar-backdrop {
    display: block;
  }
}

/* ============================================================================
   MAIN WORKSPACE & TOP NAVIGATION BAR
   ============================================================================ */
.pt-main-wrapper {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

.pt-topbar {
  height: var(--pt-topbar-height);
  background: var(--pt-bg-surface);
  border-bottom: 1px solid var(--pt-border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1015;
  max-width: 100%;
  box-sizing: border-box;
}

.pt-content {
  flex: 1;
  padding: 1.75rem;
  max-width: 1440px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (max-width: 767.98px) {
  body {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .pt-topbar {
    padding: 0 0.85rem;
    height: 58px;
  }
  .pt-content {
    padding: 1rem;
  }

  /* Responsive Page Header & Symmetrical Action Bar */
  .pt-page-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.85rem;
  }

  .pt-header-actions {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)) !important;
    gap: 0.5rem !important;
    inline-size: 100% !important;
  }

  .pt-header-actions > .btn,
  .pt-header-actions > a.btn {
    inline-size: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.81rem !important;
    border-radius: 9px !important;
  }

  .pt-header-actions > .btn i,
  .pt-header-actions > a.btn i {
    flex-shrink: 0 !important;
  }

  /* When there are 3 action buttons in a grid, let the primary CTA span across full width */
  .pt-header-actions > .btn-pt-primary:last-child:nth-child(odd) {
    grid-column: 1 / -1 !important;
  }

  .pt-card {
    border-radius: var(--pt-radius-md);
  }
  .pt-card.p-4 {
    padding: 1.1rem !important;
  }
  .pt-card.p-sm-5 {
    padding: 1.2rem !important;
  }

  .form-control, .form-select {
    font-size: 0.83rem;
    padding: 0.45rem 0.68rem;
    border-radius: 8px;
  }

  .form-select {
    padding-right: 1.85rem;
    text-overflow: ellipsis;
  }

  .form-label {
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
  }

  .pt-stat-value {
    font-size: 1.35rem;
  }
  .pt-stat-label {
    font-size: 0.75rem;
  }

  .btn-pt-primary, .btn-pt-subtle, .btn {
    font-size: 0.82rem;
    padding: 0.44rem 0.82rem;
  }

  .pt-topbar-search input {
    font-size: 0.8rem;
    padding-inline-start: 2rem;
  }

  .pt-badge {
    font-size: 0.68rem;
    padding: 0.16rem 0.45rem;
  }

  .pt-track-pill {
    font-size: 0.74rem;
    padding: 0.3rem 0.65rem;
  }

  .lead {
    font-size: 0.95rem !important;
    line-height: 1.5;
  }

  .table {
    font-size: 0.8rem;
  }
  .table th, .table td {
    padding: 0.5rem 0.6rem;
  }

  .modal-title {
    font-size: 0.98rem;
  }
  .modal-body {
    padding: 0.95rem;
    font-size: 0.86rem;
  }

  .alert {
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
  }

  .dropdown-item {
    font-size: 0.82rem;
    padding: 0.38rem 0.75rem;
  }

  code, kbd, samp, pre {
    font-size: 0.82em;
    word-break: break-word;
  }
}

@media (max-width: 575.98px) {
  body {
    font-size: 0.85rem;
  }

  .pt-content {
    padding: 0.75rem;
  }

  .pt-topbar {
    padding: 0 0.65rem;
    height: 54px;
  }

  .pt-card {
    padding: 0.85rem;
  }
  .pt-card.p-4, .pt-card.p-sm-5 {
    padding: 0.85rem !important;
  }

  .pt-stat-value {
    font-size: 1.22rem;
  }

  .pt-page-title {
    font-size: 1.1rem;
  }

  .form-control, .form-select {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  .form-label {
    font-size: 0.75rem;
  }

  .btn-pt-primary, .btn-pt-subtle, .btn {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
  }

  .pt-header-actions {
    gap: 0.4rem !important;
  }
  .pt-header-actions > .btn,
  .pt-header-actions > a.btn {
    font-size: 0.78rem !important;
    padding: 0.44rem 0.65rem !important;
  }

  .pt-msg-bubble {
    max-width: 95%;
    padding: 0.75rem 0.85rem;
    font-size: 0.84rem;
  }
}

/* Global Search Input in Topbar */
.pt-topbar-search {
  position: relative;
  max-width: 380px;
  width: 100%;
}
.pt-topbar-search input {
  padding-inline-start: 2.35rem;
  border-radius: 999px;
  background: var(--pt-bg-elevated);
  border: 1px solid var(--pt-border);
  color: var(--pt-text-primary);
  font-size: 0.875rem;
  height: 38px;
}
.pt-topbar-search input:focus {
  border-color: var(--pt-brand);
  box-shadow: 0 0 0 3px var(--pt-brand-soft);
  background: var(--pt-bg-surface);
}
.pt-topbar-search .search-icon {
  position: absolute;
  inset-inline-start: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--pt-text-muted);
  pointer-events: none;
}

/* Theme Switcher Icon Visibility (CSS-driven + synced) */
.pt-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--pt-border);
  background: var(--pt-bg-surface);
  color: var(--pt-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
  position: relative;
}
.pt-icon-btn:hover {
  border-color: var(--pt-brand);
  color: var(--pt-brand);
  background: var(--pt-brand-soft);
}

.pt-notif-dot {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px var(--pt-bg-surface);
}

/* ============================================================================
   CARDS, BUTTONS, BADGES & FORM CONTROLS
   ============================================================================ */
.pt-card {
  background: var(--pt-bg-surface);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-lg);
  box-shadow: var(--pt-shadow-card);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  min-width: 0;
  max-width: 100%;
}

.pt-card-hover:hover {
  transform: translateY(-2px);
  border-color: rgba(109, 93, 252, 0.42);
}

.pt-stat-card {
  padding: 1.35rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.pt-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pt-stat-value {
  font-size: clamp(1.3rem, 1.15rem + 0.65vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--pt-text-primary);
}

.pt-stat-label {
  font-size: clamp(0.72rem, 0.7rem + 0.15vw, 0.82rem);
  font-weight: 500;
  color: var(--pt-text-secondary);
}

/* Primary Violet Brand Button */
.btn-pt-primary {
  background: linear-gradient(135deg, #6d5dfc 0%, #7c3aed 100%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-weight: 600;
  font-size: clamp(0.82rem, 0.78rem + 0.2vw, 0.88rem);
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: 0 4px 14px rgba(109, 93, 252, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-pt-primary:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(109, 93, 252, 0.38);
}
.btn-pt-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-pt-subtle {
  background: var(--pt-bg-elevated);
  color: var(--pt-text-primary);
  border: 1px solid var(--pt-border);
  border-radius: 10px;
  font-weight: 500;
  font-size: clamp(0.8rem, 0.76rem + 0.2vw, 0.86rem);
  padding: 0.46rem 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  transition: all 0.15s ease;
}
.btn-pt-subtle:hover {
  border-color: var(--pt-brand);
  color: var(--pt-brand);
  background: var(--pt-brand-soft);
}

/* Badges — Crisp single-line SaaS chips (never bloat into multi-line oval balloons) */
.pt-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.52rem;
  border-radius: 7px;
  font-size: clamp(0.68rem, 0.65rem + 0.15vw, 0.73rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  white-space: nowrap;
  max-inline-size: 100%;
  overflow: clip;
  text-overflow: ellipsis;
}
.pt-badge-violet {
  background: var(--pt-brand-soft);
  color: var(--pt-brand);
  border: 1px solid rgba(109, 93, 252, 0.25);
}
.pt-badge-navy {
  background: rgba(15, 23, 42, 0.08);
  color: var(--pt-text-secondary);
  border: 1px solid var(--pt-border);
}
.pt-badge-emerald {
  background: rgba(16, 185, 129, 0.13);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.28);
}
.pt-badge-amber {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.28);
}
.pt-badge-rose {
  background: rgba(239, 68, 68, 0.13);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

/* Form Controls */
.form-control, .form-select {
  background-color: var(--pt-bg-elevated);
  border: 1px solid var(--pt-border);
  color: var(--pt-text-primary);
  border-radius: 10px;
  padding: 0.52rem 0.8rem;
  font-size: clamp(0.82rem, 0.78rem + 0.22vw, 0.9rem);
  line-height: 1.45;
}
.form-select {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.form-control:focus, .form-select:focus {
  background-color: var(--pt-bg-surface);
  border-color: var(--pt-brand);
  color: var(--pt-text-primary);
  box-shadow: 0 0 0 3px var(--pt-brand-soft);
}
.pt-quick-launcher-textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.55;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  scrollbar-width: thin;
}
.pt-quick-launcher-textarea::placeholder {
  color: var(--pt-text-muted);
  opacity: 0.82;
}
/* Prevent jarring browser autofill background tints and keep typography coherent */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active,
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--pt-bg-elevated) inset !important;
  box-shadow: 0 0 0 1000px var(--pt-bg-elevated) inset !important;
  -webkit-text-fill-color: var(--pt-text-primary) !important;
  caret-color: var(--pt-text-primary) !important;
  transition: background-color 5000s ease-in-out 0s;
}
.form-label {
  font-weight: 600;
  font-size: clamp(0.76rem, 0.72rem + 0.18vw, 0.84rem);
  color: var(--pt-text-primary);
  margin-bottom: 0.35rem;
}

/* Avatar Circle */
.pt-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* Prompt Output Monospace / Clean Display Box */
.pt-prompt-box {
  background: var(--pt-bg-elevated);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-md);
  padding: 1.25rem;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.68;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: var(--pt-text-primary);
  max-height: 540px;
  overflow-y: auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Improvement Action Selector Pills/Cards */
.pt-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 0.65rem;
}
.pt-mode-card {
  border: 1px solid var(--pt-border);
  background: var(--pt-bg-elevated);
  border-radius: 12px;
  padding: 0.78rem 0.9rem;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
}
.pt-mode-card:hover {
  border-color: var(--pt-brand);
  background: var(--pt-bg-surface);
}
.pt-mode-card.active {
  border-color: var(--pt-brand);
  background: var(--pt-brand-soft);
  box-shadow: 0 0 0 1px var(--pt-brand);
}

/* ============================================================================
   SKELETON LOADING & ATTRACTIVE EMPTY STATES
   ============================================================================ */
@keyframes pt-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.pt-skeleton {
  background: linear-gradient(90deg, var(--pt-border) 25%, var(--pt-bg-elevated) 50%, var(--pt-border) 75%);
  background-size: 200% 100%;
  animation: pt-shimmer 1.4s infinite linear;
  border-radius: 8px;
}
.pt-skeleton-line {
  height: 14px;
  margin-bottom: 0.7rem;
}

.pt-empty-state {
  text-align: center;
  padding: 3.25rem 1.5rem;
}
.pt-empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--pt-brand-soft);
  color: var(--pt-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

/* ============================================================================
   RESPONSIVE DATA TABLES (@container queries & sticky headers)
   ============================================================================ */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(560px, 78dvh);
  container-type: inline-size;
  border-radius: var(--pt-radius-md);
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
.table-wrapper.table-wrapper-auto {
  max-block-size: none;
  overflow-y: visible;
  overflow-x: auto;
  scrollbar-gutter: auto;
  overscroll-behavior: auto;
}
.table-wrapper:focus-visible {
  outline: 2px solid var(--pt-brand);
  outline-offset: 2px;
}

.pt-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}
.pt-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pt-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}
.pt-table thead th {
  background: var(--pt-bg-elevated);
  color: var(--pt-text-secondary);
  font-weight: 600;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  padding: 0.78rem 1rem;
  border-bottom: 1px solid var(--pt-border);
  white-space: nowrap;
}
.pt-table tbody th,
.pt-table tbody td {
  padding: 0.92rem 1rem;
  border-bottom: 1px solid var(--pt-border);
  vertical-align: middle;
  background: var(--pt-bg-surface);
}
.pt-table tbody tr:last-child th,
.pt-table tbody tr:last-child td {
  border-bottom: 0;
}
.pt-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  font-weight: 600;
  color: var(--pt-text-primary);
}
.pt-table tbody tr:hover th,
.pt-table tbody tr:hover td {
  background: var(--pt-bg-elevated);
}

@container (width < 600px) {
  .pt-table,
  .pt-table thead,
  .pt-table tbody,
  .pt-table tr,
  .pt-table th,
  .pt-table td {
    display: block;
  }
  .pt-table thead {
    display: none;
  }
  .pt-table tbody tr {
    margin-block-end: 0.9rem;
    border: 1px solid var(--pt-border);
    border-radius: 12px;
    overflow: hidden;
  }
  .pt-table tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: var(--pt-bg-elevated);
  }
  .pt-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
  }
  .pt-table tbody td:nth-child(2)::before {
    content: var(--label-2, "Info") ": ";
    font-weight: 600;
    color: var(--pt-text-secondary);
  }
  .pt-table tbody td:nth-child(3)::before {
    content: var(--label-3, "Meta") ": ";
    font-weight: 600;
    color: var(--pt-text-secondary);
  }
  .pt-table tbody td:nth-child(4)::before {
    content: var(--label-4, "Status") ": ";
    font-weight: 600;
    color: var(--pt-text-secondary);
  }
  .pt-table tbody td:nth-child(5)::before {
    content: var(--label-5, "Actions") ": ";
    font-weight: 600;
    color: var(--pt-text-secondary);
  }
}

/* ============================================================================
   PERSISTENT TOP-LAYER TOAST NOTIFICATIONS (Popover="manual")
   ============================================================================ */
.pt-toast-stack {
  position: fixed;
  inset-block-end: 1.25rem;
  inset-inline-end: 1.25rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.pt-toast[popover] {
  position: fixed;
  inset: auto 1.25rem 1.25rem auto;
  margin: 0;
  padding: 0.85rem 1.05rem;
  min-width: 290px;
  max-width: min(400px, calc(100vw - 2.5rem));
  border-radius: 12px;
  border: 1px solid var(--pt-border-strong);
  background: var(--pt-bg-surface);
  color: var(--pt-text-primary);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, display 0.2s ease allow-discrete, overlay 0.2s ease allow-discrete;
  transition-behavior: allow-discrete;
}

.pt-toast[popover]:is(:popover-open, .\:popover-open) {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  opacity: 1;
  transform: translateY(0);
}

@starting-style {
  .pt-toast[popover]:is(:popover-open, .\:popover-open) {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Fallback sibling spacing + modern sibling-index offset */
.pt-toast + .pt-toast {
  margin-top: 0.65rem;
}
@supports (bottom: calc(1rem * sibling-index())) {
  .pt-toast[popover] {
    inset-block-end: calc(1.25rem + (sibling-index() - 1) * 4.4rem);
  }
}

.pt-toast-success { border-inline-start: 4px solid #10b981 !important; }
.pt-toast-error   { border-inline-start: 4px solid #ef4444 !important; }
.pt-toast-warning { border-inline-start: 4px solid #f59e0b !important; }
.pt-toast-info    { border-inline-start: 4px solid #6d5dfc !important; }

/* ============================================================================
   AI CONVERSATION WORKSPACE LAYOUT
   ============================================================================ */
.pt-workspace-grid {
  display: grid;
  grid-template-columns: 260px 1fr 360px;
  gap: 1.15rem;
  min-height: calc(100dvh - var(--pt-topbar-height) - 4.5rem);
  min-width: 0;
  max-width: 100%;
}

.pt-workspace-grid > * {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1279.98px) {
  .pt-workspace-grid {
    grid-template-columns: 240px 1fr;
  }
  .pt-workspace-draft-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 991.98px) {
  .pt-workspace-grid {
    display: flex;
    flex-direction: column;
    min-height: auto;
    gap: 1rem;
  }
  .pt-workspace-sessions-col {
    order: 1;
  }
  .pt-workspace-chat-col {
    order: 2;
  }
  .pt-workspace-draft-col {
    order: 3;
  }
  #wsDraftBox {
    min-height: 200px;
    max-height: 400px;
  }
}

.pt-chat-scroll {
  max-height: 55dvh;
  min-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 767.98px) {
  .pt-chat-scroll {
    max-height: 48dvh;
    min-height: 240px;
    padding: 0.75rem;
    gap: 0.75rem;
  }
}

.pt-msg-bubble {
  max-width: 88%;
  padding: 0.9rem 1.05rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.pt-msg-bubble pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 0.5rem 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.82em;
}

.pt-msg-bubble code {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.pt-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #6d5dfc 0%, #7c3aed 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
.pt-msg-assistant {
  align-self: flex-start;
  background: var(--pt-bg-elevated);
  border: 1px solid var(--pt-border);
  color: var(--pt-text-primary);
  border-bottom-left-radius: 4px;
}

#wsMessageForm {
  min-width: 0;
  max-width: 100%;
}

#wsMessageForm textarea#wsInput {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
  resize: vertical;
}

#wsMessageForm #wsSendBtn {
  flex-shrink: 0;
}

#wsDraftBox {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  word-break: break-word;
  resize: vertical;
}

/* ============================================================================
   AUTH & LANDING PAGES
   ============================================================================ */
.pt-auth-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
.pt-auth-showcase {
  background: radial-gradient(circle at 20% 20%, rgba(109, 93, 252, 0.34), transparent 52%),
              radial-gradient(circle at 80% 80%, rgba(14, 165, 233, 0.20), transparent 50%),
              #0b1120;
  color: #f8fafc;
  padding: 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color-scheme: dark;
}
.pt-auth-form-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: var(--pt-bg-surface);
}
@media (max-width: 991.98px) {
  .pt-auth-shell {
    grid-template-columns: 1fr;
  }
  .pt-auth-showcase {
    display: none;
  }
}

/* ============================================================================
   LANDING NAVBAR & ZERO-OVERFLOW SAFEGUARDS
   ============================================================================ */
.pt-landing-nav {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.pt-landing-nav .container {
  padding-inline: 0.85rem;
}

@media (max-width: 575.98px) {
  .pt-landing-nav .container {
    padding-inline: 0.65rem;
  }
  .pt-landing-brand {
    gap: 0.45rem !important;
  }
  .pt-landing-brand .pt-logo-mark {
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
  }
  .pt-landing-brand .pt-brand-name {
    font-size: 0.98rem !important;
  }
  .pt-landing-actions {
    gap: 0.35rem !important;
  }
  .pt-landing-actions .pt-icon-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    padding: 0 !important;
  }
  .pt-landing-actions .btn {
    font-size: 0.76rem !important;
    padding: 0.32rem 0.55rem !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 379.98px) {
  .pt-landing-actions .pt-landing-signin {
    display: none !important;
  }
}

.pt-landing-hero {
  background: radial-gradient(ellipse at 50% 0%, rgba(109, 93, 252, 0.22), transparent 62%),
              linear-gradient(180deg, #090e1c 0%, #0f172a 100%);
  color: #f8fafc;
  color-scheme: dark;
}

/* ============================================================================
   PROMPT ACADEMY (YOUTUBE VIDEO MASTERCLASSES & CLICK-TO-PLAY FACADE)
   ============================================================================ */
.pt-line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  line-clamp: 1;
  overflow: clip;
}

.pt-line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: clip;
}

/* Auto-Fill Responsive Video Grid */
.pt-academy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 305px), 1fr));
  gap: 1.15rem;
}

.pt-video-card {
  display: flex;
  flex-direction: column;
  overflow: clip;
  height: 100%;
}

.pt-video-facade {
  position: relative;
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  background: #090e1c;
  overflow: clip;
  border-radius: var(--pt-radius-md);
  cursor: pointer;
}

.pt-video-card > .pt-video-facade {
  border-radius: 0;
  border-bottom: 1px solid var(--pt-border);
}

.pt-video-facade img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s ease, filter 0.28s ease;
}

.pt-video-facade:hover img,
.pt-video-facade-overlay:focus-visible + img {
  transform: scale(1.03);
  filter: brightness(0.88);
}

.pt-video-facade-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 14, 28, 0.12) 0%, rgba(9, 14, 28, 0.65) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  inline-size: 100%;
  padding: 0;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.pt-video-play-circle {
  inline-size: 54px;
  block-size: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6d5dfc 0%, #7c3aed 100%);
  box-shadow: 0 10px 28px rgba(109, 93, 252, 0.52), 0 0 0 5px rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pt-video-facade:hover .pt-video-play-circle,
.pt-video-facade-overlay:focus-visible .pt-video-play-circle {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(109, 93, 252, 0.68), 0 0 0 7px rgba(255, 255, 255, 0.26);
}

.pt-video-duration-pill {
  position: absolute;
  inset-block-end: 10px;
  inset-inline-end: 10px;
  background: rgba(9, 14, 28, 0.88);
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.16rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
  z-index: 2;
}

.pt-video-featured-ribbon {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  background: linear-gradient(135deg, #6d5dfc 0%, #7c3aed 100%);
  color: #ffffff;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.54rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(109, 93, 252, 0.38);
  pointer-events: none;
  z-index: 2;
}

.pt-video-facade iframe,
.pt-cinema-stage iframe {
  inline-size: 100%;
  block-size: 100%;
  border: 0;
  display: block;
}

.pt-cinema-stage {
  position: relative;
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  background: #050811;
  border-radius: 12px;
  overflow: clip;
}

/* Learning Track Filter Pills (Balanced wrap on Desktop, smooth horizontal rail on Mobile) */
.pt-track-pills {
  display: flex;
  flex-wrap: wrap;
  flex-wrap: balance;
  gap: 0.45rem;
}

@media (max-width: 639.98px) {
  .pt-track-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding-block-end: 0.2rem;
  }
  .pt-track-pills::-webkit-scrollbar {
    display: none;
  }
}

.pt-track-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.4rem 0.82rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--pt-bg-surface);
  color: var(--pt-text-secondary);
  border: 1px solid var(--pt-border);
  text-decoration: none;
  transition: all 0.16s ease;
}

.pt-track-pill:hover {
  border-color: var(--pt-brand);
  color: var(--pt-brand);
  background: var(--pt-brand-soft);
}

.pt-track-pill.active {
  background: linear-gradient(135deg, #6d5dfc 0%, #7c3aed 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(109, 93, 252, 0.25);
}

.pt-track-pill-count {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  padding: 0.08rem 0.42rem;
  border-radius: 6px;
  background: rgba(127, 127, 150, 0.16);
}

.pt-track-pill.active .pt-track-pill-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* ============================================================================
   ADMIN ACADEMY CURATOR TABLE & RESPONSIVE STACKED CARDS
   ============================================================================ */
.pt-admin-thumb {
  position: relative;
  inline-size: 124px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: clip;
  background: #090e1c;
  border: 1px solid var(--pt-border);
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  display: block;
}
.pt-admin-thumb img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.22s ease, filter 0.22s ease;
}
.pt-admin-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 14, 28, 0.28);
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.pt-admin-thumb:hover img,
.pt-admin-thumb:focus-visible img {
  transform: scale(1.04);
  filter: brightness(0.84);
}
.pt-admin-thumb:hover .pt-admin-thumb-play,
.pt-admin-thumb:focus-visible .pt-admin-thumb-play {
  opacity: 1;
}
.pt-admin-thumb-dur {
  position: absolute;
  inset-block-end: 4px;
  inset-inline-end: 4px;
  padding: 0.08rem 0.36rem;
  font-size: 0.65rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border-radius: 4px;
  color: #f8fafc;
  background: rgba(9, 14, 28, 0.88);
  line-height: 1.3;
}

.pt-video-meta-col {
  min-inline-size: 0;
  flex: 1 1 auto;
}

/* Structured Single-Line Track Chip (replaces multi-line oval pill) */
.pt-track-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  max-inline-size: 235px;
  padding: 0.28rem 0.62rem;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--pt-brand);
  background: var(--pt-brand-soft);
  border: 1px solid rgba(109, 93, 252, 0.22);
  white-space: nowrap;
}
.pt-track-chip-text {
  overflow: clip;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Single-Line Companion Prompt Tag */
.pt-paired-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  max-inline-size: min(100%, 310px);
  padding: 0.16rem 0.5rem;
  border-radius: 6px;
  font-size: 0.71rem;
  font-weight: 500;
  color: var(--pt-text-secondary);
  background: var(--pt-bg-elevated);
  border: 1px solid var(--pt-border);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.pt-paired-tag:hover {
  border-color: var(--pt-brand);
  color: var(--pt-brand);
}
.pt-paired-tag-text {
  overflow: clip;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status Indicator Dot Badge */
.pt-status-dot {
  inline-size: 6px;
  block-size: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Precision Single-Row Action Bar (never wraps into 2 lopsided rows) */
.pt-action-bar {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.34rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.pt-action-bar form {
  margin: 0;
  display: inline-flex;
}
.pt-action-btn {
  inline-size: 32px;
  block-size: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--pt-border);
  background: var(--pt-bg-elevated);
  color: var(--pt-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.pt-action-btn:hover,
.pt-action-btn:focus-visible {
  border-color: var(--pt-brand);
  color: var(--pt-brand);
  background: var(--pt-brand-soft);
}
.pt-action-btn.is-featured {
  color: #d97706;
  background: rgba(245, 158, 11, 0.13);
  border-color: rgba(245, 158, 11, 0.34);
}
.pt-action-btn.is-featured:hover {
  background: rgba(245, 158, 11, 0.22);
  color: #b45309;
}
.pt-action-btn-danger:hover,
.pt-action-btn-danger:focus-visible {
  border-color: rgba(239, 68, 68, 0.45);
  color: #ef4444;
  background: rgba(239, 68, 68, 0.11);
}

.pt-cell-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
}

.pt-academy-table > tbody > tr > th {
  min-inline-size: 310px;
  max-inline-size: 430px;
}

/* Container-Query Responsive Transformation for Media-Rich Academy Table (< 880px) */
@container (inline-size < 880px) {
  .pt-academy-table,
  .pt-academy-table thead,
  .pt-academy-table tbody,
  .pt-academy-table tr,
  .pt-academy-table th,
  .pt-academy-table td {
    display: block;
  }

  .pt-academy-table thead {
    display: none;
  }

  .pt-academy-table tbody tr {
    margin-block-end: 0.9rem;
    border: 1px solid var(--pt-border);
    border-radius: 14px;
    overflow: clip;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  }
  .pt-academy-table tbody tr:last-child {
    margin-block-end: 0;
  }

  .pt-academy-table > tbody > tr > th {
    position: static;
    min-inline-size: 0;
    max-inline-size: none;
    background: var(--pt-bg-elevated);
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--pt-border);
  }

  .pt-academy-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: safe center;
    gap: 0.85rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--pt-border);
    text-align: end;
  }
  .pt-academy-table tbody tr td:last-child {
    border-bottom: 0;
    background: var(--pt-bg-surface);
  }

  .pt-academy-table tbody td::before {
    font-size: 0.71rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pt-text-secondary);
    text-align: start;
    flex-shrink: 0;
  }
  .pt-academy-table tbody td:nth-child(2)::before {
    content: var(--label-2, "Track");
  }
  .pt-academy-table tbody td:nth-child(3)::before {
    content: var(--label-3, "Taxonomy");
  }
  .pt-academy-table tbody td:nth-child(4)::before {
    content: var(--label-4, "Status");
  }
  .pt-academy-table tbody td:nth-child(5)::before {
    content: var(--label-5, "Actions");
  }

  .pt-academy-table .pt-cell-stack {
    align-items: flex-end;
  }
  .pt-academy-table .pt-track-chip {
    max-inline-size: 220px;
  }
}

@container (inline-size < 460px) {
  .pt-academy-table .pt-admin-media-row {
    flex-direction: column;
    align-items: stretch !important;
  }
  .pt-academy-table .pt-admin-thumb {
    inline-size: 100%;
  }
  .pt-academy-table .pt-action-btn {
    inline-size: 36px;
    block-size: 36px;
  }
}

/* ============================================================================
   WHATSAPP INTEGRATION & DEVELOPER FOOTER ATTRIBUTION
   ============================================================================ */
.pt-whatsapp-icon-link {
  color: #25d366;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
  transition: transform 0.16s ease, filter 0.16s ease;
  vertical-align: middle;
}

.pt-whatsapp-icon-link:hover {
  transform: scale(1.18);
  filter: brightness(1.1);
  color: #25d366 !important;
}

.pt-whatsapp-icon-link:focus-visible {
  outline: 2px solid #25d366;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================================
   PLATFORM LOGO & BRANDING ASSETS
   ============================================================================ */
img.pt-logo-mark,
.pt-sidebar-brand img,
.pt-landing-brand img,
.pt-auth-brand img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}



