@layer components {
  /* ---- Demo support desk ---- */
  .demo-app.demo-support-desk {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #faf9f7;
    display: flex;
    flex-direction: column;
    font-family: var(--font-outfit);
    color: var(--color-ink-900);
  }

  .support-topbar {
    height: 48px;
    background: #ffffff;
    border-bottom: 1px solid #e7e5e4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
  }

  .support-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .support-brand {
    font-family: var(--font-outfit);
    font-size: 14px;
    font-weight: 700;
    color: #b45309;
    letter-spacing: -0.5px;
  }

  .support-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    background: #e8f9f0;
    color: #107c41;
    padding: 2px 6px;
    border-radius: 999px;
    font-weight: 500;
  }

  .support-status-dot {
    width: 6px;
    height: 6px;
    background: #107c41;
    border-radius: 50%;
    animation: support-pulse 2s infinite;
  }

  @keyframes support-pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
  }

  .support-search-wrapper {
    flex: 1;
    max-width: 320px;
    margin: 0 16px;
    position: relative;
  }

  .support-search {
    width: 100%;
    height: 30px;
    background: #faf9f7;
    border: 1px solid #e7e5e4;
    border-radius: 6px;
    padding: 0 10px 0 28px;
    font-size: 12px;
    color: var(--color-ink-900);
    outline: none;
    transition: all 0.15s ease;
  }

  .support-search:focus {
    background: #ffffff;
    border-color: #b45309;
    box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.18);
  }

  .support-search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #8c90a6;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .support-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .support-view-select {
    height: 30px;
    background: #ffffff;
    border: 1px solid #e7e5e4;
    border-radius: 6px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 500;
    color: #54545f;
    outline: none;
  }

  .support-btn-primary {
    height: 30px;
    background: #b45309;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background 0.15s ease;
  }

  .support-btn-primary:hover {
    background: #92400e;
  }

  .support-btn-secondary {
    height: 30px;
    background: #ffffff;
    border: 1px solid #b4530933;
    color: #b45309;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
  }

  .support-btn-secondary:hover {
    background: #fef3c7;
    border-color: #92400e;
  }

  .support-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    height: calc(100% - 48px);
    overflow: hidden;
  }

  @media (min-width: 768px) {
    .support-layout {
      grid-template-columns: 240px minmax(0, 1fr) 250px;
      gap: 0;
    }
  }

  .support-queue {
    background: #ffffff;
    border-right: 1px solid #e7e5e4;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  /* Horizontal queue for mobile */
  @media (max-width: 767px) {
    .support-queue {
      flex-direction: row;
      height: 70px;
      border-right: none;
      border-bottom: 1px solid #e7e5e4;
      overflow-x: auto;
      overflow-y: hidden;
      white-space: nowrap;
      flex-shrink: 0;
    }
  }

  .support-queue-header {
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #8c90a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f5f5f4;
  }

  @media (max-width: 767px) {
    .support-queue-header {
      display: none;
    }
  }

  .support-ticket-list {
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  @media (max-width: 767px) {
    .support-ticket-list {
      flex-direction: row;
    }
  }

  .support-ticket-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: #ffffff;
    border-bottom: 1px solid #f5f5f4;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: background 0.15s ease;
    border-left: 3px solid transparent;
  }

  @media (max-width: 767px) {
    .support-ticket-card {
      width: 160px;
      height: 100%;
      border-bottom: none;
      border-right: 1px solid #f5f5f4;
      flex-shrink: 0;
      padding: 6px 10px;
      justify-content: center;
    }
  }

  .support-ticket-card:hover {
    background: #fffbf5;
  }

  .support-ticket-card.is-active {
    background: #fef3c7;
    border-left-color: #b45309;
  }

  .support-ticket-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #8c90a6;
  }

  .support-ticket-id {
    font-weight: 600;
  }

  .support-ticket-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-ink-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .support-ticket-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
  }

  .support-ticket-customer {
    color: #54545f;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
  }

  .support-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
  }

  .support-badge.urgent {
    background: #fef2f2;
    color: #ef4444;
  }

  .support-badge.high {
    background: #fff7ed;
    color: #f97316;
  }

  .support-badge.medium {
    background: #eff6ff;
    color: #3b82f6;
  }

  .support-badge.low {
    background: #f3f4f6;
    color: #6b7280;
  }

  .support-main {
    background: #faf9f7;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .support-ticket-header {
    background: #ffffff;
    padding: 12px 16px;
    border-bottom: 1px solid #e7e5e4;
    flex-shrink: 0;
  }

  .support-ticket-title-large {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-ink-900);
    margin: 0 0 6px 0;
    line-height: 1.2;
  }

  .support-ticket-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 12px;
    font-size: 11px;
    color: #54545f;
  }

  @media (min-width: 480px) {
    .support-ticket-meta-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  @media (min-width: 900px) {
    .support-ticket-meta-grid {
      grid-template-columns: repeat(6, 1fr);
    }
  }

  .support-meta-item {
    display: flex;
    flex-direction: column;
  }

  .support-meta-label {
    color: #8c90a6;
    font-weight: 500;
    margin-bottom: 1px;
  }

  .support-meta-value {
    font-weight: 600;
  }

  .support-actions {
    background: #ffffff;
    border-bottom: 1px solid #e7e5e4;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
  }

  .support-action-btn {
    height: 28px;
    background: #ffffff;
    border: 1px solid #e7e5e4;
    border-radius: 4px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 500;
    color: #54545f;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.1s ease;
  }

  .support-action-btn:hover {
    background: #f5f5f4;
    border-color: #8c90a6;
    color: var(--color-ink-900);
  }

  .support-thread {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
  }

  .support-message {
    background: #ffffff;
    border: 1px solid #e7e5e4;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .support-message.is-internal {
    background: #fefce8;
    border-color: #fde047;
  }

  .support-message.is-agent {
    background: #fafaf9;
    border-color: #e7e5e4;
    align-self: flex-end;
    width: 90%;
  }

  .support-message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #8c90a6;
    border-bottom: 1px solid #f5f5f4;
    padding-bottom: 4px;
    margin-bottom: 2px;
  }

  .support-message.is-internal .support-message-header {
    border-bottom-color: #fef08a;
  }

  .support-sender {
    font-weight: 600;
    color: #54545f;
  }

  .support-time {
    font-size: 10px;
  }

  .support-message-body {
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--color-ink-900);
  }

  .support-composer {
    background: #ffffff;
    border-top: 1px solid #e7e5e4;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
  }

  .support-composer-label {
    font-size: 11px;
    font-weight: 700;
    color: #8c90a6;
    text-transform: uppercase;
  }

  .support-textarea-wrapper {
    position: relative;
  }

  .support-textarea {
    width: 100%;
    height: 60px;
    border: 1px solid #e7e5e4;
    border-radius: 6px;
    padding: 8px;
    font-size: 12px;
    outline: none;
    resize: none;
    font-family: inherit;
  }

  .support-textarea:focus {
    border-color: #b45309;
    box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.18);
  }

  .support-composer-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .support-composer-checkboxes {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #54545f;
  }

  .support-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
  }

  .support-composer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .support-side {
    background: #ffffff;
    border-left: 1px solid #e7e5e4;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  @media (max-width: 767px) {
    .support-side {
      display: none;
    }
  }

  .support-side-section {
    padding: 12px;
    border-bottom: 1px solid #f5f5f4;
  }

  .support-side-title {
    font-size: 11px;
    font-weight: 700;
    color: #8c90a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px 0;
  }

  .support-side-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
  }

  .support-side-row {
    display: flex;
    justify-content: space-between;
  }

  .support-side-label {
    color: #8c90a6;
  }

  .support-side-value {
    font-weight: 600;
    color: var(--color-ink-900);
  }

  .support-suggested-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .support-suggested-btn {
    text-align: left;
    background: #fafaf9;
    border: 1px solid #e7e5e4;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 11px;
    color: #b45309;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.1s ease;
  }

  .support-suggested-btn:hover {
    background: #fef3c7;
    border-color: #92400e;
  }

  .support-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
  }

  .support-field label {
    font-size: 10px;
    font-weight: 600;
    color: #8c90a6;
    text-transform: uppercase;
  }

  .support-input, .support-select {
    height: 28px;
    background: #ffffff;
    border: 1px solid #e7e5e4;
    border-radius: 4px;
    padding: 0 6px;
    font-size: 11px;
    color: var(--color-ink-900);
    outline: none;
  }

  .support-input:focus, .support-select:focus {
    border-color: #b45309;
  }

  .support-details {
    border: 1px solid #e7e5e4;
    border-radius: 6px;
    margin-bottom: 6px;
    overflow: hidden;
  }

  .support-details summary {
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #54545f;
    background: #fafaf9;
    cursor: pointer;
    user-select: none;
    outline: none;
  }

  .support-details[open] summary {
    border-bottom: 1px solid #e7e5e4;
  }

  .support-details-content {
    padding: 8px;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #ffffff;
  }

  /* ---- Interactive support desk elements ---- */
  .support-live-status {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    color: #92400e;
    background: #b453091a;
    padding: 2px 8px;
    border-radius: 999px;
    transition: all 0.2s ease;
    margin-left: 6px;
  }

  .support-macro-selected {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    color: #92400e;
    background: #b453091a;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    align-self: flex-start;
  }

  .support-escalation-panel,
  .support-automation-panel,
  .support-new-ticket-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 320px;
    background: #ffffff;
    border: 1px solid #e7e5e4;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 16px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .support-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-ink-900);
    margin: 0;
    border-bottom: 1px solid #f5f5f4;
    padding-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .support-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .support-panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
  }

  .support-ticket-card.is-escalated {
    border-left-color: #ef4444;
  }

}
