/* Quasar Lens — theme matches quasarinsightlabs.in: deep indigo background,
   faint grid, violet accent. */

:root {
  --bg: #14101f;
  --bg-deep: #0f0c18;
  --glow: rgba(88, 70, 190, 0.35);
  --surface: #1b1729;
  --surface-2: #221d35;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --grid-line: rgba(132, 95, 255, 0.07);

  --text: #f4f3f8;
  --text-muted: #a6a3b8;
  --text-faint: #75718a;

  --accent: #845fff;
  --accent-hover: #9372ff;
  --accent-light: #ad9cf9;
  --accent-soft: rgba(132, 95, 255, 0.16);

  --good: #3ddc97;
  --warn: #ffb547;
  --bad: #ff6b81;
  --neutral: #8b87a0;

  --font-body: 'Poppins', -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-heading: 'Raleway', 'Poppins', -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  margin: 0;
  padding: 24px;
  color: var(--text);
  background-color: var(--bg);
  /* purple glow at the top + the site's faint grid */
  background-image:
    radial-gradient(ellipse 70% 45% at 50% 0%, var(--glow), transparent 70%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 120px 120px, 120px 120px;
  background-attachment: fixed;
  min-height: 100vh;
}

.container {
  max-width: 760px;
  margin: 0 auto;
}

/* ---- Brand header ---- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}

.brand-logo {
  width: 40px;
  height: auto;
  display: block;
}

.brand-name {
  font-weight: 600;
  font-size: 18px;
  line-height: 1.1;
}

.brand-by {
  font-size: 12px;
  font-weight: 300;
  color: var(--text-muted);
}

.user-menu {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 0;
}
.user-avatar { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong); }
.user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu.hidden,
.user-avatar.hidden { display: none; }

@media (max-width: 600px) {
  .user-email { display: none; }
}

/* ---- Login page ---- */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 32px 32px;
  text-align: center;
  background: rgba(27, 23, 41, 0.85);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(132, 95, 255, 0.08);
  backdrop-filter: blur(8px);
}

.login-logo {
  width: 64px;
  height: auto;
  display: block;
  margin: 0 auto 20px;
  filter: drop-shadow(0 8px 24px rgba(132, 95, 255, 0.35));
}

.login-card h1 { font-size: 36px; margin-bottom: 8px; }
.login-card .subtitle { margin-bottom: 28px; }

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: #1f1f1f;
  background: #ffffff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.1s;
}
.google-btn:hover:not(:disabled) { box-shadow: 0 0 0 4px var(--accent-soft), 0 8px 24px rgba(132, 95, 255, 0.35); }
.google-btn:active:not(:disabled) { transform: scale(0.99); }
.google-btn:disabled { opacity: 0.6; cursor: default; }

.login-message {
  min-height: 20px;
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.login-message.error { color: var(--bad); }

.login-domain {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
}
.login-domain strong { color: var(--accent-light); font-weight: 500; }

/* ---- Hero ---- */

.eyebrow {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}

h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.15;
  text-align: center;
  margin: 0 0 12px;
  background: linear-gradient(180deg, #ffffff 0%, #bdb8cf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h1 .accent {
  background: linear-gradient(90deg, var(--accent-light), #d9d1ff);
  -webkit-background-clip: text;
  background-clip: text;
}

.subtitle {
  color: var(--text-muted);
  font-weight: 300;
  text-align: center;
  margin: 0 auto 28px;
  max-width: 520px;
  font-size: 14px;
}

/* ---- Search form ---- */

form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}

#url-input {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
}

#url-input::placeholder { color: var(--text-faint); }

form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

#check-btn {
  padding: 10px 26px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

#check-btn:hover { background: linear-gradient(90deg, var(--accent-hover), var(--accent-light)); }
#check-btn:disabled { background: var(--surface-2); color: var(--text-faint); cursor: not-allowed; }

#status {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  min-height: 18px;
  text-align: center;
}

#status.error { color: var(--bad); }

.hidden { display: none; }

h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 10px;
}

/* ---- Detection results ---- */

