/* ════════════════════════════════════════════════════════════
   Assistant Charlie — Page démo DS Tickets Service
   Inspiration visuelle : portail tickets.digisense.fr (jarvis.css)
   ════════════════════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body.dts-body {
  margin: 0;
  min-height: 100vh;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Ubuntu,
    "Helvetica Neue",
    sans-serif;
  color: #e8f0ff;
  background: #06080f;
  overflow-x: hidden;
}

@keyframes dtsFadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dtsScan {
  0% {
    transform: translateY(-4px);
    opacity: 0;
  }
  12% {
    opacity: 0.55;
  }
  88% {
    opacity: 0.35;
  }
  100% {
    transform: translateY(720px);
    opacity: 0;
  }
}

@keyframes dtsPulse {
  0%,
  100% {
    transform: scale(0.78);
    opacity: 0.45;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes dtsSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes dtsPop {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Grille futuriste + vignette */
.dts-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px clamp(14px, 3vw, 40px) 48px;
  isolation: isolate;
}

.dts-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 120% 80% at 10% -10%, rgba(58, 160, 255, 0.12), transparent 45%),
    radial-gradient(circle at 88% 8%, rgba(99, 102, 241, 0.1), transparent 38%),
    linear-gradient(180deg, #0a1020 0%, #06080f 40%, #04060c 100%);
  pointer-events: none;
}

.dts-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 40%, transparent 100%);
  pointer-events: none;
  opacity: 0.85;
}

.dts-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  z-index: 5;
  background: linear-gradient(90deg, transparent, rgba(58, 160, 255, 0.5), transparent);
  animation: dtsScan 6s linear infinite;
  pointer-events: none;
}

/* Carte principale */
.dts-card {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: visible;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(155deg, rgba(8, 22, 52, 0.94) 0%, rgba(4, 12, 28, 0.96) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 34px 90px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: dtsFadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}

.dts-corner {
  position: absolute;
  width: 48px;
  height: 48px;
  z-index: 6;
  border: 1.5px solid rgba(58, 160, 255, 0.45);
  opacity: 0.55;
  pointer-events: none;
}

.dts-corner--tl {
  top: 12px;
  left: 12px;
  border-right: none;
  border-bottom: none;
  border-radius: 9px 0 0 0;
}

.dts-corner--br {
  bottom: 12px;
  right: 12px;
  border-left: none;
  border-top: none;
  border-radius: 0 0 9px 0;
}

/* Colonne avatar */
.dts-avatar-col {
  width: clamp(260px, 32vw, 360px);
  min-width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: max(14px, env(safe-area-inset-top));
  align-self: flex-start;
  max-height: calc(100vh - 36px);
  overflow: visible;
  padding: clamp(14px, 2.5vw, 28px) 12px clamp(22px, 3vw, 36px);
  border-right: 1px solid rgba(58, 160, 255, 0.18);
  background: linear-gradient(180deg, rgba(4, 12, 34, 0.65), rgba(2, 8, 22, 0.88));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
}

.dts-video-wrap {
  position: relative;
  width: min(300px, 78vw);
  height: min(300px, 78vw);
  display: grid;
  place-items: center;
  overflow: visible;
  flex-shrink: 0;
}

.dts-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(58, 160, 255, 0.2);
  pointer-events: none;
}

.dts-ring--1 {
  width: min(274px, 72vw);
  height: min(274px, 72vw);
  animation: dtsSpin 13s linear infinite;
}

.dts-ring--2 {
  width: min(296px, 78vw);
  height: min(296px, 78vw);
  animation: dtsSpin 17s linear infinite reverse;
  border-color: rgba(99, 102, 241, 0.12);
}

.dts-ring--3 {
  width: min(252px, 66vw);
  height: min(252px, 66vw);
  animation: dtsSpin 9s linear infinite;
  border-color: rgba(58, 160, 255, 0.06);
}

.dts-video {
  position: absolute;
  inset: auto;
  width: min(264px, 68vw);
  height: min(264px, 68vw);
  border-radius: 50%;
  object-fit: contain;
  background: radial-gradient(circle at 50% 40%, rgba(30, 50, 90, 0.45), rgba(4, 8, 16, 0.95));
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(58, 160, 255, 0.12);
}

.dts-video.is-active {
  opacity: 1;
  position: relative;
  z-index: 3;
}

.dts-caption {
  margin-top: 14px;
  text-align: center;
  padding: 0 8px;
}

.dts-context-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(180, 220, 255, 0.95);
  background: rgba(58, 120, 255, 0.12);
  border: 1px solid rgba(58, 160, 255, 0.35);
}

.dts-context-pill .dts-dot-pill {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}

.dts-caption-sub {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(200, 220, 255, 0.62);
}

