:root {
  color-scheme: light;
  --bg: #f8f1e6;
  --bg-2: #efe1cd;
  --panel: rgba(255, 252, 247, 0.82);
  --card: #fffaf3;
  --text: #2d2924;
  --muted: #7d7162;
  --line: rgba(184, 146, 79, 0.22);
  --amber: #d69a2d;
  --amber-2: #b77b1d;
  --green: #6f8f74;
  --shadow-amber-10: 0 14px 40px rgba(245, 158, 11, 0.1);
  --shadow-amber-20: 0 18px 52px rgba(245, 158, 11, 0.2);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 10% 5%, rgba(255, 255, 255, 0.78), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(214, 154, 45, 0.18), transparent 30%),
    linear-gradient(145deg, var(--bg), var(--bg-2) 52%, #f7ead4);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app {
  width: min(100%, 480px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: rgba(255, 250, 243, 0.35);
  overflow-anchor: none;
}

.view {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 18px 18px calc(154px + env(safe-area-inset-bottom, 0px));
}

.view[hidden] {
  display: none !important;
}

.auth-view,
.hero-view {
  display: grid;
  align-content: center;
  gap: 22px;
}

.auth-view,
.capture-view {
  padding-bottom: 18px;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  width: min(calc(100% - 12px), 468px);
  min-height: 48px;
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid rgba(184, 146, 79, 0.24);
  border-radius: 18px;
  background: rgba(255, 250, 243, 0.9);
  box-shadow: 0 20px 60px rgba(98, 69, 20, 0.18);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.bottom-nav button {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
  background: transparent;
  color: #70542a;
  font-size: 10px;
  font-weight: 850;
}

.bottom-nav svg {
  width: 20px;
  height: 20px;
}

.bottom-create-btn {
  justify-self: center;
  width: 46px;
  height: 46px;
  margin-top: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--amber-2)) !important;
  color: #fff !important;
  box-shadow: 0 18px 36px rgba(245, 158, 11, 0.36);
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.bottom-create-btn svg {
  width: 23px;
  height: 23px;
  stroke-width: 2.4;
  display: block;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 2px solid var(--amber);
  display: grid;
  place-items: center;
  margin: 0 auto;
}

.brand-mark span {
  width: 20px;
  height: 20px;
  border: 2px solid var(--amber);
  transform: translate(-3px, -3px);
}

.brand-mark.small {
  width: 28px;
  height: 28px;
  margin: 0;
}

.brand-mark.small span {
  width: 13px;
  height: 13px;
  transform: translate(-2px, -2px);
}

.brand-title,
.mini-brand {
  display: grid;
  justify-items: center;
  gap: 2px;
  letter-spacing: 0.16em;
}

.brand-title strong {
  font-family: Georgia, serif;
  font-size: 34px;
}

.brand-title span,
.mini-brand span {
  font-size: 11px;
  letter-spacing: 0.36em;
}

.auth-card,
.question-form,
.prompt-card,
.selected-style,
.soon-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow-amber-10);
  backdrop-filter: blur(18px);
}

.auth-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.auth-card h1,
.question-form h2,
.capture-status h2 {
  margin: 0;
  font-size: 24px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  font-size: 13px;
  font-weight: 700;
  color: #4b4236;
}

label small {
  color: var(--muted);
  line-height: 1.4;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(184, 146, 79, 0.28);
  border-radius: 16px;
  padding: 14px 15px;
  outline: none;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  resize: none;
}

input:focus,
textarea:focus {
  border-color: rgba(214, 154, 45, 0.75);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 52px;
  border-radius: 16px;
  padding: 0 20px;
  font-weight: 800;
}

.primary-btn {
  background: linear-gradient(135deg, var(--amber), var(--amber-2));
  color: #fff;
  box-shadow: 0 16px 36px rgba(245, 158, 11, 0.25);
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.secondary-btn {
  border: 1px solid rgba(184, 146, 79, 0.35);
  background: rgba(255, 255, 255, 0.7);
  color: #7c581d;
}

.ghost-btn {
  border: 1px solid rgba(184, 146, 79, 0.35);
  background: rgba(255, 255, 255, 0.36);
  color: #7c581d;
}

.topbar,
.screen-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mini-brand {
  display: flex;
  align-items: center;
  justify-items: start;
  gap: 8px;
  font-size: 13px;
}

.mini-brand div,
.mini-brand {
  line-height: 1;
}

.mini-brand strong {
  display: block;
  font-family: Georgia, serif;
  letter-spacing: 0.14em;
}

.mini-brand span {
  display: block;
  color: var(--muted);
}

.icon-btn,
.back-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
  color: #7c581d;
  border: 1px solid var(--line);
}

