:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #f8fafc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --surface: #1e293b;
  --surface-raised: #263449;
  --gold: #facc15;
  --gold-hover: #fde047;
  --muted: #cbd5e1;
  --border: #3a4a60;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  padding-bottom: calc(82px + env(safe-area-inset-bottom));
  background: #0f172a;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: var(--gold);
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--gold-hover);
}

.site-header {
  padding: 22px 18px 18px;
  text-align: center;
  background: #111827;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.25rem, 5vw, 1.8rem);
  line-height: 1.25;
}

.site-header h1 span {
  color: var(--gold);
}

.site-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.demo-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
}

.app-main {
  width: min(100% - 28px, 760px);
  margin: 0 auto;
  padding: 22px 0 32px;
}

.screen[hidden] {
  display: none !important;
}

.section-heading {
  margin: 0 0 18px;
}

.section-heading h2 {
  margin: 2px 0 5px;
  font-size: clamp(1.7rem, 7vw, 2.2rem);
}

.section-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card {
  margin: 14px 0;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.video-section > h2,
.webpages-section > h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
}

.webpages-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.webpage-card {
  margin: 0;
}

.webpage-card h3 {
  margin-top: 0;
}

.webpage-card p {
  color: var(--muted);
}

.lead-storage-note {
  margin: 2px 0 0;
  font-size: 0.82rem;
}

.video-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.video-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111827;
}

.video-frame iframe,
.video-preview {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-preview {
  position: relative;
  overflow: hidden;
  padding: 0;
  background: #111827;
  color: #fff;
}

.video-preview:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}

.video-thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 46px;
  border-radius: 12px;
  background: #d71920;
  transform: translate(-50%, -50%);
}

.video-play-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid #fff;
  content: "";
  transform: translate(-40%, -50%);
}

.video-info {
  padding: 12px;
}

.video-info h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.video-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.12rem;
}

.card p {
  line-height: 1.55;
}

.card p:last-child {
  margin-bottom: 0;
}

.focus-card {
  border-color: rgba(250, 204, 21, 0.28);
}

.focus-card h3 {
  margin: 4px 0 16px;
  font-size: 1.3rem;
}

.card-heading,
.list-heading,
.item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-heading h3,
.list-heading h3 {
  margin: 0;
}

.tracker-mark {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 50%;
  color: var(--gold);
  font-weight: 800;
}

progress {
  display: block;
  width: 100%;
  height: 12px;
  margin: 18px 0 8px;
  overflow: hidden;
  border: 0;
  border-radius: 99px;
  background: #111827;
  accent-color: var(--gold);
}

progress::-webkit-progress-bar {
  border-radius: 99px;
  background: #111827;
}

progress::-webkit-progress-value {
  border-radius: 99px;
  background: var(--gold);
}

progress::-moz-progress-bar {
  border-radius: 99px;
  background: var(--gold);
}

.muted,
.feedback {
  color: var(--muted);
}

.feedback {
  min-height: 0;
  margin: 0;
  font-size: 0.9rem;
}

.feedback:not(:empty) {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #172235;
}

.feedback.is-error {
  border-color: #b45353;
  color: #fecaca;
}

.feedback.is-success {
  border-color: #15803d;
  color: #bbf7d0;
}

.button-row,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button-primary {
  background: var(--gold);
  color: #111827;
}

.button-primary:hover {
  background: var(--gold-hover);
  color: #111827;
}

.button-secondary {
  border-color: var(--border);
  background: #fff;
  color: #111827;
}

.button-secondary:hover {
  background: #e2e8f0;
  color: #111827;
}

.button-quiet {
  border-color: var(--border);
  background: transparent;
  color: var(--muted);
}

.button-quiet:hover {
  background: var(--surface-raised);
  color: #fff;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.form-stack h3 {
  margin-bottom: 3px;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #111827;
  color: #f8fafc;
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(250, 204, 21, 0.75);
  outline-offset: 2px;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

.list-heading {
  margin: 24px 2px 10px;
}

.count-pill {
  min-width: 28px;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--surface-raised);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 750;
  text-align: center;
}

.helper-grid {
  display: grid;
  gap: 12px;
}

.helper-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.helper-card h3 {
  color: var(--gold);
}

.helper-card p {
  margin: 0 0 12px;
}

.helper-card .helper-example {
  flex: 1;
  padding: 10px;
  border-left: 2px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: #172235;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.helper-card .button {
  margin-top: 2px;
}

.helper-draft-panel {
  scroll-margin-top: 16px;
}

.saved-draft-text {
  color: #f8fafc !important;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.business-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.item-list {
  display: grid;
  gap: 10px;
}

.item-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.item-card p {
  margin: 7px 0 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.item-heading strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.item-heading select {
  width: auto;
  min-width: 130px;
  min-height: 40px;
  padding: 7px 28px 7px 9px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.item-actions .button:disabled {
  cursor: default;
  opacity: 0.75;
}

.delete-button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #854545;
  border-radius: 9px;
  background: transparent;
  color: #fecaca;
  font-weight: 700;
}

.delete-button:hover {
  background: #3b2028;
}

.empty-state {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.task-row input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--gold);
}

.task-label {
  flex: 1;
  color: #f8fafc;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.task-label.is-complete {
  color: #94a3b8;
  text-decoration: line-through;
}

.price {
  margin: 4px 0;
  color: var(--gold);
  font-size: 1.65rem;
  font-weight: 850;
}

.price span {
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 600;
}

.contact-card p {
  margin: 9px 0;
}

.chat-card {
  padding: 14px;
}

.chat-log {
  display: grid;
  max-height: 42vh;
  min-height: 110px;
  gap: 10px;
  margin-bottom: 14px;
  overflow-y: auto;
}

.chat-message {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-message p {
  margin: 0;
}

.chat-message.user {
  justify-self: end;
  background: #35445a;
}

.chat-message.assistant {
  justify-self: start;
  border: 1px solid rgba(250, 204, 21, 0.22);
  background: #111827;
}

.back-to-top {
  display: block;
  min-height: 44px;
  margin: 20px auto 0;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.back-to-top:hover {
  background: var(--surface);
  color: #fff;
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  min-height: 68px;
  align-items: stretch;
  justify-content: space-around;
  padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: #111827;
  box-shadow: 0 -8px 22px rgba(0, 0, 0, 0.2);
}

.nav-button {
  display: flex;
  min-width: 0;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 3px 1px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #cbd5e1;
}

.nav-button span {
  font-size: 1.15rem;
  line-height: 1.1;
}

.nav-button small {
  font-size: clamp(0.52rem, 2vw, 0.68rem);
  line-height: 1.15;
}

.nav-button:hover,
.nav-button.is-current {
  background: #263449;
  color: var(--gold);
}

@media (min-width: 700px) {
  .app-main {
    padding-top: 30px;
  }

  .card {
    padding: 22px;
  }

  .bottom-nav {
    right: 50%;
    left: 50%;
    width: min(100%, 760px);
    transform: translateX(-50%);
    border-right: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
  }
}

@media (min-width: 600px) {
  .helper-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .bottom-nav {
    padding-right: 2px;
    padding-left: 2px;
  }

  .nav-button small {
    font-size: 0.46rem;
    letter-spacing: -0.035em;
  }

  .nav-button span {
    font-size: 1rem;
  }
}

@media (min-width: 901px) {
  .app-main {
    width: 100%;
    max-width: 1200px;
    padding-right: 24px;
    padding-left: 24px;
  }

  .dashboard-priority-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .dashboard-priority-grid > .card {
    margin: 0;
  }

  .webpages-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .helper-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bottom-nav {
    width: min(100%, 1200px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
