:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f4ef;
  color: #151515;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

body[data-licensed="false"] .app-shell {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

.license-gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(21, 21, 21, 0.72);
  backdrop-filter: blur(16px);
}

.license-gate[hidden] {
  display: none;
}

.license-card {
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  padding: clamp(24px, 6vw, 44px);
  border: 1px solid rgba(255, 252, 246, 0.2);
  border-radius: 8px;
  background: #fffcf6;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

.license-card h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 8vw, 58px);
  font-weight: 500;
  line-height: 1;
}

.license-card form {
  display: grid;
  gap: 10px;
}

.license-card input {
  width: 100%;
  text-transform: uppercase;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input {
  border: 1px solid #ddd7cb;
  background: #fffcf6;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 14px;
  color: #151515;
}

button {
  cursor: pointer;
}

.dashboard-body {
  background:
    linear-gradient(90deg, rgba(21, 21, 21, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(21, 21, 21, 0.04) 1px, transparent 1px),
    #f6f4ef;
  background-size: 28px 28px;
}

.app-shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.backoffice-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 22px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}

.backoffice-sidebar {
  position: sticky;
  top: 22px;
  align-self: start;
  min-height: calc(100vh - 44px);
  display: grid;
  align-content: space-between;
  gap: 24px;
  padding: 22px;
  border: 1px solid #ddd7cb;
  border-radius: 8px;
  background: #151515;
  color: #fffcf6;
}

.backoffice-sidebar h1 {
  margin: 8px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 500;
}

.backoffice-sidebar .muted,
.backoffice-sidebar .eyebrow {
  color: #c8beb0;
}

.backoffice-nav {
  display: grid;
  gap: 8px;
}

.backoffice-nav a {
  color: #fffcf6;
  text-decoration: none;
  border: 1px solid rgba(255, 252, 246, 0.16);
  border-radius: 8px;
  padding: 11px 12px;
}

.backoffice-main {
  min-width: 0;
}

.admin-login-panel {
  display: grid;
  gap: 10px;
}

.admin-login-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.admin-login-form label {
  display: grid;
  gap: 6px;
  color: #70685d;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

body[data-admin-auth="false"] .admin-protected {
  display: none;
}

.metric-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  padding: 18px;
  border: 1px solid #ddd7cb;
  border-radius: 8px;
  background: #fffcf6;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: 1;
}

.inline-head {
  margin-top: 0;
}

.webhook-panel {
  display: grid;
  gap: 14px;
}

.webhook-url-row,
.license-output {
  display: flex;
  gap: 10px;
  align-items: center;
}

.webhook-url-row code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid #ddd7cb;
  border-radius: 8px;
  background: #ffffff;
}

.security-notes ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #514a42;
}

.topbar,
.section-head,
.controls,
.session-panel {
  display: flex;
  align-items: center;
}

.topbar,
.section-head {
  justify-content: space-between;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  line-height: 1;
  font-weight: 500;
}

.eyebrow,
.label,
.muted {
  margin: 0;
  color: #70685d;
}

.eyebrow,
.label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-action {
  background: #151515;
  border-color: #151515;
  color: #fffcf6;
  font-weight: 800;
}

.hero-console {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.panel,
.answer-panel,
.session-card {
  margin-top: 18px;
  background: #fffcf6;
  border: 1px solid #ddd7cb;
  border-radius: 8px;
  padding: 18px;
}

.hero-console .answer-panel,
.hero-console .session-card {
  margin-top: 0;
}

.session-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.spectator-link {
  display: block;
  margin: 8px 0;
  color: #52665a;
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.qr-wrap {
  width: 100%;
  aspect-ratio: 1;
  max-width: 220px;
  border: 1px solid #ddd7cb;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ffffff;
}

.qr-wrap img {
  width: 88%;
  height: 88%;
}

.controls {
  margin-top: 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.effect-settings {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.effect-settings label {
  display: grid;
  gap: 6px;
  color: #70685d;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.effect-settings input {
  width: 100%;
}

body[data-mode="peek"] .effect-settings {
  display: none;
}

body[data-mode="force"] #predictionInput,
body[data-mode="force"] .effect-settings label:nth-child(2),
body[data-mode="prediction"] #forceInput,
body[data-mode="prediction"] .effect-settings label:nth-child(1) {
  display: none;
}

.controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #70685d;
  font-size: 14px;
}

.controls select {
  min-width: 150px;
}

.ghost {
  background: transparent;
}

.answer-panel {
  position: relative;
  min-height: 312px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  background: #151515;
  color: #fffcf6;
}

.answer-panel::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 252, 246, 0.18);
  border-radius: 6px;
  pointer-events: none;
}

.answer-panel::after {
  content: "";
  position: absolute;
  inset: auto 18px 18px auto;
  width: 90px;
  height: 56px;
  border: 1px solid rgba(156, 109, 76, 0.65);
  border-radius: 50%;
  transform: rotate(-12deg);
  pointer-events: none;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.answer-panel .label,
.answer-panel .muted {
  color: #c8beb0;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 252, 246, 0.22);
  border-radius: 999px;
  padding: 5px 10px;
  color: #fffcf6;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9c6d4c;
}

.latest-answer {
  min-height: 92px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 11vw, 98px);
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
}

.section-head {
  margin-top: 24px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.count-pill {
  border: 1px solid #ddd7cb;
  border-radius: 999px;
  padding: 4px 12px;
  background: #fffcf6;
  color: #70685d;
}

.event-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 8px;
}

.event-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid #ddd7cb;
  border-radius: 8px;
  background: rgba(255, 252, 246, 0.84);
}