.dts-logo-mark {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.dts-logo-img {
  height: 22px;
  width: auto;
  filter: drop-shadow(0 0 14px rgba(58, 160, 255, 0.45));
}

.dts-brand-tag {
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(58, 160, 255, 0.45);
  font-family:
    ui-monospace,
    "SF Mono",
    Menlo,
    monospace;
}

/* Colonne chat */
.dts-chat-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dts-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(14px, 2vw, 20px) clamp(16px, 2vw, 22px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.dts-brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dts-brand-lockup .dts-logo-img {
  height: 30px;
  margin: 0;
}

.dts-titles .dts-title-main {
  font-weight: 800;
  font-size: clamp(15px, 1.8vw, 17px);
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.dts-titles .dts-title-sub {
  margin-top: 3px;
  font-size: 12px;
  color: rgba(200, 220, 255, 0.6);
}

.dts-sys {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dts-sys-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  box-shadow:
    0 0 0 4px rgba(0, 230, 118, 0.12),
    0 0 14px rgba(0, 230, 118, 0.35);
  animation: dtsPulse 1.85s ease-in-out infinite;
}

.dts-sys-txt {
  font-size: 10px;
  letter-spacing: 0.13em;
  color: rgba(200, 220, 255, 0.5);
}

.dts-reset {
  margin-left: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.dts-reset:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.dts-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: clamp(340px, 52vh, 520px);
  padding: clamp(12px, 2vw, 18px) clamp(14px, 2.2vw, 22px) 14px;
}

.dts-intro {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(200, 220, 255, 0.76);
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(58, 120, 255, 0.06);
  border: 1px solid rgba(58, 160, 255, 0.14);
}

.dts-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.dts-chip {
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(220, 235, 255, 0.9);
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dts-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(58, 160, 255, 0.35);
  transform: translateY(-1px);
}

.dts-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 12px;
  scroll-behavior: smooth;
}

.dts-messages::-webkit-scrollbar {
  width: 6px;
}

.dts-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
}

.dts-msg {
  max-width: min(560px, 92%);
  border-radius: 16px;
  padding: 11px 14px;
  line-height: 1.55;
  font-size: 13.5px;
  animation: dtsPop 0.26s ease-out;
}

.dts-msg-user {
  align-self: flex-end;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.dts-msg-bot {
  align-self: flex-start;
  border: 1px solid rgba(58, 160, 255, 0.22);
  background: rgba(58, 120, 255, 0.1);
  color: rgba(215, 232, 255, 0.96);
}

.dts-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  padding: 12px 16px !important;
  border-radius: 16px !important;
  background: rgba(58, 120, 255, 0.08) !important;
  border-color: rgba(58, 160, 255, 0.16) !important;
}

@keyframes dtsBounceTyping {
  0%,
  60%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

.dts-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(58, 160, 255, 0.8);
  animation: dtsBounceTyping 1.15s ease-in-out infinite;
}

.dts-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.dts-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

.dts-err-msg {
  font-size: 12px;
  color: #ff9a9e;
  padding: 10px;
  margin-top: 4px;
  border-radius: 10px;
  background: rgba(255, 80, 100, 0.08);
  border: 1px solid rgba(255, 100, 120, 0.25);
}

.dts-live {
  min-height: 18px;
  font-size: 11px;
  color: rgba(200, 220, 255, 0.45);
  padding: 0 2px;
}

/* Composer */
.dts-composer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: clamp(11px, 1.8vw, 14px) clamp(14px, 2.2vw, 22px) clamp(14px, 2.5vw, 18px);
  background: rgba(255, 255, 255, 0.02);
}

.dts-grid-inputs {
  display: grid;
  gap: 8px;
}

.dts-hidden-visually {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dts-attach-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dts-clip-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(58, 160, 255, 0.4);
  background: rgba(58, 120, 255, 0.12);
  color: rgba(200, 230, 255, 0.95);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.dts-clip-btn:hover {
  background: rgba(58, 140, 255, 0.22);
  border-color: rgba(90, 180, 255, 0.65);
  transform: translateY(-1px);
}

.dts-file-hint {
  font-size: 12px;
  color: rgba(200, 220, 255, 0.48);
}

.dts-file-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

.dts-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(58, 120, 255, 0.12);
  border: 1px solid rgba(58, 160, 255, 0.25);
  color: rgba(215, 232, 255, 0.92);
}

.dts-file-chip button {
  border: none;
  background: transparent;
  color: rgba(255, 180, 180, 0.95);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 4px;
}

.dts-recap-wrap {
  margin: 12px 0 4px 2px;
}

.dts-confirm-prompt {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: rgba(230, 242, 255, 0.95);
  line-height: 1.35;
}

.dts-recap-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.dts-urgency-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 4px 2px;
}

.dts-btn-urgency {
  border-radius: 12px;
  border: 1px solid rgba(58, 160, 255, 0.45);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  background: rgba(58, 120, 255, 0.22);
  transition:
    background 0.15s,
    border-color 0.15s;
}

.dts-btn-urgency:hover {
  background: rgba(58, 160, 255, 0.38);
  border-color: rgba(100, 190, 255, 0.55);
}

.dts-btn-confirm {
  border-radius: 12px;
  border: none;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #1a6cd4, #22c997);
  box-shadow: 0 8px 24px rgba(34, 201, 151, 0.25);
}

.dts-btn-modify {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  color: rgba(220, 235, 255, 0.95);
  background: rgba(255, 255, 255, 0.06);
}

