/* KAKHA'S RC — AI assistant widget */
.krc-ai { --ai-w: 380px; position: fixed; right: 20px; bottom: 20px; z-index: 290; font-family: var(--font-body); }
.krc-ai__fab { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--gold, #F20D24); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 30px -8px rgba(242, 13, 36, .7), 0 2px 6px rgba(0, 0, 0, .4); transition: transform .2s var(--ease), background-color .2s; }
.krc-ai__fab:hover { background: #FF263B; transform: scale(1.05); }
.krc-ai__fab-dot { position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: #16D879; border: 2px solid #0b0d10; }
.krc-ai.is-open .krc-ai__fab { display: none; }
.krc-ai.is-open { z-index: 1200; }
.krc-ai__panel { position: absolute; right: 0; bottom: 0; width: var(--ai-w); max-width: calc(100vw - 24px); height: min(620px, calc(100vh - 110px)); display: flex; flex-direction: column; background: #0d1013; border: 1px solid #2B3036; border-radius: 16px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .85); overflow: hidden; animation: krc-ai-in .22s var(--ease); }
.krc-ai__panel[hidden] { display: none; }
@keyframes krc-ai-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.krc-ai__head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: #111518; border-bottom: 1px solid #2B3036; }
.krc-ai__avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold, #F20D24); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 18px; flex: none; }
.krc-ai__title { flex: 1; min-width: 0; line-height: 1.2; }
.krc-ai__title b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.krc-ai__title small { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: #858B92; }
.krc-ai__title small i { width: 7px; height: 7px; border-radius: 50%; background: #16D879; }
.krc-ai__ib { width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: #B8BDC3; display: grid; place-items: center; cursor: pointer; }
.krc-ai__ib:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.krc-ai__log { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.krc-ai__msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.55; color: #F5F5F5; word-wrap: break-word; }
.krc-ai__msg--model { align-self: flex-start; background: #171B1F; border: 1px solid #2B3036; border-bottom-left-radius: 4px; }
.krc-ai__msg--user { align-self: flex-end; background: var(--gold, #F20D24); color: #fff; border-bottom-right-radius: 4px; }
.krc-ai__msg ul { margin: 6px 0; padding-left: 18px; }
.krc-ai__msg li { margin: 2px 0; }
.krc-ai__typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.krc-ai__typing i { width: 7px; height: 7px; border-radius: 50%; background: #858B92; animation: krc-ai-dot 1s infinite; }
.krc-ai__typing i:nth-child(2) { animation-delay: .15s; } .krc-ai__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes krc-ai-dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.krc-ai__cards { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.krc-ai__card { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; background: #0d1013; border: 1px solid #2B3036; color: #F5F5F5; text-decoration: none; transition: border-color .15s; }
.krc-ai__card:hover { border-color: var(--gold, #F20D24); }
.krc-ai__card img { width: 56px; height: 42px; object-fit: contain; border-radius: 6px; background: #fff; flex: none; }
.krc-ai__card span { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.krc-ai__card b { font-size: 12.5px; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.krc-ai__card em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--gold, #F20D24); margin-top: 2px; }
.krc-ai__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.krc-ai__chips[hidden] { display: none; }
.krc-ai__chip { padding: 6px 11px; border-radius: 999px; border: 1px solid #2B3036; background: #111518; color: #D5D9DD; font-size: 12.5px; cursor: pointer; }
.krc-ai__chip:hover { border-color: var(--gold, #F20D24); color: #fff; }
.krc-ai__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid #2B3036; background: #111518; }
.krc-ai__form textarea { flex: 1; min-height: 42px; max-height: 120px; padding: 10px 12px !important; border: 1px solid #2B3036 !important; border-radius: 10px; background: #0d1013 !important; color: #F5F5F5; font: inherit; font-size: 14px; line-height: 1.4; resize: none; outline: none; }
.krc-ai__form textarea:focus { border-color: var(--gold, #F20D24) !important; box-shadow: 0 0 0 3px rgba(242, 13, 36, .18); }
.krc-ai__send { width: 42px; height: 42px; flex: none; border-radius: 10px; border: 0; background: var(--gold, #F20D24); color: #fff; display: grid; place-items: center; cursor: pointer; }
.krc-ai__send:hover { background: #FF263B; } .krc-ai__send:disabled { opacity: .5; cursor: default; }
.krc-ai__foot { margin: 0; padding: 0 12px 10px; font-size: 10.5px; color: #858B92; background: #111518; text-align: center; }
@media (max-width: 560px) {
  .krc-ai { right: 12px; bottom: 12px; }
  .krc-ai.is-open { inset: 0; }
  .krc-ai__panel { position: fixed; inset: 0; width: auto; max-width: none; height: auto; border-radius: 0; border: 0; }
}
