:root {
  --bg: #02080c;
  --cyan: #6fe3f7;
  --text: #e8fbff;
  --muted: #8fb3be;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  overflow: hidden;
}
.hud {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: calc(12px + var(--safe-t)) 14px calc(12px + var(--safe-b));
  background:
    repeating-linear-gradient(0deg, rgba(80,180,160,0.05) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(80,180,160,0.05) 0 1px, transparent 1px 22px),
    #02080c;
}
.top, .dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chip {
  margin: 0;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--cyan);
  border-radius: 999px;
  color: var(--cyan);
  font: 700 12px/32px Inter, system-ui, sans-serif;
  letter-spacing: 0.14em;
}
#close {
  width: 44px;
  height: 44px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  border: 1px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.stage {
  position: relative;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1.5px solid var(--cyan);
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
  box-shadow: inset 0 0 40px rgba(111, 227, 247, 0.08);
}
#face {
  display: block;
  width: min(78%, 300px);
  height: min(42vh, 300px);
  min-width: 180px;
  min-height: 180px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 34vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.results[hidden] { display: none; }
.pages { display: flex; gap: 8px; overflow-x: auto; }
.page, .item {
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--cyan);
}
.page {
  flex: none;
  min-height: 40px;
  padding: 0 12px;
  color: var(--cyan);
  font: 600 13px/40px Inter, system-ui, sans-serif;
}
.item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 10px 12px;
  background: rgba(111, 227, 247, 0.06);
}
.item b { display: block; font-size: 14px; }
.item .meta { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 40px;
  background: var(--cyan);
  color: #031018;
  font: 800 14px/1 Inter, system-ui, sans-serif;
}
#mic, .ghost {
  min-height: 52px;
  padding: 0 18px;
  font: 800 15px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.08em;
  cursor: pointer;
  touch-action: manipulation;
}
#mic {
  flex: 1;
  border: 2px solid var(--cyan);
  background: rgba(111, 227, 247, 0.08);
  color: var(--cyan);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
}
#mic:active { transform: scale(0.98); }
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text);
  text-decoration: none;
  background: transparent;
  min-width: 128px;
}
@media (max-width: 520px) {
  .dock { flex-direction: column; align-items: stretch; }
  .ghost { width: 100%; }
}
#close:focus-visible, #mic:focus-visible, .item:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