.result {
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.high { border-left: 3px solid var(--good); }
.medium { border-left: 3px solid var(--warn); }
.info { border-left: 3px solid var(--neutral); }

.confidence {
  font-weight: 600;
  margin-right: 6px;
}

.version {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-light);
  font-size: 12px;
}

/* ---- Last updated ---- */

#updated-panel { margin-top: 20px; }

.updated-headline {
  padding: 12px 14px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  font-size: 14px;
}

.updated-headline strong { font-size: 15px; font-weight: 600; }

.signal {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.signal-date { white-space: nowrap; color: var(--text); }

/* ---- Sales audit ---- */

#audit-panel { margin-top: 24px; }

.audit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.audit-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.audit-section h3 {
  font-size: 11px;
  font-weight: 500;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

/* Loading state: spinning violet ring around the logo + step list */
.audit-loader {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
}

.spinner {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

/* the ring: a conic gradient masked into a thin circle */
.spinner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 30%, var(--accent) 70%, var(--accent-light) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: spinner-rotate 1.1s linear infinite;
}

/* soft glow behind the logo */
.spinner::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(132, 95, 255, 0.45), transparent 70%);
  animation: spinner-pulse 1.8s ease-in-out infinite;
}

.spinner img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 1;
}

@keyframes spinner-rotate { to { transform: rotate(360deg); } }
@keyframes spinner-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

.loader-body { flex: 1; min-width: 0; }

.loader-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 2px;
}

.loader-elapsed {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.loader-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.loader-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 3px 0;
  color: var(--text-faint);
  transition: color 0.3s;
}

.loader-steps .step-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
}

.loader-steps li.active { color: var(--text); }
.loader-steps li.active .step-icon {
  border-color: var(--accent-light);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: spinner-pulse 1.4s ease-in-out infinite;
}

.loader-steps li.done { color: var(--text-muted); }
.loader-steps li.done .step-icon {
  border-color: var(--good);
  color: var(--good);
}

@media (prefers-reduced-motion: reduce) {
  .spinner::before { animation-duration: 3s; }
  .spinner::after,
  .loader-steps li.active .step-icon { animation: none; }
}

@media (max-width: 600px) {
  .audit-loader { flex-direction: column; align-items: flex-start; gap: 16px; }
}

.point {
  font-size: 13px;
  padding: 6px 0 6px 12px;
  margin-bottom: 6px;
  border-left: 3px solid var(--neutral);
}
.point.high { border-left-color: var(--bad); }
.point.medium { border-left-color: var(--warn); }
.point.low { border-left-color: var(--neutral); }

.scores { display: flex; gap: 12px; flex-wrap: wrap; }

.score-card {
  flex: 1;
  min-width: 200px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.score-value {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 6px;
}
.score-max { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--text-muted); }
.score-good { color: var(--good); }
.score-average { color: var(--warn); }
.score-poor { color: var(--bad); }

.metric-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}
.metric-row span:last-child { color: var(--text); }

.app-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.app-table td { padding: 5px 0; border-bottom: 1px solid var(--border); }
.app-table td:last-child { text-align: right; white-space: nowrap; }
.app-table .category { color: var(--text-muted); font-size: 12px; }

.cost-summary { font-size: 14px; margin-bottom: 10px; color: var(--text-muted); }
.cost-summary strong { font-size: 20px; font-weight: 600; color: var(--accent-light); }

.check {
  display: flex;
  gap: 8px;
  font-size: 13px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.check:last-child { border-bottom: none; }
.check-icon { width: 16px; flex-shrink: 0; font-weight: 700; }
.check.ok .check-icon { color: var(--good); }
.check.warn .check-icon { color: var(--warn); }
.check.bad .check-icon { color: var(--bad); }
.check.info .check-icon { color: var(--neutral); }
.check-name { font-weight: 600; margin-right: 4px; }

.note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 0;
}

.note.spaced { margin-top: 8px; }

/* ---- Full PageSpeed report (expandable) ---- */

