:root {
  --bg: #f4f4f5;
  --phone-bezel: #111114;
  --screen-bg: #0b0b0d;
  --surface: #17171b;
  --surface-2: #1f1f24;
  --line: #2a2a30;
  --ink: #f2f2f4;
  --ink-dim: #a8a8b0;
  --ink-faint: #6f6f78;
  --accent-blue: #8ab4f8;
  --accent-green: #34d399;
  --accent-red: #f28b82;
  --live-purple: #7c5cff;
  --google-blue: #4285F4;
  --google-red: #EA4335;
  --google-yellow: #FBBC05;
  --google-green: #34A853;
  --yt-red: #FF0000;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Google Sans", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Presenter chrome (not part of the demo capture) ---------- */

.presenter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 18px 16px 6px;
}

.presenter-bar .tag {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a8a92;
  margin-right: 4px;
}

.screen-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #d4d4d8;
  background: #fff;
  color: #3c3c43;
  cursor: pointer;
  transition: all 0.15s ease;
}

.screen-btn:hover { border-color: #a8a8b0; }

.screen-btn.active {
  background: #18181b;
  border-color: #18181b;
  color: #fff;
}

.stage {
  display: flex;
  justify-content: center;
  padding: 24px 16px 60px;
}

/* ---------- Phone frame ---------- */

.phone {
  position: relative;
  width: 375px;
  height: 812px;
  background: var(--phone-bezel);
  border-radius: 52px;
  padding: 14px;
  box-shadow:
    0 0 0 2px #000,
    0 30px 60px -20px rgba(0,0,0,0.45),
    0 10px 20px -10px rgba(0,0,0,0.3);
}

.phone::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  width: 120px;
  height: 26px;
  background: #000;
  border-radius: 16px;
  z-index: 5;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--screen-bg);
  border-radius: 38px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
}

.status-bar .status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.battery-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.battery-num {
  position: absolute;
  left: 2px;
  top: 51%;
  transform: translateY(-50%);
  font-size: 9.5px;
  font-weight: 700;
  color: #111;
}

.screen-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.screen-scroll::-webkit-scrollbar { display: none; }

.screen-pad {
  padding: 6px 16px 24px;
}

/* ---------- Header rows ---------- */

.app-header-plain {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 6px 4px 14px;
}

.header-icons {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
}

.google-logo {
  font-family: "Product Sans", Arial, sans-serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.5px;
}
.google-logo .g1 { color: var(--google-blue); }
.google-logo .g2 { color: var(--google-red); }
.google-logo .g3 { color: var(--google-yellow); }
.google-logo .g4 { color: var(--google-blue); }
.google-logo .g5 { color: var(--google-green); }
.google-logo .g6 { color: var(--google-red); }

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  position: relative;
}

.notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--google-red);
  border: 1.5px solid var(--screen-bg);
}

.avatar-city {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0e8a6d;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ---------- Search bar ---------- */

.search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.search-pill input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
}

.search-pill .mic-icon, .search-pill .lens-icon { flex-shrink: 0; }

/* ---------- Tabs ---------- */

.tabs-row {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.tabs-row::-webkit-scrollbar { display: none; }

.tab-item {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--ink-dim);
  padding-bottom: 10px;
  position: relative;
  white-space: nowrap;
}

.tab-item.active {
  color: var(--ink);
  font-weight: 500;
}

.tab-item.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 2px;
}

/* ---------- Chips ---------- */

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0 14px;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-dim);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
}

.chip.active {
  background: var(--surface-2);
  color: var(--ink);
  border-color: #3a3a42;
}

/* ---------- Location row (screen 2) ---------- */

.location-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-dim);
  padding: 2px 2px 4px;
}
.location-row svg { flex-shrink: 0; color: var(--ink-faint); }
.location-row strong { color: var(--ink); font-weight: 600; }
.loc-link { color: var(--accent-blue); }
.citation-more { color: var(--ink-faint); flex-shrink: 0; }