.credits-pill {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 14px;
  border: 1px solid rgba(184, 146, 79, 0.34);
  background: rgba(255, 255, 255, 0.72);
  color: #7c581d;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(181, 58, 58, 0.1);
  color: #963333;
  font-size: 13px;
  font-weight: 750;
}

.modal-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 20, 15, 0.52);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 24px 80px rgba(98, 69, 20, 0.24);
}

.modal-card h2,
.modal-card p {
  margin: 0;
}

.modal-card p {
  color: var(--muted);
  line-height: 1.45;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.face-model-card {
  gap: 16px;
}

.face-model-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.face-model-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 118px;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
}

.face-model-option {
  min-height: 154px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 12px 8px;
  border: 1px solid rgba(184, 146, 79, 0.25);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  scroll-snap-align: start;
}

.face-model-option img {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(214, 154, 45, 0.42);
  background: var(--card);
}

.face-model-option span {
  font-size: 13px;
  font-weight: 900;
}

.face-model-option small {
  color: var(--muted);
  font-size: 11px;
}

.hero-copy {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 18px;
  padding: 36px 2px;
}

.hero-brand {
  margin-bottom: 10px;
}

.hero-copy h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(38px, 13vw, 62px);
  line-height: 0.98;
}

.hero-copy em {
  font-style: normal;
  background: linear-gradient(135deg, #b77b1d, #e7bd63, #8f641a);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-copy p {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.hero-actions {
  display: grid;
  width: 100%;
  gap: 12px;
  margin-top: 10px;
}

.content-view {
  display: grid;
  align-content: start;
  gap: 18px;
  padding-bottom: 34px;
}

.section-title {
  display: grid;
  gap: 8px;
  text-align: center;
  padding: 18px 0 4px;
}

.section-title.compact {
  padding-top: 6px;
}

.section-title p {
  margin: 0;
  color: var(--amber-2);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-title h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 30px;
  line-height: 1.05;
  text-transform: uppercase;
}

.section-title span {
  color: var(--muted);
  line-height: 1.45;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.style-card {
  overflow: hidden;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-amber-10);
}

.style-card img {
  width: 100%;
  aspect-ratio: 9 / 16;
  display: block;
  object-fit: cover;
  object-position: center top;
}

.style-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.style-body h3,
.selected-style h3 {
  margin: 0;
  font-size: 16px;
}

.style-body p,
.selected-style p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 13px;
}

.style-body button {
  justify-self: start;
  min-height: 38px;
  border-radius: 12px;
  padding: 0 10px;
  background: rgba(214, 154, 45, 0.12);
  color: #8b5f19;
  font-weight: 800;
  font-size: 12px;
}

.soon-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.selected-style {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.selected-style img {
  width: 74px;
  height: 92px;
  border-radius: 16px;
  object-fit: cover;
}

.selected-style button {
  min-height: 36px;
  border-radius: 12px;
  padding: 0 12px;
  background: rgba(214, 154, 45, 0.12);
  color: #8b5f19;
  font-weight: 800;
}

.question-form {
  display: grid;
  gap: 16px;
  padding: 18px;
  overflow-anchor: none;
}

.question-fields {
  display: grid;
  gap: 14px;
}

#essayForm {
  padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  scroll-margin-bottom: calc(130px + env(safe-area-inset-bottom, 0px));
}

#formView {
  overflow-anchor: none;
  overscroll-behavior-y: contain;
}

#reviewView {
  padding-bottom: calc(190px + env(safe-area-inset-bottom, 0px));
}

.camera-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 24px;
  background: #1a1b18;
  box-shadow: var(--shadow-amber-20);
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scaleX(-1);
}

.face-guide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform: translateY(-6%);
  pointer-events: none;
}

.face-oval {
  width: min(64%, 310px);
  aspect-ratio: 0.72;
  border: 3px solid rgba(231, 189, 99, 0.98);
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.22);
}

.face-guide::after {
  content: "";
  position: absolute;
  width: min(78%, 380px);
  aspect-ratio: 0.78;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 48%;
}

.center-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.22);
}

.center-line.horizontal {
  width: 26%;
  height: 1px;
}

.center-line.vertical {
  width: 1px;
  height: 24%;
}

