:root {
  --bg: #fff1e1;
  --bg-accent: #f6d4b2;
  --ink: #23160d;
  --muted: #5e4b3e;
  --card: #fff9f2;
  --accent: #d45500;
  --accent-dark: #a63a00;
  --accent-soft: #ffd7b8;
  --ring: rgba(212, 85, 0, 0.28);
  --shadow: 0 26px 70px rgba(32, 20, 10, 0.18);
  --line: rgba(35, 22, 13, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Sora", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: var(--bg);
  padding-top: var(--banner-offset, 0px);
}

.env-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 12px 16px;
  background: #fff4e4;
  color: #7a2f00;
  border-bottom: 1px solid rgba(212, 85, 0, 0.3);
  font-size: 0.95rem;
  text-align: center;
}

.env-banner-text {
  display: inline;
}

.env-banner-host {
  font-weight: 700;
}

.scene {
  min-height: 100vh;
  padding: 40px 20px 40px;
  background:
    radial-gradient(620px 420px at 15% 10%, rgba(255, 214, 181, 0.9) 0%, rgba(255, 214, 181, 0) 60%),
    radial-gradient(600px 420px at 85% 15%, rgba(255, 187, 140, 0.8) 0%, rgba(255, 187, 140, 0) 65%),
    linear-gradient(140deg, #fff4e9 0%, #f6d4b2 100%);
  position: relative;
  overflow: hidden;
}

.scene::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.35),
    rgba(255, 255, 255, 0.35) 1px,
    transparent 1px,
    transparent 8px
  );
  opacity: 0.3;
  pointer-events: none;
}

