:root {
  color-scheme: dark;
  font-family: Arial, "Noto Sans KR", sans-serif;
  background: #09111e;
  color: #e5edf7;
}
* { box-sizing: border-box; }
body { margin: 0; }
header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; padding: 22px 35px; background: #111e31;
  border-bottom: 1px solid #26384f;
}
h1 { margin: 0; color: #38bdf8; }
header p { margin: 7px 0 0; color: #94a3b8; }
.demo {
  font-size: 11px; color: #fbbf24;
  border: 1px solid #66532c; padding: 10px; border-radius: 8px;
}
main { max-width: 1500px; margin: auto; padding: 30px; }
.intro { margin-bottom: 25px; }
.intro h2 { margin-bottom: 8px; }
.intro p { color: #94a3b8; }
button {
  background: #0284c7; color: white; border: 0;
  border-radius: 8px; padding: 11px 18px; cursor: pointer;
}
.metrics, .panels {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 20px;
}
.panels { grid-template-columns: repeat(2, 1fr); }
article {
  background: #111e31; border: 1px solid #26384f;
  border-radius: 12px; padding: 22px;
}
article h3 { color: #94a3b8; font-size: 14px; }
article strong { font-size: 30px; color: #38bdf8; }
article h2 { font-size: 18px; margin-top: 0; }
.item {
  padding: 12px; margin: 8px 0; background: #18283d;
  border-radius: 8px; border-left: 3px solid #38bdf8;
  overflow-wrap: anywhere;
}
.item small { display: block; color: #94a3b8; margin-top: 5px; }
#errorMessage { color: #f87171; }
@media(max-width: 850px) {
  header { flex-direction: column; align-items: flex-start; }
  .metrics, .panels { grid-template-columns: 1fr; }
  main { padding: 16px; }
}

/* UIH Roo — Seven Intelligence Capabilities */
.intelligence-menu {
  margin-bottom: 24px;
  background: linear-gradient(135deg, #142b45, #101d30);
  border: 1px solid #326084;
  border-radius: 14px;
  overflow: hidden;
}

.intelligence-menu summary {
  padding: 20px 24px;
  color: #7dd3fc;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
}

.intelligence-menu summary:hover {
  background: rgba(56, 189, 248, 0.08);
}

.intelligence-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 24px 24px;
}

.intelligence-list > div {
  padding: 16px;
  background: #1b3048;
  border: 1px solid #35516b;
  border-radius: 10px;
  line-height: 1.6;
  color: #e2edf8;
}

@media (max-width: 800px) {
  .intelligence-list {
    grid-template-columns: 1fr;
  }
}

/* UIH Roo — Knowledge Intelligence Journey */
.knowledge-journey {
  margin-bottom: 26px;
  padding: 26px;
  background: linear-gradient(135deg, #142b45, #101d30);
  border: 1px solid #326084;
  border-radius: 16px;
}

.knowledge-journey > h2 {
  margin: 0 0 10px;
  color: #7dd3fc;
  font-size: 24px;
}

.knowledge-journey > p {
  color: #c4d5e7;
  margin-bottom: 22px;
}

.journey-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.journey-grid article {
  background: #192e46;
  border: 1px solid #35516b;
  border-radius: 12px;
  padding: 20px;
}

.journey-grid h3 {
  color: #f0f7ff;
  font-size: 17px;
  margin: 0 0 14px;
}

.journey-grid textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  background: #0d1b2e;
  color: #e5edf7;
  border: 1px solid #46627e;
  border-radius: 9px;
  padding: 12px;
  font: inherit;
  line-height: 1.6;
  margin-bottom: 12px;
}

.journey-grid button {
  width: 100%;
  font-weight: 700;
}

.journey-grid button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

#knowledgeRegisterResult,
#knowledgeReviewResult,
#inspectionEventResult,
#knowledgeActivationResult {
  margin-top: 14px;
  line-height: 1.7;
  color: #c8e6f8;
  overflow-wrap: anywhere;
}

@media (max-width: 850px) {
  .knowledge-journey { padding: 16px; }
  .journey-grid { grid-template-columns: 1fr; }
}

/* UIH Roo — Conversational Intelligence */
.roo-conversation {
  margin-bottom: 26px;
  padding: 24px;
  background: linear-gradient(135deg, #132b44, #0d1c30);
  border: 1px solid #36729b;
  border-radius: 16px;
}

.conversation-heading h2 {
  margin: 0 0 8px;
  color: #7dd3fc;
  font-size: 23px;
}

.conversation-heading p {
  color: #b9cfe2;
}

.roo-chat-messages {
  min-height: 140px;
  max-height: 330px;
  overflow-y: auto;
  padding: 16px;
  background: #0b192b;
  border-radius: 12px;
  margin: 18px 0;
}

.roo-message {
  padding: 13px 16px;
  border-radius: 11px;
  margin-bottom: 12px;
  line-height: 1.7;
  max-width: 90%;
  white-space: pre-wrap;
}

.roo-message.assistant {
  background: #1c3952;
  border-left: 3px solid #38bdf8;
}

.roo-message.user {
  background: #284b3e;
  border-left: 3px solid #4ade80;
  margin-left: auto;
}

.roo-quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 15px;
}

.roo-quick-questions button {
  background: #25435d;
  border: 1px solid #426987;
  font-size: 13px;
}

.roo-chat-form {
  display: flex;
  gap: 10px;
}

.roo-chat-form input {
  flex: 1;
  min-width: 0;
  padding: 13px;
  border-radius: 9px;
  border: 1px solid #46627e;
  background: #0b192b;
  color: white;
  font-size: 15px;
}

.roo-chat-form button {
  white-space: nowrap;
}

#rooChatStatus {
  color: #fbbf24;
  min-height: 18px;
}

@media (max-width: 700px) {
  .roo-chat-form {
    flex-direction: column;
  }
}