/* ---------- Atlas video module: header, LIVE badge, rating ---------- */

.atlas-rail-head {
  margin: 14px 0 2px;
}
.atlas-rail-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.rail-subtitle {
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.5;
  margin: 5px 0 0;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--live-purple);
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.rating-num { color: var(--ink); font-weight: 600; }
.rating svg { color: #fbbc05; width: 12px; height: 12px; }

/* ---------- Carousel ---------- */

.carousel-wrap {
  position: relative;
  margin-top: 10px;
}

.carousel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 2px 16px 6px;
  cursor: grab;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 96px;
  scroll-snap-align: start;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}

.tile-media {
  position: relative;
  width: 100%;
  height: 128px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tile-media img, .tile-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-media.placeholder {
  background: var(--ph-gradient, linear-gradient(160deg, #2a2a34, #17171b));
}

.tile-media .cat-icon {
  color: rgba(255,255,255,0.5);
  width: 24px;
  height: 24px;
}

.tile-time {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 8.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 3px 6px;
  border-radius: 999px;
}
.tile-time .dot {
  width: 4px; height: 4px;
  border-radius: 999px;
  background: var(--accent-red);
}

.tile-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 7px 8px 9px;
}

.tile-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-loc {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  font-size: 10px;
  color: var(--ink-dim);
  line-height: 1.3;
  margin-top: 1px;
}
.tile-loc svg { flex-shrink: 0; width: 10px; height: 10px; margin-top: 1.5px; }
.tile-loc span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dots-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 14px 0 18px;
}
.dots-row .d {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: #3a3a42;
}
.dots-row .d.on { background: var(--ink-dim); width: 16px; border-radius: 4px; }

/* ---------- SERP continuation (Screen 1: proves the page continues below the module) ---------- */

.serp-section {
  padding: 22px 0;
}
.serp-section:first-of-type {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.serp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.serp-head h4 { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-dim); }

.fav-circle {
  width: 20px; height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #fff;
  object-fit: contain;
  padding: 2px;
}
.ad-source {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.ad-source small { display: block; color: var(--ink-faint); font-size: 11px; }
.ad-headline {
  font-size: 15px;
  color: var(--accent-blue);
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.35;
}
.ad-body {
  font-size: 12.5px;
  color: #b6b6bd;
  line-height: 1.45;
}

.ai-overview-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-blue);
  margin-bottom: 10px;
}
.ai-overview-head h4 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.ai-overview-text {
  font-size: 13.5px;
  color: #d6d6db;
  line-height: 1.55;
  margin-bottom: 12px;
}
.show-more-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
}

.web-result-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.web-result-row:first-of-type { border-top: none; padding-top: 0; }
.web-result-body { flex: 1; min-width: 0; }
.web-thumb {
  width: 64px; height: 64px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
}

/* ---------- Browser toolbar (mobile Safari chrome around Google search) ---------- */

.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 14px;
  flex-shrink: 0;
  background: rgba(14,14,17,0.9);
  backdrop-filter: blur(6px);
}
.tb-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--surface-2);
}
.tb-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 9px 14px;
  min-width: 0;
  color: var(--ink-dim);
}
.tb-pill span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink);
}

/* ---------- List rows (screen 2) ---------- */