.notice {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
}

.smile-cue {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: min(78%, 320px);
  transform: translate(-50%, -50%);
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 22px;
  background: rgba(22, 20, 17, 0.58);
  color: #fff;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.movement-arrow {
  position: absolute;
  z-index: 3;
  width: 124px;
  height: 124px;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 1;
  --arrow-fill: 0%;
  transition: opacity 150ms ease;
}

.movement-arrow.is-hidden {
  opacity: 0;
}

.arrow-shape {
  width: 92px;
  height: 58px;
  background:
    linear-gradient(
      90deg,
      #f8d26f 0 var(--arrow-fill),
      rgba(255, 255, 255, 0.26) var(--arrow-fill) 100%
    );
  clip-path: polygon(0 31%, 58% 31%, 58% 7%, 100% 50%, 58% 93%, 58% 69%, 0 69%);
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
  transform-origin: center;
}

.arrow-shape::after {
  content: none;
}

.movement-arrow.right {
  top: 50%;
  right: 5%;
  transform: translateY(-50%);
}

.movement-arrow.left {
  top: 50%;
  left: 5%;
  transform: translateY(-50%);
}

.movement-arrow.up {
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
}

.movement-arrow.down {
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
}

.movement-arrow.right .arrow-shape {
  animation: arrow-right 800ms ease-in-out infinite;
}

.movement-arrow.left .arrow-shape {
  transform: rotate(180deg);
  animation: arrow-left 800ms ease-in-out infinite;
}

.movement-arrow.up .arrow-shape {
  transform: rotate(-90deg);
  animation: arrow-up 800ms ease-in-out infinite;
}

.movement-arrow.down .arrow-shape {
  transform: rotate(90deg);
  animation: arrow-down 800ms ease-in-out infinite;
}

@keyframes arrow-right {
  0%, 100% { translate: -10px 0; }
  50% { translate: 10px 0; }
}

@keyframes arrow-left {
  0%, 100% { translate: 10px 0; }
  50% { translate: -10px 0; }
}

@keyframes arrow-up {
  0%, 100% { translate: 0 10px; }
  50% { translate: 0 -10px; }
}

@keyframes arrow-down {
  0%, 100% { translate: 0 -10px; }
  50% { translate: 0 10px; }
}

.capture-status {
  display: grid;
  gap: 6px;
  padding: 0 4px;
}

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

.progress,
.meter-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(75, 66, 54, 0.12);
}

#progressBar,
.meter-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), #75a878);
  transition: width 160ms ease;
}

.motion-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.motion-meter {
  display: grid;
  gap: 6px;
}

.motion-meter span {
  font-size: 12px;
  color: var(--muted);
}

.capture-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.gallery-item {
  display: block;
  min-width: 0;
  padding: 0;
  border-radius: 16px;
  background: transparent;
}

.capture-grid img,
.gallery-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
}

.gallery-item img {
  display: block;
}

.gallery-viewer {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
  background: rgba(18, 16, 13, 0.96);
  color: #fff;
}

.gallery-viewer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gallery-close-btn,
.gallery-download-btn {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  backdrop-filter: blur(12px);
}

.gallery-download-btn {
  margin-left: auto;
}

.gallery-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.gallery-carousel::-webkit-scrollbar {
  display: none;
}

.gallery-slide {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 2px;
  scroll-snap-align: center;
}

.gallery-slide img {
  width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.gallery-counter {
  justify-self: center;
  min-width: 72px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  font-size: 12px;
  font-weight: 850;
}

.prompt-card {
  overflow: hidden;
}

.prompt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 14px 0;
}

.prompt-head span {
  font-weight: 900;
}

#promptPreview {
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
  color: #4e463b;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.result-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: 100%;
  max-height: min(64vh, 680px);
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-amber-20);
}

.result-frame.is-ready {
  aspect-ratio: auto;
  max-height: none;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.result-frame img {
  width: 100%;
  height: auto;
  max-height: min(64vh, 680px);
  object-fit: contain;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-amber-20);
}

.empty-state,
#resultPlaceholder {
  color: var(--muted);
  text-align: center;
}

#resultPlaceholder {
  max-width: 100%;
  padding: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.result-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.icon-action,
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.icon-action svg,
.share-btn svg {
  flex: 0 0 auto;
}

.share-panel,
.rating-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 250, 243, 0.78);
  box-shadow: var(--shadow-amber-10);
}

.share-panel h3,
.rating-panel h3 {
  margin: 0;
  font-size: 16px;
}

