:root {
  color-scheme: dark;
  --bg: #03040a;
  --ink: #f4fbff;
  --line: rgba(200, 236, 255, 0.24);
  --panel: rgba(11, 14, 20, 0.92);
  --glow: #7fe4ff;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Inter, Sarabun, system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 50% 18%, #11172a 0%, var(--bg) 50%);
  color: var(--ink);
}

#manifestation-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.first-surface {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
}

.chat-surface {
  width: min(760px, calc(100vw - 24px));
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(12,16,24,0.15), rgba(12,16,24,0.35));
  border: 1px solid rgba(200,236,255,0.2);
  border-radius: 18px;
  padding: 12px;
  backdrop-filter: blur(8px);
}

.icon-btn,
.send-btn,
#intent-input,
.settings input,
.settings select,
.settings button {
  pointer-events: auto;
}

#settings-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 4;
}

.icon-btn,
.send-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
}

.icon-btn { width: 42px; height: 42px; }
.send-btn { padding: 0 18px; height: 44px; }

.ambient-status,
.readable-fallback {
  margin: 0;
  text-shadow: 0 0 18px rgba(127, 228, 255, 0.35);
}

.ambient-status {
  opacity: 0.84;
  font-size: 13px;
}

.readable-fallback {
  min-height: 1.4em;
  margin: 6px 0 12px;
  opacity: 0.92;
  font-size: 14px;
}

.composer {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(12, 16, 24, 0.5);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

#intent-input {
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  padding: 0 14px;
  height: 44px;
  min-width: 0;
}

#intent-input::placeholder { color: rgba(238, 249, 255, 0.56); }

:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 2px;
}

.settings {
  position: fixed;
  top: 20px;
  right: 20px;
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
  padding: 14px;
  z-index: 10;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings section {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.18);
}

.settings label,
.settings p,
.settings h3 {
  display: block;
  margin: 8px 0;
  font-size: 13px;
}

.settings input,
.settings select,
.settings button,
.settings-inline-btn {
  width: 100%;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  min-height: 36px;
  padding: 0 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 720px) {
  .first-surface { padding: 12px 12px 18px; }
  .chat-surface { border-radius: 14px; }
}