.psi-report {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.psi-report > summary,
.psi-section > summary,
.psi-audit > summary {
  cursor: pointer;
  list-style: none;
}
.psi-report > summary::-webkit-details-marker,
.psi-section > summary::-webkit-details-marker,
.psi-audit > summary::-webkit-details-marker { display: none; }

/* chevron */
.psi-report > summary::before,
.psi-section > summary::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-right: 2px solid var(--accent-light);
  border-bottom: 2px solid var(--accent-light);
  transform: rotate(-45deg);
  transition: transform 0.2s;
  vertical-align: middle;
}
.psi-report[open] > summary::before,
.psi-section[open] > summary::before { transform: rotate(45deg); }

.psi-report > summary {
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14px;
  color: var(--accent-light);
}
.psi-report > summary .note { font-weight: 400; margin-left: 6px; }
.psi-report[open] > summary { border-bottom: 1px solid var(--border); }

.psi-tabs {
  display: inline-flex;
  margin: 14px 14px 4px;
  padding: 3px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.psi-tabs button {
  padding: 5px 16px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}
.psi-tabs button.active { background: var(--accent); color: white; }

.psi-pane { padding: 6px 14px 14px; }

/* category gauges */
.gauges {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 0 18px;
}
.gauge-item { text-align: center; width: 96px; }
.gauge {
  --value: 0;
  --color: var(--neutral);
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: conic-gradient(var(--color) calc(var(--value) * 1%), rgba(255, 255, 255, 0.07) 0);
  display: grid;
  place-items: center;
}
.gauge::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--surface-2);
}
.gauge span {
  position: relative;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  color: var(--color);
}
.gauge-label { font-size: 12px; color: var(--text-muted); }

/* collapsible sections */
.psi-section {
  border-top: 1px solid var(--border);
}
.psi-section > summary {
  padding: 11px 0;
  font-size: 13px;
  font-weight: 600;
}
.psi-section > summary .note { font-weight: 400; margin-left: 4px; }
.psi-section-body { padding: 0 0 14px; }

.psi-group-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 14px 0 6px;
}
.psi-group-title .note { text-transform: none; letter-spacing: 0; font-weight: 400; }

.score-chip { font-weight: 700; margin-left: 6px; }

/* real-user data */
.crux-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.crux-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.crux-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.cwv-badge {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.cwv-badge.ok { background: rgba(61, 220, 151, 0.12); color: var(--good); }
.cwv-badge.bad { background: rgba(255, 107, 129, 0.12); color: var(--bad); }
.crux-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.crux-row:last-child { border-bottom: none; }
.crux-name { font-size: 12px; color: var(--text-muted); }
.crux-value { font-size: 16px; font-weight: 600; margin: 2px 0 6px; }
.crux-value.ok { color: var(--good); }
.crux-value.warn { color: var(--warn); }
.crux-value.bad { color: var(--bad); }
.crux-cat { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.dist { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, 0.06); }
.d-good { background: var(--good); }
.d-ni { background: var(--warn); }
.d-poor { background: var(--bad); }
.dist-legend { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* lab metrics */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.lab-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.lab-name { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.lab-value { font-family: var(--font-heading); font-size: 20px; font-weight: 700; margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* filmstrip */
.filmstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.filmstrip figure { margin: 0; flex-shrink: 0; text-align: center; }
.filmstrip img {
  height: 150px;
  width: auto;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: white;
  display: block;
}
.filmstrip .final img { height: 150px; border-color: var(--accent); }
.filmstrip figcaption { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* individual audits */
.psi-audit { border-bottom: 1px solid var(--border); }
.psi-audit > summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
}
.psi-audit > summary:hover .psi-audit-title { color: var(--accent-light); }
.psi-audit .check-icon { width: 16px; flex-shrink: 0; font-weight: 700; }
.psi-audit.ok .check-icon { color: var(--good); }
.psi-audit.warn .check-icon { color: var(--warn); }
.psi-audit.bad .check-icon { color: var(--bad); }
.psi-audit.info .check-icon { color: var(--neutral); }
.psi-audit-title { flex: 1; min-width: 0; }
.psi-display { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.savings {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-light);
  white-space: nowrap;
}
.psi-group-tag {
  font-size: 10px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  white-space: nowrap;
}
.psi-audit-body { padding: 0 0 12px 24px; font-size: 12px; color: var(--text-muted); }
.psi-audit-body p { margin: 0 0 8px; }
.psi-audit-body a,
.psi-section-body a { color: var(--accent-light); }
.psi-audit-body code,
.psi-section-body code {
  font-size: 11px;
  background: var(--bg-deep);
  padding: 1px 5px;
  border-radius: 4px;
}
.psi-explanation { color: var(--warn); }
.psi-warnings { margin: 0 0 8px; padding-left: 18px; color: var(--warn); }
.stack-advice {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
  color: var(--text);
}

.psi-table-wrap { overflow-x: auto; }
.psi-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.psi-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-faint);
  padding: 4px 8px 4px 0;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.psi-table td {
  padding: 4px 8px 4px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  word-break: break-all;
}

/* horizontal bars (requests by type, main thread) */
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 3px 0; }
.bar-label { width: 150px; flex-shrink: 0; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 6px; background: rgba(255, 255, 255, 0.06); border-radius: 3px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-light)); border-radius: 3px; }
.bar-value { width: 70px; text-align: right; flex-shrink: 0; }