.rank-row {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.rank-row:last-child { border-bottom: none; }
.rank-thumb {
  width: 64px; height: 64px;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--ph-gradient, linear-gradient(160deg, #2a2a34, #17171b));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.rank-thumb svg { width: 22px; height: 22px; color: rgba(255,255,255,0.5); }
.rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-info h5 {
  margin: 0 0 3px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent-blue);
}
.rank-meta {
  font-size: 12px;
  color: var(--ink-dim);
  margin-bottom: 4px;
}
.rank-meta .open { color: var(--accent-green); }
.rank-blurb {
  font-size: 12.5px;
  color: #b6b6bd;
  line-height: 1.4;
}

.more-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  padding: 12px;
  border-radius: 999px;
  margin-top: 8px;
}

/* ---------- POI screen ---------- */

.poi-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.poi-head h2 { margin: 0 0 6px; font-size: 21px; font-weight: 700; }
.poi-sub {
  font-size: 13px;
  color: var(--ink-dim);
  margin: 2px 0;
}
.poi-sub .open { color: var(--accent-green); }
.poi-thumb {
  position: relative;
  width: 74px; height: 74px;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(160deg, #2a2a34, #17171b);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.poi-thumb svg { width: 26px; height: 26px; color: rgba(255,255,255,0.5); }
.poi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.poi-thumb .plus {
  position: absolute;
  bottom: 5px; right: 5px;
  font-size: 9px;
  font-weight: 700;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 1px 5px;
  border-radius: 5px;
}

.action-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 14px;
}
.action-pills::-webkit-scrollbar { display: none; }
.action-pill {
  flex-shrink: 0;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  white-space: nowrap;
}
.action-pill.active { border-color: var(--accent-blue); color: var(--accent-blue); }

.quick-links {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--accent-blue);
  text-transform: uppercase;
}
.quick-link .qcircle {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid #33445c;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-blue);
}
.quick-link .qcircle svg { width: 18px; height: 18px; }

.poi-desc {
  font-size: 13.5px;
  color: #c3c3ca;
  line-height: 1.55;
  margin: 16px 0 18px;
}

.addr-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.addr-row svg { flex-shrink: 0; width: 18px; height: 18px; color: var(--ink-dim); margin-top: 1px; }
.addr-text { flex: 1; font-size: 13.5px; color: #d6d6db; line-height: 1.4; }
.mini-map {
  width: 118px;
  height: 76px;
  border-radius: 10px;
  flex-shrink: 0;
  overflow: hidden;
  background: #14161a;
}
.mini-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: invert(90%) hue-rotate(180deg) saturate(0.85) brightness(1.05);
}

.hours-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.hours-row svg:last-child { margin-left: auto; }

.pt-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 60px;
  margin-top: 8px;
  padding: 0 2px 20px;
}
.pt-bar {
  flex: 1;
  background: var(--accent-blue);
  opacity: 0.55;
  border-radius: 3px 3px 0 0;
  min-height: 4px;
}

.section-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 18px 0 10px;
}

/* ---------- Screen 4 : YouTube ---------- */

.yt-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 14px;
}
.yt-search-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 10px 14px;
  min-width: 0;
}
.yt-search-pill span:not(.yt-clear) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14.5px;
  color: var(--ink);
}
.yt-clear { flex-shrink: 0; color: var(--ink-faint); }

.yt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 10px;
  margin-top: 16px;
}
.yt-card { display: flex; flex-direction: column; }
.yt-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: var(--ph-gradient, linear-gradient(160deg, #2a2a34, #17171b));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  overflow: hidden;
}
.yt-thumb .cat-icon { color: rgba(255,255,255,0.5); width: 26px; height: 26px; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yt-duration {
  position: absolute;
  bottom: 5px;
  right: 5px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.75);
  padding: 1px 5px;
  border-radius: 4px;
}
.yt-card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.yt-card-meta { font-size: 11px; color: var(--ink-faint); line-height: 1.4; }

.yt-bottom-bar {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
  background: #0e0e11;
  padding: 8px 4px 10px;
  flex-shrink: 0;
}
.yb-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--ink-faint);
}
.yb-item.active { color: var(--ink); }
.yb-add-circle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.yb-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1ba1e2;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Phone-sized viewports: no phone frame, the screen fills the width ---------- */
@media (max-width: 499px) {
  /* The presenter bar keeps its own height (it wraps on narrow screens); the phone takes what is left. */
  body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .stage { flex: 1; min-height: 0; padding: 0; }
  .phone {
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .phone::before { display: none; }
  .phone-screen { border-radius: 0; }
}
