/* OBK KI – aligned with site.css */
body.page-ki {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.page-ki .ki-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-ki .page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 22px 32px;
}

.chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: calc(100vh - 200px);
  border: 1px solid var(--line, rgba(199, 139, 74, 0.28));
  border-radius: 14px;
  background: var(--bg-panel, rgba(16, 18, 20, 0.88));
  box-shadow: var(--shadow, 0 24px 60px rgba(0, 0, 0, 0.45));
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line, rgba(199, 139, 74, 0.28));
  background: rgba(8, 8, 8, 0.72);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(199, 139, 74, 0.35);
  background: rgba(199, 139, 74, 0.1);
  color: #c78b4a;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.chat-title {
  margin: 0;
  color: #c78b4a;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chat-subtitle {
  margin: 4px 0 0;
  color: #9aa6b2;
  font-size: 12px;
  line-height: 1.4;
}

.ctx-badge {
  display: none;
  margin-top: 8px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(199, 139, 74, 0.28);
  background: rgba(199, 139, 74, 0.1);
  color: #e0ad72;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-pill,
.ki-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(199, 139, 74, 0.28);
  background: rgba(199, 139, 74, 0.08);
  color: #c78b4a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.status-pill {
  cursor: default;
  border-color: rgba(46, 204, 113, 0.28);
  background: rgba(46, 204, 113, 0.08);
  color: #2ecc71;
}

.sdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ecc71;
}

.ki-tool-btn:hover {
  background: rgba(199, 139, 74, 0.18);
  color: #fff;
}

.chat-msgs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  overflow-y: auto;
}

.msg {
  max-width: min(720px, 92%);
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.65;
  color: #e8eef4;
}

.msg.ai {
  align-self: flex-start;
  background: rgba(10, 12, 14, 0.92);
  border: 1px solid rgba(199, 139, 74, 0.16);
}

.msg.ai strong { color: #c78b4a; }
.msg.ai code {
  background: rgba(199, 139, 74, 0.12);
  color: #7fc8f8;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.msg.user {
  align-self: flex-end;
  background: rgba(199, 139, 74, 0.14);
  border: 1px solid rgba(199, 139, 74, 0.35);
}

.msg.fallback-info {
  align-self: flex-start;
  background: rgba(232, 149, 46, 0.08);
  border: 1px solid rgba(232, 149, 46, 0.28);
  color: #e8b86d;
  font-size: 13px;
}

.typing {
  display: none;
  align-self: flex-start;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(199, 139, 74, 0.16);
  color: #c78b4a;
  font-size: 12px;
}

.quick-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 22px 12px;
}

.qbtn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(199, 139, 74, 0.28);
  background: rgba(199, 139, 74, 0.08);
  color: #c78b4a;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.qbtn:hover {
  background: rgba(199, 139, 74, 0.18);
  color: #fff;
}

.qbtn.sm { font-size: 12px; }
.qbtn.back {
  color: #9aa6b2;
  border-color: rgba(255, 255, 255, 0.12);
  background: transparent;
}

.welcome-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  padding: 4px 0 8px;
}

.wcard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 18px 16px;
  border-radius: 12px;
  border: 1px solid rgba(199, 139, 74, 0.22);
  background: rgba(8, 8, 8, 0.55);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.wcard:hover {
  border-color: #c78b4a;
  transform: translateY(-1px);
}

.wcard-title {
  color: #c78b4a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wcard-desc {
  color: #9aa6b2;
  font-size: 13px;
  line-height: 1.5;
}

.wcard-arrow {
  margin-top: 4px;
  color: #c78b4a;
  font-size: 16px;
}

.input-area {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(199, 139, 74, 0.18);
  background: rgba(8, 8, 8, 0.55);
}

.chat-input {
  flex: 1;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0a0a0a;
  color: #e8eef4;
  font-size: 14px;
  outline: none;
}

.chat-input:focus {
  border-color: rgba(199, 139, 74, 0.55);
}

.chat-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.send-btn {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 10px;
  border: 0;
  background: #c78b4a;
  color: #041018;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.send-btn svg { fill: #041018; }
.send-btn:hover { background: #58b0ea; }
.send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Videos modal */
.vid-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.vid-overlay.open { display: flex; }
.vid-modal {
  width: 100%;
  max-width: 860px;
  border-radius: 14px;
  border: 1px solid rgba(199, 139, 74, 0.22);
  background: #101214;
  overflow: hidden;
}
.vid-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(199, 139, 74, 0.2);
}
.vid-modal-title {
  color: #e8eef4;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.vid-modal-title span {
  color: #9aa6b2;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 8px;
}
.vid-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #9aa6b2;
  cursor: pointer;
}
.vid-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vid-item {
  border: 1px solid rgba(199, 139, 74, 0.18);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(8, 8, 8, 0.55);
}
.vid-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.vid-play-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(199, 139, 74, 0.3);
  background: rgba(199, 139, 74, 0.12);
  color: #c78b4a;
  font-size: 12px;
}
.vid-item-name { color: #e8eef4; font-size: 13px; font-weight: 600; }
.vid-item-meta { color: #9aa6b2; font-size: 11px; margin-top: 3px; }
.vid-item-arrow { margin-left: auto; color: #c78b4a; }
.vid-player-wrap { display: none; padding: 0 14px 14px; }
.vid-item.playing .vid-player-wrap { display: block; }
.vid-player-wrap video {
  width: 100%;
  max-height: 480px;
  border-radius: 10px;
  background: #000;
}

@media (max-width: 700px) {
  .welcome-cards { grid-template-columns: 1fr; }
  .page-ki .page-wrapper { padding: 12px 12px 20px; }
  .chat-container { min-height: calc(100vh - 160px); }
  .status-pill { display: none; }
}