.dts-field-label {
  font-size: 11px;
  color: rgba(200, 220, 255, 0.45);
}

.dts-input-site {
  width: 100%;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.dts-input-site:focus {
  border-color: rgba(58, 160, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(58, 160, 255, 0.15);
}

.dts-hidden {
  display: none !important;
}

.dts-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.dts-textarea {
  flex: 1;
  min-height: 52px;
  max-height: 140px;
  resize: vertical;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.95);
  color: #0b1224;
  padding: 12px 15px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  line-height: 1.5;
}

.dts-textarea::placeholder {
  color: rgba(18, 28, 48, 0.82);
  font-weight: 500;
  opacity: 1;
}

.dts-textarea:focus {
  border-color: #3aa0ff;
  box-shadow: 0 0 0 4px rgba(58, 160, 255, 0.22);
}

.dts-send {
  flex-shrink: 0;
  min-width: 108px;
  border-radius: 14px;
  border: 1.5px solid rgba(100, 180, 255, 0.4);
  background: linear-gradient(135deg, #1a6cd4, #3aa0ff);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  padding: 0 16px;
  box-shadow: 0 8px 24px rgba(58, 160, 255, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dts-send:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(58, 160, 255, 0.45);
}

.dts-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.dts-help {
  margin: 14px 8px 4px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: rgba(210, 218, 235, 0.72);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

@media (max-width: 760px) {
  .dts-card {
    flex-direction: column;
  }

  .dts-avatar-col {
    position: relative;
    top: auto;
    max-height: none;
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid rgba(58, 160, 255, 0.18);
    padding-bottom: 20px;
  }

  .dts-video-wrap {
    width: 200px;
    height: 200px;
  }

  .dts-ring--1 {
    width: 180px;
    height: 180px;
  }

  .dts-ring--2 {
    width: 195px;
    height: 195px;
  }

  .dts-ring--3 {
    width: 168px;
    height: 168px;
  }

  .dts-video {
    width: 174px;
    height: 174px;
  }

  .dts-main {
    min-height: 280px;
  }

  .dts-title-sub {
    display: none;
  }
}

/* ════════════════════════════════════════════════════════════
   Widget flottant (optionnel · compat ascendante)
   ════════════════════════════════════════════════════════════ */

.ds-tickets-chat-root{font-family:inherit;--bg:#13131a;--panel:#1c1c26;--text:#eaeaf0;--muted:#9b9baa;--accent:#6e8cff;--bubble-user:#2a3550}
.ds-tickets-launcher{
  position:fixed;bottom:20px;right:20px;z-index:99990;
  width:56px;height:56px;border-radius:999px;border:none;cursor:pointer;
  background:linear-gradient(145deg,var(--accent),#4f5dff);color:#fff;font-size:22px;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
}
.ds-tickets-panel{
  position:fixed;bottom:92px;right:20px;z-index:99991;width:380px;max-width:calc(100vw - 28px);height:520px;
  max-height:min(560px,calc(100vh - 120px));
  background:var(--panel);color:var(--text);border-radius:16px;box-shadow:0 22px 50px rgba(0,0,0,.5);
  display:flex;flex-direction:column;border:1px solid #2b2b38;overflow:hidden;
}
.ds-tickets-panel[hidden]{display:none!important;}
.ds-tickets-head{
  padding:12px 14px;background:linear-gradient(90deg,#232330,#1c1c26);font-size:14px;font-weight:600;display:flex;
  align-items:center;justify-content:space-between;border-bottom:1px solid #2b2b38;
}
.ds-tickets-head span{color:var(--muted);font-size:11px;font-weight:400}
.ds-tickets-messages{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:10px;background:var(--bg);}
.ds-msg{font-size:13px;line-height:1.45;padding:10px 12px;border-radius:12px;max-width:92%;white-space:pre-wrap;}
.ds-msg--bot{background:#262632;border:1px solid #323242;align-self:flex-start;color:var(--text);}
.ds-msg--user{background:var(--bubble-user);align-self:flex-end;color:var(--text);}
.ds-tickets-compose{display:flex;gap:8px;padding:10px;border-top:1px solid #2b2b38;background:var(--panel);}
.ds-tickets-compose input,.ds-tickets-compose textarea{font:inherit;color:var(--text);background:#12121a;border:1px solid #303042;border-radius:10px;padding:10px;width:100%;resize:none;min-height:44px;}
.ds-tickets-compose button{
  flex:0 0 auto;padding:10px 16px;border-radius:10px;border:none;font-weight:600;cursor:pointer;
  background:var(--accent);color:#fff;
}
.ds-tickets-compose button:disabled{opacity:.45;cursor:not-allowed}
.ds-tickets-meta{display:flex;gap:6px;margin-top:10px;font-size:11px;}
.ds-site-input{width:100%;font-size:12px;background:#12121a;border:1px solid #303042;border-radius:8px;color:var(--text);padding:6px 8px;}
.ds-muted{color:var(--muted)}
.ds-err{font-size:12px;color:#ff8f8f;padding:8px}
