/* Live app screen replica (matches Flutter AppColors / layout) */

:root {
  --pv-cream: #fbf5e6;
  --pv-beige: #f0e6d3;
  --pv-warm-white: #fdfaf4;
  --pv-purple: #8b7bb5;
  --pv-purple-light: #bdb0d8;
  --pv-purple-dark: #6a5a9e;
  --pv-green: #6ba888;
  --pv-red: #c0656a;
  --pv-text: #3d2c1e;
  --pv-text-muted: #7a6554;
  --pv-card: #ffffff;
  --pv-border: #e0d5c5;
  --pv-crisis-end: #ede0f5;
  --pv-night-a: #2c2540;
  --pv-night-b: #1a1830;
  --pv-device-w: 320px;
  --pv-device-h: 640px;
  --pv-radius-phone: 36px;
}

/* ── Editor + preview rail (Zoho-style split) ── */
.zg-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(var(--pv-device-w) + 48px);
  gap: 28px;
  align-items: start;
}

.zg-editor-main {
  min-width: 0;
}

.zg-preview-rail {
  position: sticky;
  top: calc(var(--zg-topbar-h) + 12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.zg-preview-rail-head {
  width: 100%;
  text-align: center;
}

.zg-preview-rail-title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--zg-muted);
}

.zg-preview-rail-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--zg-warn-bg);
  color: var(--zg-warn);
  border: 1px solid #fed7aa;
}

.zg-preview-rail-note {
  margin: 8px 0 0;
  font-size: 0.6875rem;
  color: var(--zg-muted);
  line-height: 1.4;
  max-width: var(--pv-device-w);
}

.zg-preview-rail-screen-name {
  margin: 4px 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--zg-text);
}

/* ── Phone chrome ── */
.pv-device {
  width: var(--pv-device-w);
  flex-shrink: 0;
}

.pv-device-shell {
  border-radius: var(--pv-radius-phone);
  padding: 10px;
  background: linear-gradient(145deg, #2a2a2e 0%, #1c1c1f 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 20px 50px rgba(26, 35, 50, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.pv-device-notch {
  width: 96px;
  height: 22px;
  margin: 0 auto 8px;
  background: #0d0d0f;
  border-radius: 0 0 14px 14px;
}

.pv-device-screen {
  width: 100%;
  height: var(--pv-device-h);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  background: var(--pv-cream);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--pv-text);
  -webkit-font-smoothing: antialiased;
}

.pv-mount {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ── App gradients ── */
.pv-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
}

.pv-gradient--warm {
  background: linear-gradient(180deg, var(--pv-cream) 0%, var(--pv-beige) 100%);
}

.pv-gradient--crisis {
  background: linear-gradient(180deg, var(--pv-cream) 0%, var(--pv-crisis-end) 100%);
}

.pv-gradient--night {
  background: linear-gradient(180deg, var(--pv-night-a) 0%, var(--pv-night-b) 100%);
  color: #fff;
}

.pv-gradient--night .pv-muted,
.pv-gradient--night .pv-header-title {
  color: rgba(255, 255, 255, 0.75);
}

.pv-gradient--night .pv-heading {
  color: #fff;
}

.pv-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.pv-scroll-pad {
  padding: 8px 20px 24px;
}

.pv-scroll-pad--wide {
  padding: 8px 24px 28px;
}

/* ── Header row (BackHeader) ── */
.pv-header {
  display: flex;
  align-items: center;
  padding: 6px 4px;
  min-height: 48px;
  flex-shrink: 0;
}

.pv-header-spacer {
  width: 40px;
  flex-shrink: 0;
}

.pv-header-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--pv-text);
}

.pv-icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--pv-text);
  opacity: 0.85;
  font-size: 18px;
}

/* ── Typography ── */
.pv-h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--pv-text);
}

.pv-h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--pv-text);
}

.pv-h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--pv-text);
}

.pv-body {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--pv-text-muted);
}

.pv-body:last-child {
  margin-bottom: 0;
}

.pv-muted {
  color: var(--pv-text-muted);
}

.pv-center {
  text-align: center;
}

/* ── Components ── */
.pv-logo-circle {
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--pv-purple);
  color: var(--pv-warm-white);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: 32px;
  letter-spacing: 2px;
  box-shadow: 0 6px 16px rgba(106, 90, 158, 0.35);
}

.pv-logo-circle--sm {
  width: 72px;
  height: 72px;
  font-size: 14px;
  line-height: 1.1;
  letter-spacing: 0;
}

.pv-logo-circle--home {
  width: 40px;
  height: 40px;
  font-size: 17px;
  margin: 0;
  box-shadow: 0 4px 10px rgba(139, 123, 181, 0.35);
}

.pv-card {
  background: var(--pv-card);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(61, 44, 30, 0.08);
  margin-bottom: 16px;
}