.admin-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-panel label {
  display: grid;
  gap: 6px;
  color: #70685d;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.plan-guide {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.plan-guide.single {
  grid-template-columns: minmax(0, 1fr);
}

.plan-guide article {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid #ddd7cb;
  border-radius: 8px;
  background: #ffffff;
}

.plan-guide strong {
  font-size: 17px;
}

.plan-guide span {
  color: #52665a;
  font-size: 14px;
  font-weight: 800;
}

.plan-guide p {
  margin: 0;
  color: #70685d;
  font-size: 14px;
  line-height: 1.45;
}

.new-license strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(24px, 6vw, 42px);
  overflow-wrap: anywhere;
}

.license-list li {
  align-items: center;
}

.license-list li > span {
  display: grid;
  gap: 5px;
}

.event-query {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.event-meta {
  color: #70685d;
  white-space: nowrap;
}

.spectator-body {
  background: #ffffff;
  color: #202124;
  font-family: Arial, Helvetica, sans-serif;
}

.mobile-search-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.phone-status {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: #111111;
  font-size: 13px;
  font-weight: 700;
}

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

.phone-status-icons span {
  display: block;
  background: #111111;
}

.phone-status-icons span:nth-child(1) {
  width: 16px;
  height: 10px;
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.phone-status-icons span:nth-child(2) {
  width: 14px;
  height: 10px;
  border-radius: 2px;
}

.phone-status-icons span:nth-child(3) {
  width: 19px;
  height: 10px;
  border-radius: 2px;
}

.browser-address {
  height: 48px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 7px;
  background: #f1f3f4;
  border-bottom: 1px solid #dadce0;
}

.browser-home,
.browser-menu {
  height: 36px;
  display: grid;
  place-items: center;
  color: #5f6368;
}

.browser-home svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.browser-url {
  height: 36px;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 14px;
  border-radius: 999px;
  background: #ffffff;
  color: #3c4043;
  font-size: 15px;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px #e2e3e5;
}

.browser-menu {
  gap: 3px;
}

.browser-menu span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #5f6368;
}

.mobile-search-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.mobile-search-nav {
  height: 52px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
}

.mobile-search-nav button {
  border: 0;
  background: transparent;
}

.mobile-search-nav a {
  display: inline-flex;
  align-items: center;
  height: 52px;
  padding: 0 8px;
  color: #5f6368;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
}

.mobile-search-nav a[aria-current="page"] {
  color: #1a73e8;
  border-bottom: 2px solid #1a73e8;
}

.mobile-nav-left,
.mobile-nav-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.mobile-nav-left {
  flex: 1;
  gap: 2px;
}

.mobile-nav-right {
  gap: 8px;
  flex-shrink: 0;
}

.hamburger-button {
  width: 34px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
}

.hamburger-button span,
.hamburger-button span::before,
.hamburger-button span::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #70757a;
  content: "";
}

.hamburger-button span::before {
  transform: translateY(-6px);
}

.hamburger-button span::after {
  transform: translateY(4px);
}

.mobile-search-nav .apps-button {
  width: 34px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 0;
}

.mobile-search-nav .apps-button svg {
  width: 23px;
  height: 23px;
  fill: #3c4043;
}

.mobile-search-nav .signin-button {
  align-self: center;
  min-width: 76px;
  height: 36px;
  min-height: 36px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #0b57d0;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 36px;
}

.mobile-search-form {
  width: min(584px, calc(100% - 24px));
  margin: clamp(54px, 13vh, 124px) auto 0;
  display: grid;
  gap: 15px;
}

