:root {
  --bg: #050507;
  --panel: #111116;
  --panel-2: #1b1d24;
  --text: #ffffff;
  --muted: #aeb4c0;
  --dim: #68707e;
  --red: #ef233c;
  --cyan: #22d3ee;
  --green: #2ee59d;
  --amber: #ffb020;
  --border: rgba(255, 255, 255, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #0c0d10;
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  background: #000;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #20232c;
  color: var(--text);
  min-height: 42px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover,
button:focus {
  border-color: var(--cyan);
  outline: none;
}

button.active {
  border-color: rgba(46, 229, 157, 0.6);
  color: var(--green);
}

.workspace {
  display: grid;
  grid-template-columns: 600px minmax(360px, 1fr);
  gap: 24px;
  padding: 24px;
}

.glasses-shell {
  width: 600px;
  height: 600px;
  background: #000;
}

.display {
  width: 600px;
  height: 600px;
  background: #000;
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.display-header,
.display-footer {
  background: rgba(17, 17, 22, 0.92);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
}

.display-header h1 {
  font-size: 22px;
  line-height: 1;
  margin: 0 0 4px;
}

.display-header span,
.display-footer span {
  color: var(--muted);
  font-size: 13px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
  padding: 5px 10px;
  text-transform: uppercase;
}

.pill.online {
  color: var(--green);
  border-color: rgba(46, 229, 157, 0.45);
}

.presence {
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 14px;
  padding-top: 20px;
}

.orb {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 2px solid rgba(34, 211, 238, 0.7);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.85), transparent 12%),
    radial-gradient(circle, rgba(34, 211, 238, 0.24), rgba(239, 35, 60, 0.12) 48%, transparent 70%);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.3);
}

.mode-speaking .orb {
  animation: pulse 0.9s ease-in-out infinite alternate;
}

.mode-searching .orb {
  border-color: var(--amber);
  box-shadow: 0 0 28px rgba(255, 176, 32, 0.35);
}

.mode-alert .orb {
  border-color: var(--red);
  box-shadow: 0 0 28px rgba(239, 35, 60, 0.5);
}

.waveform {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.waveform span {
  width: 5px;
  height: 12px;
  border-radius: 8px;
  background: var(--cyan);
  opacity: 0.5;
}

.mode-speaking .waveform span {
  animation: wave 0.7s ease-in-out infinite alternate;
}

.waveform span:nth-child(2) { animation-delay: 0.1s; }
.waveform span:nth-child(3) { animation-delay: 0.2s; }
.waveform span:nth-child(4) { animation-delay: 0.3s; }

.display-card {
  margin: 0 20px;
  padding: 18px;
  background: rgba(27, 29, 36, 0.94);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.display-media {
  background: #0a0a0f;
  border: 1px solid var(--border);
  border-radius: 8px;
  flex: 1;
  margin: 0 20px 14px;
  min-height: 0;
  overflow: hidden;
}

.browser-frame,
.youtube-frame {
  background: #000;
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

.browser-frame {
  object-fit: cover;
}

.has-media .presence {
  display: none;
}

.has-media .display-media {
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  position: absolute;
  z-index: 1;
}

.has-media .display-header {
  left: 8px;
  padding: 10px 12px;
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 3;
}

.has-media .display-header h1 {
  font-size: 18px;
}

.has-media .brand-mark {
  height: 28px;
  width: 28px;
}

.has-media .display-card {
  background: rgba(17, 17, 22, 0.84);
  bottom: 8px;
  left: 8px;
  margin: 0;
  max-height: 128px;
  overflow: hidden;
  padding: 10px;
  position: absolute;
  right: 8px;
  z-index: 3;
}

.has-media #display-body {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
  max-height: 34px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.has-media .mode-label {
  margin-bottom: 4px;
}

.has-media .actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.has-media .actions button {
  min-height: 44px;
}

.has-media .display-footer {
  display: none;
}

.mode-youtube .display-card {
  background: rgba(10, 10, 15, 0.64);
}

.mode-label {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 10px;
  text-transform: uppercase;
}

#display-body {
  font-size: 21px;
  line-height: 1.26;
  margin: 0;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.actions button {
  background: #171a22;
  min-height: 38px;
  font-size: 14px;
}

.display-footer {
  justify-content: space-between;
  margin-top: auto;
}

.control-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  min-height: 600px;
}

.panel-header h2 {
  margin: 0 0 6px;
}

.panel-header p {
  color: var(--muted);
  margin: 0 0 16px;
}

.control-row,
.demo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

#camera-preview {
  width: 220px;
  height: 124px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 14px;
}

.text-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  margin-bottom: 14px;
}

.text-form input {
  background: #07080a;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  min-height: 42px;
  padding: 0 12px;
}

.log-section h3 {
  font-size: 14px;
  color: var(--muted);
  margin: 14px 0 8px;
  text-transform: uppercase;
}

.log-box {
  background: #07080a;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  height: 150px;
  overflow-y: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.log-box.compact {
  height: 116px;
}

@keyframes pulse {
  from { transform: scale(0.94); }
  to { transform: scale(1.08); }
}

@keyframes wave {
  from { height: 8px; opacity: 0.45; }
  to { height: 26px; opacity: 1; }
}

@media (max-width: 1040px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

body.glasses-body {
  background: #000;
  height: 600px;
  min-height: 600px;
  overflow: hidden;
  width: 600px;
}

body.glasses-body .workspace {
  display: block;
  height: 600px;
  padding: 0;
  width: 600px;
}

body.glasses-body .control-panel {
  display: none;
}
