:root { color-scheme: light; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #ffffff;
  color: #111;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Top row: search form */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 12px 64px 12px 16px;
}
.search-form { display: flex; gap: 8px; max-width: 680px; margin: 0 auto; }
.search-form input {
  flex: 1; font-size: 17px; padding: 12px 14px;
  border: 1px solid #ddd; border-radius: 10px; background: #fff; color: #111;
}
.search-form input:focus { outline: 2px solid #111; outline-offset: 0; border-color: #111; }
.search-form button {
  font-size: 18px; padding: 0 18px; border: 1px solid #111; border-radius: 10px;
  background: #111; color: #fff; cursor: pointer;
}

/* Hamburger, top right */
.hamburger {
  position: absolute; top: 12px; right: 12px;
  width: 44px; height: 44px; border: 1px solid #eee; border-radius: 10px;
  background: #fff; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
}
.hamburger span { display: block; width: 20px; height: 2px; background: #111; border-radius: 1px; }

/* Stage: the white screen */
.stage { padding: 48px 20px; text-align: center; }
.hint { color: #999; font-size: 15px; }

/* Drawer */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 280px; max-width: 85vw;
  background: #fff; z-index: 40; padding: 20px;
  box-shadow: -8px 0 24px rgba(0,0,0,.08);
  transform: translateX(105%); transition: transform .22s ease;
}
.drawer.open { transform: translateX(0); }
.drawer h2 { margin: 8px 0 12px; font-size: 15px; color: #666; font-weight: 600; }
.drawer ul { list-style: none; margin: 0; padding: 0; }
.drawer li button {
  width: 100%; text-align: left; font-size: 17px; padding: 12px 8px;
  background: none; border: none; border-bottom: 1px solid #f0f0f0; cursor: pointer; color: #111;
}
.drawer-close {
  position: absolute; top: 10px; right: 12px; font-size: 28px; line-height: 1;
  background: none; border: none; cursor: pointer; color: #666; padding: 8px;
}
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 30; }
.hidden { display: none !important; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.lightbox-card {
  background: #fff; border-radius: 14px; width: 720px; max-width: 100%;
  max-height: 82vh; overflow: auto; position: relative; padding: 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
}
.lightbox-close {
  position: absolute; top: 8px; right: 12px; font-size: 30px; line-height: 1;
  background: none; border: none; cursor: pointer; color: #666; padding: 8px;
}
.lightbox-body h3 { margin: 4px 0 12px; font-size: 20px; }
.result-group { margin-bottom: 20px; }
.result-group > h4 {
  margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #888;
}
.result {
  display: block; width: 100%; text-align: left; background: #fafafa;
  border: 1px solid #eee; border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
  cursor: pointer; font-size: 15px; color: #111;
}
.result:hover { border-color: #ccc; }
.result .meta { display: block; margin-top: 4px; font-size: 12px; color: #888; }
.result .snippet { display: block; margin-top: 6px; font-size: 14px; color: #444;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.detail h3 { margin-top: 0; }
.detail .meta { color: #888; font-size: 13px; margin-bottom: 12px; }
.detail .body { white-space: pre-wrap; font-size: 15px; line-height: 1.55; }
.empty { color: #888; font-size: 15px; padding: 12px 0; }
.error { color: #a00; font-size: 15px; }

/* Password gate */
.gate input {
  width: 100%; font-size: 17px; padding: 12px 14px; margin: 8px 0 12px;
  border: 1px solid #ddd; border-radius: 10px;
}
.gate button {
  font-size: 16px; padding: 12px 20px; border: none; border-radius: 10px;
  background: #111; color: #fff; cursor: pointer;
}

/* Mic, bottom right */
.mic {
  position: fixed; right: 20px; bottom: 20px; z-index: 20;
  width: 60px; height: 60px; border-radius: 50%;
  background: #111; color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
}
.mic.listening { background: #b00020; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.08);} }
.mic-toast {
  position: fixed; right: 92px; bottom: 34px; z-index: 20;
  background: #111; color: #fff; font-size: 14px; padding: 10px 14px; border-radius: 10px;
  max-width: 60vw;
}
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
.status-dot.up { background: #1a9e50; }
.status-dot.down { background: #c00; }
.status-row { display: flex; align-items: center; font-size: 16px; padding: 10px 4px; border-bottom: 1px solid #f0f0f0; }
.status-row .ms { margin-left: auto; color: #888; font-size: 13px; }

@media (max-width: 560px) {
  .topbar { padding: 10px 60px 10px 10px; }
  .lightbox-card { padding: 18px; }
  .stage { padding: 32px 16px; }
}
