/* Extracted from app/Views/site/pages/custom_kit.php on 2026-06-09. Page CSS cached externally for performance. */

  /* Hero CTA accents */
  .ck-titan-cta {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 12px 32px rgba(139,92,246,.35), 0 4px 14px rgba(236,72,153,.22) !important;
    position: relative; overflow: hidden;
  }
  .ck-titan-cta::after {
    content: ''; position: absolute; top: -50%; left: -30%;
    width: 50%; height: 200%;
    background: linear-gradient(60deg, transparent, rgba(255,255,255,.25), transparent);
    transform: rotate(20deg);
    animation: ckTitanShine 3.6s ease-in-out infinite;
  }
  @keyframes ckTitanShine { 0%,60%,100% { left: -30%; } 80% { left: 130%; } }
  @keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
  .ck-titan-cta-sub {
    margin-left: 6px; font-size: .72em; font-weight: 600; opacity: .85;
  }
  @media (prefers-reduced-motion: reduce) { .ck-titan-cta::after { animation: none; } }

  /* Titan modal shell */
  #customKitTitanModal { position: fixed; inset: 0; z-index: 1400; display: none; }
  #customKitTitanModal.open { display: flex; align-items: center; justify-content: center; padding: 20px; }
  #customKitTitanModal .titan-backdrop {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at top, rgba(99,102,241,.18), rgba(15,23,42,.85));
    backdrop-filter: blur(8px);
  }
  #customKitTitanModal .titan-card {
    position: relative;
    width: min(720px, 100%);
    height: min(720px, calc(100vh - 40px));
    background: #0f172a;
    border: 1px solid rgba(99,102,241,.35);
    border-radius: 18px;
    box-shadow: 0 32px 96px rgba(0,0,0,.6), 0 0 0 1px rgba(139,92,246,.15) inset;
    display: flex; flex-direction: column; overflow: hidden;
  }
  /* Header */
  .titan-head {
    padding: 14px 18px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-bottom: 1px solid rgba(99,102,241,.3);
    display: flex; align-items: center; gap: 12px;
  }
  .titan-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
    box-shadow: 0 0 0 3px rgba(139,92,246,.2), 0 6px 18px rgba(139,92,246,.4);
    flex-shrink: 0;
    position: relative;
  }
  .titan-avatar::after {
    content: ''; position: absolute; bottom: 1px; right: 1px;
    width: 11px; height: 11px; border-radius: 50%;
    background: #22c55e; border: 2px solid #0f172a;
  }
  .titan-head-text { flex: 1; min-width: 0; }
  .titan-head-text strong { color: #fff; font-size: 1.05rem; font-weight: 700; display: block; line-height: 1.15; }
  .titan-head-text small { color: rgba(199,210,254,.7); font-size: .76rem; display: flex; align-items: center; gap: 5px; }
  .titan-head-text small::before {
    content: ''; display: inline-block; width: 6px; height: 6px;
    background: #22c55e; border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34,197,94,.5);
    animation: titan-pulse 2s ease-in-out infinite;
  }
  @keyframes titan-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 50% { box-shadow: 0 0 0 5px rgba(34,197,94,0); } }
  .titan-close {
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
    color: #fff; border-radius: 8px; width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: background .15s;
  }
  .titan-close:hover { background: rgba(255,255,255,.18); }

  /* Progress bar */
  .titan-progress {
    height: 4px; background: rgba(99,102,241,.15); overflow: hidden;
  }
  .titan-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
    transition: width .4s cubic-bezier(.4,0,.2,1);
  }
  .titan-step-label {
    padding: 6px 18px 0;
    font-size: .72rem; color: rgba(199,210,254,.6); font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase;
  }

  /* Chat body */
  .titan-body {
    flex: 1; overflow-y: auto; padding: 16px 18px;
    display: flex; flex-direction: column; gap: 12px;
    scrollbar-width: thin; scrollbar-color: rgba(139,92,246,.35) transparent;
  }
  .titan-body::-webkit-scrollbar { width: 6px; }
  .titan-body::-webkit-scrollbar-thumb { background: rgba(139,92,246,.35); border-radius: 999px; }

  .titan-msg {
    display: flex; gap: 10px; max-width: 92%;
    animation: titanIn .3s ease-out both;
  }
  @keyframes titanIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  .titan-msg.user { margin-left: auto; flex-direction: row-reverse; }
  .titan-msg-av {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
  }
  .titan-msg.assistant .titan-msg-av {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #fff;
  }
  .titan-msg.user .titan-msg-av {
    background: rgba(255,255,255,.1); color: #c7d2fe;
    border: 1px solid rgba(255,255,255,.15);
  }
  .titan-bubble {
    padding: 10px 14px; border-radius: 14px;
    font-size: .92rem; line-height: 1.5;
    word-wrap: break-word;
  }
  .titan-msg.assistant .titan-bubble {
    background: rgba(99,102,241,.12);
    border: 1px solid rgba(99,102,241,.25);
    color: #e0e7ff;
    border-top-left-radius: 4px;
  }
  .titan-msg.user .titan-bubble {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-top-right-radius: 4px;
  }
  .titan-msg.system .titan-bubble {
    background: rgba(34,197,94,.12);
    border: 1px solid rgba(34,197,94,.3);
    color: #bbf7d0;
    font-size: .85rem;
  }
  .titan-typing {
    display: inline-flex; gap: 4px; align-items: center; padding: 4px 0;
  }
  .titan-typing span {
    width: 6px; height: 6px; border-radius: 50%; background: #c7d2fe;
    animation: titan-dot 1.2s ease-in-out infinite both;
  }
  .titan-typing span:nth-child(2) { animation-delay: .18s; }
  .titan-typing span:nth-child(3) { animation-delay: .36s; }
  @keyframes titan-dot { 0%,80%,100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }

  /* Choice chips */
  .titan-choices {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
    padding-left: 42px;
  }
  .titan-chip {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(199,210,254,.25);
    color: #e0e7ff;
    border-radius: 10px;
    padding: 8px 13px;
    font-size: .85rem; font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit;
  }
  .titan-chip:hover {
    background: rgba(139,92,246,.2);
    border-color: rgba(139,92,246,.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139,92,246,.25);
  }
  .titan-chip.help {
    background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(236,72,153,.15));
    border-color: rgba(245,158,11,.4);
    color: #fde68a;
  }
  .titan-chip.help:hover {
    background: linear-gradient(135deg, rgba(245,158,11,.3), rgba(236,72,153,.3));
  }
  .titan-chip.skip {
    background: transparent; color: rgba(199,210,254,.6);
    border-color: rgba(199,210,254,.15);
  }
  .titan-chip.primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: #16a34a;
    color: #fff;
  }
  .titan-chip.primary:hover { background: linear-gradient(135deg, #16a34a, #15803d); }
  .titan-chip.multi.selected {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: #8b5cf6; color: #fff;
  }

  /* Footer / input */
  .titan-foot {
    padding: 12px 18px;
    border-top: 1px solid rgba(99,102,241,.25);
    background: rgba(15,23,42,.6);
  }
  .titan-input-row {
    display: flex; gap: 8px; align-items: flex-end;
  }
  .titan-input {
    flex: 1;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(199,210,254,.25);
    color: #e0e7ff;
    border-radius: 12px;
    padding: 10px 14px;
    font-family: inherit; font-size: .92rem;
    resize: none;
    min-height: 42px; max-height: 120px;
    transition: border-color .15s, box-shadow .15s;
  }
  .titan-input:focus {
    outline: none;
    border-color: rgba(139,92,246,.6);
    box-shadow: 0 0 0 3px rgba(139,92,246,.18);
  }
  .titan-input::placeholder { color: rgba(199,210,254,.4); }
  .titan-send {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #fff; border: none;
    border-radius: 12px; min-height: 42px; padding: 0 16px;
    font-weight: 700; font-size: .9rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: transform .15s, box-shadow .15s;
    font-family: inherit;
  }
  .titan-send:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(139,92,246,.4); }
  .titan-send:disabled { opacity: .5; cursor: not-allowed; transform: none; }

  /* Brief summary card (final step) */
  .titan-brief {
    background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(236,72,153,.06));
    border: 1px solid rgba(139,92,246,.3);
    border-radius: 14px;
    padding: 16px;
    margin-top: 8px;
  }
  .titan-brief h4 {
    margin: 0 0 12px;
    color: #fff; font-size: 1rem; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
  }
  .titan-brief-rows { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .titan-brief-row {
    display: grid; grid-template-columns: 130px 1fr auto;
    gap: 10px; align-items: center;
    padding: 8px 10px;
    background: rgba(15,23,42,.4);
    border: 1px solid rgba(99,102,241,.18);
    border-radius: 8px;
    font-size: .85rem;
  }
  .titan-brief-row-label { color: rgba(199,210,254,.6); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
  .titan-brief-row-value { color: #fff; font-weight: 600; }
  .titan-brief-row-edit {
    background: transparent; border: 1px solid rgba(199,210,254,.25);
    color: #c7d2fe; padding: 3px 9px; font-size: .7rem;
    border-radius: 6px; cursor: pointer;
    font-family: inherit;
  }
  .titan-brief-row-edit:hover { background: rgba(99,102,241,.15); border-color: rgba(139,92,246,.4); }

  .titan-recommend {
    background: linear-gradient(135deg, rgba(245,158,11,.1), rgba(236,72,153,.1));
    border: 1px solid rgba(245,158,11,.35);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 6px;
  }
  .titan-recommend strong { color: #fcd34d; font-weight: 700; display: block; margin-bottom: 4px; font-size: .82rem; }
  .titan-recommend p { color: #fde68a; font-size: .85rem; line-height: 1.5; margin: 0; }

  @media (max-width: 560px) {
    #customKitTitanModal { padding: 8px; }
    #customKitTitanModal .titan-card {
      height: calc(100vh - 16px);
      border-radius: 14px;
    }
    .titan-head { padding: 11px 13px; gap: 9px; }
    .titan-avatar { width: 38px; height: 38px; font-size: 18px; }
    .titan-head-text strong { font-size: .95rem; }
    .titan-body { padding: 12px 13px; gap: 10px; }
    .titan-choices { padding-left: 0; }
    .titan-brief-row { grid-template-columns: 1fr auto; }
    .titan-brief-row-label { grid-column: 1; }
    .titan-brief-row-value { grid-column: 1; }
    .titan-brief-row-edit { grid-column: 2; grid-row: 1 / 3; align-self: start; }
  }