.search-brand {
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(48px, 16vw, 82px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
}

.search-brand span:nth-child(1),
.search-brand span:nth-child(4) {
  color: #4285f4;
}

.search-brand span:nth-child(2),
.search-brand span:nth-child(7) {
  color: #ea4335;
}

.search-brand span:nth-child(3) {
  color: #fbbc04;
}

.search-brand span:nth-child(5) {
  color: #34a853;
}

.search-brand span:nth-child(6) {
  color: #4285f4;
}

.mobile-search-box {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 16px;
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 5px rgba(60, 64, 67, 0.18);
  transition: box-shadow 120ms ease, border-color 120ms ease;
}

.mobile-search-box:focus-within {
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.26);
}

.mobile-field-icon,
.clear-search-button {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  color: #5f6368;
}

.mobile-field-icon svg,
.clear-search-button svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.magnifier-icon svg {
  width: 20px;
  height: 20px;
  color: #9aa0a6;
}

.voice-icon svg {
  width: 22px;
  height: 22px;
  color: #3c4043;
}

.clear-search-button {
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.mobile-search-box input {
  width: 100%;
  min-width: 0;
  min-height: auto;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #202124;
  font-size: 18px;
}

.mobile-submit {
  display: none;
}

.spectator-status {
  min-height: 20px;
  margin: -6px 0 0;
  color: #70757a;
  font-size: 13px;
  text-align: center;
}

.spectator-status:empty {
  display: none;
}

.trend-panel {
  width: min(584px, calc(100% - 24px));
  margin: 28px auto 0;
  padding-bottom: 26px;
  color: #202124;
}

.trend-title {
  padding: 14px 0 10px;
  color: #70757a;
  font-size: 13px;
  font-weight: 700;
}

.trend-row {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: 0;
  border-top: 1px solid #e8eaed;
  border-radius: 0;
  background: transparent;
  color: #202124;
  font-size: 15px;
  text-align: left;
}

.trend-row.featured {
  border-top: 0;
  font-size: 14px;
}

.trend-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  color: #5f6368;
}

.trend-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.reveal-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #151515;
  color: #fffcf6;
}

.reveal-shell {
  width: min(820px, calc(100% - 32px));
  min-height: 54vh;
  display: grid;
  align-content: center;
  gap: 22px;
  border: 1px solid rgba(255, 252, 246, 0.2);
  border-radius: 8px;
  padding: clamp(28px, 7vw, 70px);
  text-align: center;
}

.reveal-shell h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 12vw, 112px);
  font-weight: 500;
  line-height: 1;
  overflow-wrap: anywhere;
}

.reveal-shell .muted,
.reveal-shell .eyebrow {
  color: #c8beb0;
}

@media (max-width: 640px) {
  .app-shell {
    padding: 16px;
  }

  .hero-console {
    grid-template-columns: 1fr;
  }

  .session-panel,
  .event-list li {
    align-items: stretch;
    flex-direction: column;
  }

  .qr-wrap {
    width: 100%;
    height: 180px;
    aspect-ratio: auto;
    max-width: none;
  }

  .qr-wrap img {
    width: 156px;
    height: 156px;
  }

  .controls > * {
    width: 100%;
  }

  .effect-settings {
    grid-template-columns: 1fr;
  }

  .admin-panel {
    grid-template-columns: 1fr;
  }

  .plan-guide {
    grid-template-columns: 1fr;
  }

  .backoffice-shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .backoffice-sidebar {
    position: static;
    min-height: auto;
  }

    .admin-login-form,
    .metric-grid {
      grid-template-columns: 1fr;
    }

  .controls label {
    justify-content: space-between;
  }

  .phone-status {
    height: 25px;
    padding: 0 14px;
  }

  .browser-address {
    height: 47px;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 7px;
    padding: 5px 10px 6px;
  }

  .mobile-search-nav {
    height: 50px;
    padding: 0 12px;
  }

  .mobile-search-nav a {
    height: 50px;
    font-size: 12px;
  }

  .hamburger-button,
  .mobile-search-nav .apps-button {
    height: 50px;
  }

  .mobile-search-form {
    width: calc(100% - 24px);
    margin-top: 46px;
    gap: 15px;
  }

  .search-brand {
    font-size: 46px;
  }

  .mobile-search-box {
    height: 54px;
    padding-left: 16px;
    padding-right: 14px;
  }

  .spectator-status {
    margin-top: -10px;
  }

  .trend-panel {
    width: calc(100% - 24px);
    margin-top: 26px;
  }
}