.assistant {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  animation: fadeUp 0.8s ease both;
  position: relative;
  z-index: 6;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.topbar-text {
  display: grid;
  gap: 2px;
}

.topbar-logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background:
    linear-gradient(140deg, rgba(212, 85, 0, 0.22), rgba(255, 215, 184, 0.95));
  border: 1px solid rgba(35, 22, 13, 0.12);
  box-shadow: 0 12px 20px rgba(212, 85, 0, 0.16);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.topbar-logo-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.topbar-name {
  font-size: 0.95rem;
  text-transform: uppercase;
}

.topbar-legend {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.topbar-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.topbar-menu {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(35, 22, 13, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.topbar-menu:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 20px rgba(212, 85, 0, 0.15);
  transform: translateY(-1px);
}

.topbar-menu:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.topbar-menu-icon {
  display: grid;
  gap: 4px;
}

.topbar-menu-icon span {
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 999px;
}

.topbar-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fffdf8;
  border: 1px solid rgba(35, 22, 13, 0.12);
  border-radius: 14px;
  padding: 8px;
  min-width: 160px;
  display: grid;
  gap: 4px;
  box-shadow: 0 18px 30px rgba(35, 22, 13, 0.18);
  z-index: 7;
}

.topbar-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: left;
  font-family: inherit;
}

.topbar-menu-item:hover {
  background: rgba(212, 85, 0, 0.08);
}

.topbar-menu-item:disabled,
.topbar-menu-item[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.topbar-menu-item:disabled:hover,
.topbar-menu-item[aria-disabled="true"]:hover {
  background: transparent;
}

.topbar-menu-item-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.topbar-menu-divider {
  height: 1px;
  background: rgba(35, 22, 13, 0.12);
  margin: 4px 6px;
}

.hero {
  display: grid;
  gap: 14px;
  animation: fadeUp 0.8s ease both;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-logo {
  display: var(--brand-logo-display, none);
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background-color: rgba(212, 85, 0, 0.12);
  background-image: var(--brand-logo-image, none);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border: 1px solid rgba(35, 22, 13, 0.12);
  box-shadow: 0 12px 20px rgba(212, 85, 0, 0.16);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.brand-pill {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.brand-sub {
  color: var(--muted);
  font-weight: 500;
}

.hero h1 {
  font-family: "Sora", "Trebuchet MS", sans-serif;
  font-size: clamp(1.5rem, 2.3vw, 2.2rem);
  margin: 0;
  line-height: 1.05;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 640px;
}

.mode-hint {
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(35, 22, 13, 0.08);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wizard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
}

.wizard.wizard-one-step {
  grid-template-columns: minmax(0, 1fr);
}

.step {
  background: var(--card);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(35, 22, 13, 0.08);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  animation: fadeUp 0.8s ease both;
}

.step-upload {
  animation-delay: 0.1s;
}


.step-head {
  display: grid;
  gap: 8px;
  align-self: start;
}

.step-body {
  display: grid;
  gap: 16px;
  align-content: center;
  align-self: center;
  justify-items: stretch;
}

.step-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 40px;
  width: 100%;
  align-self: end;
}

.step-actions .btn {
  width: 100%;
  height: 46px;
}

.step-tag {
  width: fit-content;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(212, 85, 0, 0.12);
  color: var(--accent-dark);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  line-height: 22px;
}

.step h2 {
  font-size: 1.4rem;
  margin: 0;
}

.step p {
  margin: 0;
  color: var(--muted);
}

.panel {
  background: #fffdf8;
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(35, 22, 13, 0.08);
  display: grid;
  gap: 18px;
}

.panel-top {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.upload-panel {
  --upload-panel-height: 240px;
  height: var(--upload-panel-height);
}

.upload-panel > * {
  height: 100%;
}

.requirements {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
  display: grid;
  gap: 6px;
}

.requirements-title {
  font-weight: 600;
  color: var(--ink);
}

.requirements-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.panel-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(35, 22, 13, 0.08);
  font-size: 0.9rem;
  color: var(--muted);
}

.dropzone {
  border: 2px dashed rgba(35, 22, 13, 0.2);
  border-radius: 18px;
  padding: 22px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.dropzone-panel {
  background: #fffdf8;
  border-color: rgba(35, 22, 13, 0.18);
  min-height: 0;
  height: 100%;
  padding: 28px;
}

.heynow-credentials {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(35, 22, 13, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.field input {
  border: 1px solid rgba(35, 22, 13, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  width: 100%;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.field-hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.field-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.field-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.dropzone:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

.dropzone.dragover {
  border-color: var(--accent);
  box-shadow: 0 16px 34px rgba(212, 85, 0, 0.18);
  transform: translateY(-2px);
}

.drop-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(212, 85, 0, 0.14);
  color: var(--accent-dark);
}

.drop-icon svg {
  width: 28px;
  height: 28px;
}

.drop-title {
  font-weight: 600;
  font-size: 1.02rem;
}

.drop-sub {
  color: var(--muted);
  margin-top: 4px;
}

.file-row {
  display: grid;
  gap: 12px;
  align-items: start;
}

.file-row .btn {
  justify-self: start;
}

.file-name {
  font-weight: 600;
}

.file-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.btn {
  border: none;
  padding: 12px 20px;
  font-family: inherit;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 20px rgba(212, 85, 0, 0.22);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

.btn-primary:disabled {
  background: rgba(35, 22, 13, 0.3);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  border: 1px solid rgba(212, 85, 0, 0.4);
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.7);
}

.btn-ghost:hover {
  background: rgba(212, 85, 0, 0.08);
}

.btn-download {
  background: var(--accent-soft);
  border: 1px solid rgba(212, 85, 0, 0.55);
  color: var(--accent-dark);
  box-shadow: 0 10px 18px rgba(212, 85, 0, 0.18);
}

.btn-download:hover {
  background: #ffd0aa;
}

.btn-cta {
  padding: 10px 18px;
  line-height: 1.1;
}

.btn-reupload {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 999px;
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.status:empty {
  display: none;
}

.status.success {
  color: var(--accent-dark);
}

.status.error {
  color: #b24b4b;
}

.preview {
  display: grid;
  gap: 12px;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.divider {
  height: 1px;
  width: 100%;
  background: rgba(35, 22, 13, 0.12);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.preview-title {
  font-weight: 600;
}

.preview-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.preview-empty {
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(35, 22, 13, 0.15);
  color: var(--muted);
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
}

.preview-table-wrap {
  border-radius: 16px;
  border: 1px solid rgba(35, 22, 13, 0.12);
  background: #fff;
  overflow: auto;
  max-height: none;
  height: 100%;
  min-height: 0;
}

.preview-empty,
.preview-table-wrap {
  grid-row: 2 / 3;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.preview-table thead {
  position: sticky;
  top: 0;
  background: #fff6ec;
  z-index: 1;
}

.preview-table th,
.preview-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(35, 22, 13, 0.08);
  font-size: 0.9rem;
  white-space: nowrap;
}

.preview-table tbody tr:nth-child(even) {
  background: rgba(255, 239, 223, 0.5);
}

.video-card {
  display: grid;
  gap: 12px;
}


.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(35, 22, 13, 0.12);
  background: linear-gradient(135deg, #ffd8b8, #fff1e1 55%, #ffd0aa);
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(4px);
}

.video-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(212, 85, 0, 0.16);
  display: grid;
  place-items: center;
}

.video-icon span {
  width: 0;
  height: 0;
  border-left: 16px solid var(--accent-dark);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  margin-left: 4px;
}

.video-title {
  font-weight: 600;
  color: var(--ink);
}

.video-sub {
  font-size: 0.9rem;
}

.video-caption {
  font-size: 0.9rem;
  color: var(--muted);
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  padding-top: 10px;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.footer-version {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 12;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 22, 13, 0.45);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  z-index: 1;
  background: var(--card);
  border-radius: 24px;
  padding: 24px;
  width: min(520px, 92vw);
  box-shadow: var(--shadow);
  border: 1px solid rgba(35, 22, 13, 0.12);
  display: grid;
  gap: 12px;
}

.modal-card h3 {
  margin: 0;
  font-size: 1.4rem;
}

.modal-sub {
  margin: 0;
  color: var(--muted);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(35, 22, 13, 0.08);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.nps-scale {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(32px, 1fr));
  gap: 6px;
}

.nps-score {
  border: 1px solid rgba(35, 22, 13, 0.18);
  background: #fff;
  border-radius: 10px;
  padding: 8px 0;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.nps-score:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 10px 16px rgba(212, 85, 0, 0.2);
}

.nps-score.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 12px 20px rgba(212, 85, 0, 0.22);
}

.nps-comment {
  display: grid;
  gap: 6px;
}

.nps-comment label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.nps-comment textarea {
  border: 1px solid rgba(35, 22, 13, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  resize: vertical;
  min-height: 90px;
}

.nps-comment textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  max-width: min(320px, calc(100% - 48px));
  padding: 12px 16px;
  border-radius: 14px;
  background: #1f160f;
  color: #fff5eb;
  font-size: 0.95rem;
  box-shadow: 0 18px 30px rgba(31, 22, 15, 0.32);
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.success {
  background: #1f3b1f;
  color: #e9f8e9;
}

.toast.error {
  background: #4b1f1f;
  color: #ffe9e9;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .assistant {
    gap: 24px;
  }

  .hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
  }

  .panel {
    padding: 18px;
  }

  .dropzone {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .drop-icon {
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  .scene {
    padding: 36px 16px 60px;
  }

  .step {
    padding: 18px;
  }

  .preview-table {
    min-width: 420px;
  }
}
