:root {
  --bg: #071018;
  --bg-2: #0d1b27;
  --ink: #e8f4f2;
  --muted: #8aa3a8;
  --line: rgba(90, 220, 200, 0.18);
  --accent: #3ef0d0;
  --accent-2: #7a6bff;
  --warn: #ffb45a;
  --danger: #ff6b7a;
  --glass: rgba(10, 24, 34, 0.72);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(122, 107, 255, 0.22), transparent 55%),
    radial-gradient(900px 500px at 110% 0%, rgba(62, 240, 208, 0.16), transparent 50%),
    var(--bg);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 75%);
  pointer-events: none;
}

.topbar, .layout, .dock { position: relative; z-index: 1; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041018; font-family: Syne, sans-serif; font-weight: 800;
}
.brand small { display: block; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 10px; align-items: center; }

.badge {
  border-radius: 999px; padding: 6px 12px; font-size: 12px;
  border: 1px solid var(--line); background: rgba(0,0,0,.25);
}
.badge.idle { color: var(--muted); }
.badge.ok { color: var(--accent); border-color: rgba(62,240,208,.4); }
.badge.listen { color: #041018; background: var(--accent); border-color: transparent; }
.badge.warn { color: var(--warn); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
  padding: 0 28px 28px;
}
.stage {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 62vh;
  border: 1px solid var(--line); border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  padding: 36px 24px 28px;
}
.state-label {
  font-family: Syne, sans-serif; letter-spacing: 0.18em; text-transform: uppercase;
  margin: 0; color: var(--accent);
}
.state-hint { color: var(--muted); margin: 8px 0 28px; text-align: center; }

.orb {
  position: relative; width: 168px; height: 168px; border: 0; cursor: pointer;
  background: transparent; color: #041018;
}
.orb .mic {
  position: absolute; inset: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent) 42%, #129b8a);
  box-shadow: 0 20px 50px rgba(62, 240, 208, 0.28);
}
.orb .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(62, 240, 208, 0.35);
}
.orb.listening .ring { animation: pulse 1.8s ease-out infinite; }
.orb.listening .delay { animation-delay: 0.6s; }
@keyframes pulse {
  from { transform: scale(0.92); opacity: 0.9; }
  to { transform: scale(1.18); opacity: 0; }
}

#wave { width: min(640px, 100%); height: 72px; margin-top: 18px; }
.keyword-row {
  margin-top: 8px; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px;
}
.keyword-row select, input, button, textarea {
  font: inherit; color: var(--ink);
}
.keyword-row select, .text-form input, .settings input, .settings select {
  background: #0b1822; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}

.text-form { display: flex; gap: 8px; width: min(560px, 100%); margin-top: 18px; }
.text-form input { flex: 1; }
button {
  border: 0; border-radius: 12px; padding: 10px 16px; cursor: pointer;
  background: var(--accent); color: #041018; font-weight: 700;
}
.ghost, .tiny {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
}
.tiny { padding: 4px 10px; font-size: 12px; font-weight: 500; }

.side { display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px;
  backdrop-filter: blur(16px);
}
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card h2 { margin: 0 0 10px; font-size: 15px; }
.now-playing { display: flex; gap: 12px; align-items: center; }
.now-playing img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: #123; }
.kicker { margin: 0; font-size: 11px; letter-spacing: 0.12em; color: var(--accent); }
.hidden { display: none !important; }

.chat { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow: auto; }
.chat li { margin: 0 0 12px; }
.bubble {
  display: inline-block; max-width: 92%; padding: 10px 12px; border-radius: 14px; line-height: 1.45;
}
.bubble.user { background: rgba(122, 107, 255, 0.22); }
.bubble.agent { background: rgba(62, 240, 208, 0.12); }
.who { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }

.weather-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-size: 13px; }
.weather-grid span { color: var(--muted); }
pre { white-space: pre-wrap; word-break: break-all; font-size: 12px; color: #c9e8e2; }

.dock {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-end;
  padding: 0 28px 24px;
}
.volume { display: flex; gap: 10px; align-items: center; }
.log { max-height: 160px; overflow: auto; width: min(640px, 70vw); background: #07141c; padding: 12px; border-radius: 12px; }

dialog {
  border: 1px solid var(--line); border-radius: 20px; background: #0c1822; color: var(--ink);
  width: min(640px, 92vw); padding: 0;
}
dialog::backdrop { background: rgba(0,0,0,.55); }
.settings { padding: 22px; display: grid; gap: 10px; }
.settings h2 { margin: 0; }
.muted { color: var(--muted); margin: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); }
menu { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0 0; margin: 0; }
.uuid { font-size: 12px; color: var(--accent); }

@media (max-width: 980px) {
  .layout, .dock { grid-template-columns: 1fr; padding-inline: 16px; }
  .grid3 { grid-template-columns: 1fr; }
}
