:root {
  color-scheme: dark;
  --bg: #070a0c;
  --panel: #0d1114;
  --panel-2: #11171b;
  --border: #20292f;
  --text: #eff7f5;
  --muted: #89979c;
  --green: #60f2c0;
  --green-dark: #173d32;
  --danger: #ff806f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 0%, #10231e 0, transparent 32%), var(--bg);
  color: var(--text);
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 10, 12, .84);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .12em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  color: #03100b; background: var(--green); letter-spacing: 0;
}
.account { color: var(--muted); font-size: 13px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 8px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: calc(100vh - 64px); }
.chat-panel { display: grid; grid-template-rows: auto 1fr auto auto; min-width: 0; }
.panel-heading { padding: 28px 36px 20px; display: flex; align-items: center; justify-content: space-between; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .16em; margin: 0 0 7px; }
h1 { font-size: 25px; margin: 0; letter-spacing: -.03em; }
.badge { padding: 7px 10px; border: 1px solid var(--border); border-radius: 99px; color: var(--muted); font-size: 12px; }
.badge.live { color: var(--green); border-color: #2f5c4d; background: rgba(96, 242, 192, .07); }

.messages { overflow-y: auto; padding: 12px max(36px, calc((100% - 900px) / 2)); }
.message { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; }
.message.user { flex-direction: row-reverse; }
.avatar { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; font-size: 10px; font-weight: 800; background: var(--green-dark); color: var(--green); }
.user .avatar { background: #222a30; color: #c5d0d4; }
.bubble { max-width: min(680px, 82%); padding: 13px 16px; border-radius: 4px 16px 16px 16px; background: var(--panel-2); border: 1px solid var(--border); line-height: 1.6; white-space: pre-wrap; font-size: 14px; }
.user .bubble { background: var(--green); color: #06130f; border: none; border-radius: 16px 4px 16px 16px; font-weight: 550; }
.tool-event { margin: -8px 40px 12px; color: var(--muted); font-size: 11px; }

.suggestions { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px max(36px, calc((100% - 900px) / 2)); }
.suggestions button { border: 1px solid var(--border); color: #b8c4c7; background: #0b0f12; border-radius: 99px; padding: 8px 12px; font-size: 12px; }
.suggestions button:hover { border-color: #3b5f54; color: var(--green); }
.composer { margin: 8px max(36px, calc((100% - 900px) / 2)) 28px; padding: 8px 8px 8px 16px; display: flex; gap: 10px; align-items: flex-end; border: 1px solid #2b353b; border-radius: 16px; background: #0e1316; box-shadow: 0 15px 50px #0008; }
.composer:focus-within { border-color: #4aa98a; }
.composer textarea { resize: none; flex: 1; max-height: 120px; border: 0; outline: 0; background: transparent; color: var(--text); padding: 9px 0; }
.composer button { width: 38px; height: 38px; border: 0; border-radius: 11px; background: var(--green); color: #06130f; font-size: 21px; }
.composer button:disabled { opacity: .45; cursor: wait; }

.sidebar { border-left: 1px solid var(--border); background: #090d0f; padding: 18px; overflow-y: auto; }
.side-card { background: var(--panel); border: 1px solid var(--border); border-radius: 15px; padding: 16px; margin-bottom: 14px; }
.side-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.side-heading h2 { font-size: 13px; margin: 0; }
.side-heading span { font-size: 11px; color: var(--green); }
.empty { color: var(--muted); font-size: 12px; }
.site-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 11px 0; border-top: 1px solid #1c2429; }
.site-row:first-child { border-top: 0; }
.site-name { font-size: 13px; font-weight: 650; }
.site-meta { color: var(--muted); font-size: 11px; grid-column: 1; }
.capacity { color: var(--green); font-size: 12px; grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.approval { padding: 12px; border-radius: 12px; background: #10181a; border: 1px solid #29483e; }
.approval + .approval { margin-top: 9px; }
.approval p { font-size: 12px; line-height: 1.5; margin: 0 0 10px; }
.approve { width: 100%; padding: 9px; border: 0; border-radius: 9px; background: var(--green); color: #05120e; font-weight: 750; font-size: 12px; }
.done { color: var(--green); font-size: 12px; }
.audit-item { padding: 9px 0; border-top: 1px solid #1c2429; }
.audit-item:first-child { border-top: 0; }
.audit-action { font-size: 11px; color: #c2cdd0; }
.audit-time { font-size: 10px; color: var(--muted); margin-top: 3px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .chat-panel { min-height: calc(100vh - 64px); }
  .sidebar { border-left: 0; border-top: 1px solid var(--border); }
  .panel-heading { padding-inline: 20px; }
  .messages, .suggestions { padding-inline: 20px; }
  .composer { margin-inline: 20px; }
  .account { display: none; }
}