.passed-list { margin: 0; padding: 0; list-style: none; columns: 2; font-size: 12px; color: var(--text-muted); }
.passed-list li { padding: 2px 0; break-inside: avoid; }

.stack-list { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.stack-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 2px 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.stack-pill img { width: 14px; height: 14px; }

.psi-run-warnings { font-size: 12px; color: var(--warn); margin-bottom: 10px; }
.psi-run-warnings ul { margin: 4px 0 0; padding-left: 18px; }

.test-info {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  font-size: 12px;
  margin: 0;
}
.test-info dt { color: var(--text-muted); }
.test-info dd { margin: 0; word-break: break-all; }

@media (max-width: 600px) {
  .passed-list { columns: 1; }
  .bar-label { width: 100px; }
  .psi-audit > summary { flex-wrap: wrap; }
}

/* ---- Live preview: full-width, browser-like ---- */

#preview-panel {
  margin: 32px -24px -24px;       /* break out of body padding: edge to edge */
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
}

#preview-panel.hidden { display: none; }

#preview-panel .note {
  margin: 0;
  padding: 6px 16px;
  background: rgba(255, 181, 71, 0.08);
  color: #e8c98f;
  border-bottom: 1px solid var(--border);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.dots { display: flex; gap: 6px; }
.dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
}
.dots span:nth-child(2) { background: #febc2e; }
.dots span:nth-child(3) { background: #28c840; }

.address {
  flex: 1;
  min-width: 160px;
  padding: 6px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-toggle { display: flex; }
.device-toggle button {
  padding: 5px 12px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  margin-left: -1px;
}
.device-toggle button:first-child { border-radius: 999px 0 0 999px; }
.device-toggle button:last-child { border-radius: 0 999px 999px 0; }
.device-toggle button.active { background: var(--accent); color: white; border-color: var(--accent); }

.bar-btn {
  padding: 5px 12px;
  font-family: inherit;
  font-size: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.bar-btn:hover { border-color: var(--accent); color: var(--accent-light); }

/* The stage fills the rest of the viewport. The iframe is rendered at a real
   device width and scaled down (by app.js) so the full layout fits. */
.preview-stage {
  position: relative;
  height: calc(100vh - 90px);
  min-height: 500px;
  overflow: hidden;
  background: var(--bg-deep);
}

#preview-frame {
  position: absolute;
  top: 0;
  left: 0;
  border: none;
  background: white;
  transform-origin: top left;
  box-shadow: 0 0 0 1px var(--border-strong);
}

/* Fullscreen: show the site at the real screen size, no scaling. */
#preview-panel:fullscreen { margin: 0; display: flex; flex-direction: column; }
#preview-panel:fullscreen .note { display: none; }
#preview-panel:fullscreen .preview-stage { flex: 1; height: auto; }

@media (max-width: 600px) {
  body { padding: 16px; }
  #preview-panel { margin: 24px -16px -16px; }
  .brand { margin-bottom: 32px; }
}
