﻿:root {
  --bg-1: #f2efe8;
  --bg-2: #dee9f6;
  --surface: #ffffff;
  --line: #d3d8df;
  --text: #16202a;
  --muted: #5e6772;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --assistant: #eef6ff;
  --user: #123b66;
  --user-ink: #f5f9ff;
  --danger: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Pretendard", "Noto Sans KR", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 600px at 0% -5%, #fff1df 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #d9f0ff 0%, transparent 55%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
}

.app-shell {
  max-width: 980px;
  margin: 22px auto;
  padding: 16px;
  display: grid;
  gap: 14px;
}

.topbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

h1 {
  margin: 0;
  font-size: 26px; letter-spacing: -0.2px;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(135deg, #0f766e, #0b8f83);
  color: var(--brand-ink);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.28);
}

.btn.ghost {
  background: #f6f7f9;
  color: var(--text);
  border-color: var(--line);
}

.btn.icon {
  background: #f8f9fb;
  border-color: var(--line);
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.btn.tiny {
  background: #f7f7f7;
  border-color: var(--line);
  padding: 6px 9px;
  font-size: 12px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #9ca3af;
}

.status-dot.connected {
  background: #16a34a;
}

.status-dot.error {
  background: var(--danger);
}

.settings-panel,
.system-log-panel,
.chat-panel,
.composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(22, 32, 42, 0.06);
}

.hidden {
  display: none !important;
}

.settings-panel h2,
.system-log-panel h2 {
  margin: 0;
  font-size: 15px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.chat {
  height: 460px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fafc 0%, #f3f6fb 100%);
}

.message {
  max-width: 78%;
  padding: 11px 13px;
  border-radius: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.message.user {
  align-self: flex-end;
  background: var(--user);
  color: var(--user-ink);
  border-bottom-right-radius: 5px;
  box-shadow: 0 8px 16px rgba(18, 59, 102, 0.15);
}

.message.assistant {
  align-self: flex-start;
  background: var(--assistant);
  color: #0f172a;
  border-bottom-left-radius: 5px;
  border: 1px solid #d7e7ff;
}

.message-meta {
  font-size: 11px;
  opacity: 0.75;
  margin-bottom: 4px;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.system-log {
  margin-top: 8px;
  max-height: 150px;
  overflow: auto;
  background: #0b1220;
  color: #cdd7e5;
  border-radius: 10px;
  padding: 9px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.log-entry {
  margin-bottom: 6px;
}

.composer {
  display: grid;
  gap: 8px;
}

.composer-row {
  display: flex;
  gap: 8px;
}

#questionInput {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
}

.image-preview-wrap {
  display: flex;
  justify-content: flex-end;
}

.image-preview {
  max-width: 180px;
  max-height: 120px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
}

@media (max-width: 760px) {
  .app-shell {
    margin: 0;
    padding: 10px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .message {
    max-width: 90%;
  }

  .composer-row {
    flex-wrap: wrap;
  }

  #questionInput {
    min-width: 100%;
  }
}