.pv-card--elevated {
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 4px 14px rgba(61, 44, 30, 0.1);
}

.pv-quote-box {
  padding: 16px;
  border-radius: 12px;
  background: rgba(139, 123, 181, 0.12);
  border-left: 4px solid var(--pv-purple);
  font-style: italic;
  font-size: 15px;
  color: var(--pv-purple-dark);
  line-height: 1.55;
  margin: 16px 0;
}

.pv-crisis-box {
  padding: 16px;
  border-radius: 14px;
  background: rgba(139, 123, 181, 0.1);
  border-left: 4px solid var(--pv-purple);
  margin-top: 20px;
}

.pv-crisis-box-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pv-purple-dark);
  margin-bottom: 8px;
}

.pv-crisis-line {
  display: flex;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--pv-text);
}

.pv-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  cursor: default;
  margin-top: 12px;
}

.pv-btn--purple {
  background: var(--pv-purple);
  color: var(--pv-warm-white);
  box-shadow: 0 2px 8px rgba(61, 44, 30, 0.12);
}

.pv-btn--ghost {
  background: transparent;
  color: var(--pv-purple);
  box-shadow: none;
}

.pv-btn--green {
  background: var(--pv-green);
  color: var(--pv-warm-white);
}

.pv-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--pv-border);
  border-radius: 12px;
  background: #faf8f4;
  font-size: 14px;
  color: var(--pv-text-muted);
  margin-bottom: 12px;
}

.pv-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.pv-slider-row {
  margin: 16px 0;
}

.pv-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--pv-text-muted);
  margin-bottom: 4px;
}

.pv-slider-track {
  height: 4px;
  background: var(--pv-purple-light);
  border-radius: 2px;
  position: relative;
  margin: 8px 0;
}

.pv-slider-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--pv-purple);
  position: absolute;
  top: -7px;
  left: 55%;
}

.pv-quick-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.pv-quick-card {
  flex: 1;
  background: var(--pv-card);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  font-size: 10px;
  color: var(--pv-text-muted);
  line-height: 1.3;
  box-shadow: 0 2px 6px rgba(61, 44, 30, 0.08);
}

.pv-quick-icon {
  font-size: 22px;
  margin-bottom: 6px;
  color: var(--pv-purple);
}

.pv-home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 0;
}

.pv-greeting-lg {
  font-size: 22px;
  color: var(--pv-text-muted);
}

.pv-name-lg {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.pv-morning-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: rgba(107, 168, 136, 0.15);
  border-radius: 14px;
  margin: 14px 0;
  font-size: 13px;
}

.pv-timer {
  width: 130px;
  height: 130px;
  margin: 24px auto;
  border-radius: 50%;
  background: var(--pv-purple-light);
  border: 3px solid var(--pv-purple);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--pv-warm-white);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 4px;
}

.pv-timer-sub {
  font-size: 11px;
  letter-spacing: 0;
  font-weight: 400;
  margin-top: 4px;
}

.pv-audio-bar {
  padding: 12px;
  border-radius: 14px;
  background: var(--pv-card);
  font-size: 12px;
  color: var(--pv-text-muted);
  margin: 12px 0;
}

.pv-switch-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--pv-border);
  gap: 12px;
}

.pv-switch-row:last-child {
  border-bottom: none;
}

.pv-switch {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--pv-purple);
  flex-shrink: 0;
  position: relative;
}

.pv-switch::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  right: 3px;
}

.pv-drawer-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 20;
}

.pv-drawer-scrim {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
}

.pv-drawer-panel {
  width: 82%;
  max-width: 280px;
  background: var(--pv-cream);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.pv-drawer-user {
  display: flex;
  gap: 14px;
  padding: 20px;
  align-items: center;
}

.pv-drawer-item {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--pv-text);
  border-left: 3px solid transparent;
}

.pv-drawer-item--hi {
  font-weight: 700;
  color: var(--pv-purple-dark);
  background: rgba(139, 123, 181, 0.12);
  border-left-color: var(--pv-purple);
}

.pv-emoji-lg {
  font-size: 40px;
  text-align: center;
}

.pv-score-lg {
  font-size: 32px;
  font-weight: 700;
  color: var(--pv-purple);
  text-align: center;
}

.pv-stars {
  letter-spacing: 2px;
  color: var(--pv-purple);
  font-size: 18px;
}

.pv-overview-preview .pv-device-screen {
  height: 520px;
}

@media (max-width: 1200px) {
  .zg-editor-layout {
    grid-template-columns: 1fr;
  }

  .zg-preview-rail {
    order: -1;
    position: static;
    flex-direction: column;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 8px;
  }
}

@media (max-width: 700px) {
  .pv-device {
    transform: scale(0.92);
    transform-origin: top center;
  }
}