.share-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.share-btn {
  min-height: 48px;
  padding: 0 10px;
  border-radius: 14px;
  border: 1px solid rgba(184, 146, 79, 0.28);
  background: rgba(255, 255, 255, 0.72);
  color: #5e4b2f;
  font-size: 12px;
  font-weight: 850;
}

.rating-stars {
  display: flex;
  gap: 4px;
}

.rating-stars button {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  color: rgba(125, 113, 98, 0.42);
  font-size: 24px;
  line-height: 1;
}

.rating-stars button.is-active {
  color: #d69a2d;
  background: rgba(245, 158, 11, 0.14);
}

.rating-status {
  margin: 0;
  color: var(--green);
  font-weight: 800;
  text-align: center;
}

.ai-generation {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 28%, rgba(245, 158, 11, 0.2), transparent 32%),
    linear-gradient(145deg, rgba(37, 31, 22, 0.96), rgba(18, 18, 16, 0.98));
  color: #fff;
}

.ai-stage {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.ai-stage strong {
  font-size: 17px;
  line-height: 1.1;
}

.ai-stage p {
  max-width: 280px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.35;
}

.ai-orbit {
  position: relative;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(248, 210, 111, 0.35);
  border-radius: 50%;
  animation: ai-spin 2.8s linear infinite;
}

.ai-orbit::before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: rgba(248, 210, 111, 0.18);
  box-shadow: 0 0 34px rgba(248, 210, 111, 0.35);
}

.ai-orbit span {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f8d26f;
}

.ai-orbit span:nth-child(1) { top: -4px; left: 50%; }
.ai-orbit span:nth-child(2) { right: 4px; bottom: 8px; }
.ai-orbit span:nth-child(3) { left: 4px; bottom: 8px; }

.ai-analysis-board {
  min-height: 0;
  min-height: 0;
  display: grid;
  align-items: stretch;
}

.ai-preview {
  position: relative;
  overflow: hidden;
  min-height: 0;
  border-radius: 20px;
  background:
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ai-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.64;
  filter: saturate(0.88) contrast(1.03);
}

.ai-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.42));
  z-index: 1;
}

.ai-badge {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 45%;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(248, 210, 111, 0.42);
  border-radius: 50%;
  background: rgba(18, 18, 16, 0.5);
  box-shadow: 0 0 42px rgba(248, 210, 111, 0.28);
  backdrop-filter: blur(10px);
  transform: translate(-50%, -50%);
}

.ai-badge::before,
.ai-badge::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(248, 210, 111, 0.2);
  border-radius: inherit;
  animation: ai-ring 2.2s ease-in-out infinite;
}

.ai-badge::after {
  inset: -20px;
  animation-delay: 0.55s;
}

.ai-badge span {
  color: #f8d26f;
  font-size: 23px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.ai-scan {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(248, 210, 111, 0.9), transparent);
  box-shadow: 0 0 20px rgba(248, 210, 111, 0.72);
  animation: ai-scan 2.2s ease-in-out infinite;
}

.ai-preview span {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ai-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.ai-process-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.ai-process-list span,
.ai-warning {
  border: 1px solid rgba(248, 210, 111, 0.2);
  background: rgba(248, 210, 111, 0.08);
  color: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 7px 6px;
  text-align: center;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.ai-warning {
  border-radius: 14px;
  color: #fff;
  background: rgba(248, 210, 111, 0.15);
}

#aiProgressBar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f8d26f, #fff0b0);
  box-shadow: 0 0 18px rgba(248, 210, 111, 0.52);
  transition: width 450ms ease;
}

@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

@keyframes ai-scan {
  0%, 100% { top: 12%; }
  50% { top: 88%; }
}

@keyframes ai-pulse {
  0%, 100% { opacity: 0.38; transform: scale(0.98); }
  50% { opacity: 0.78; transform: scale(1.03); }
}

@keyframes ai-ring {
  0%, 100% { opacity: 0.28; transform: scale(0.92); }
  50% { opacity: 0.9; transform: scale(1.08); }
}

@media (min-width: 760px) {
  .app {
    width: min(100%, 980px);
  }

  .view {
    padding: 28px;
  }

  .hero-actions {
    grid-template-columns: 1fr 1fr;
    max-width: 440px;
  }

  .capture-view {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }

  .capture-view .screen-nav,
  .capture-view .camera-wrap {
    grid-column: 1 / -1;
  }
}
