:root {
  --ink: #2c2621;
  --muted: #746a61;
  --soft: #f6eee6;
  --soft-2: #ead9ca;
  --paper: rgba(255, 250, 245, 0.88);
  --paper-solid: #fffaf5;
  --line: rgba(70, 56, 43, 0.12);
  --accent: #a8755d;
  --accent-dark: #342d28;
  --good: #4e8b73;
  --warn: #b27b3d;
  --shadow: 0 20px 48px rgba(52, 45, 39, 0.14);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: #191614;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.loading {
  min-height: 100svh;
  display: grid;
  place-items: center;
  color: #fffaf5;
}

.shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 250, 245, 0.1), transparent 28%),
    linear-gradient(180deg, #211d1a, #151311);
}

.app-card {
  width: min(100%, 1060px);
  min-height: min(920px, calc(100svh - 36px));
  display: grid;
  grid-template-columns: 380px 1fr;
  overflow: hidden;
  border-radius: 28px;
  background: var(--soft);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.34);
}

.side {
  padding: 30px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.75), transparent 28%),
    linear-gradient(180deg, #fbf3ea, #ead9ca);
  border-right: 1px solid var(--line);
}

.main {
  padding: 30px;
  overflow: auto;
}

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

.mark {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--accent-dark);
  color: #fffaf5;
  font-weight: 850;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 22px;
  letter-spacing: 0;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.nav a,
.nav button {
  width: 100%;
  text-decoration: none;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
  color: rgba(44, 38, 33, 0.76);
  font-weight: 700;
}

.nav a.is-active,
.nav button.is-active {
  background: var(--accent-dark);
  color: #fffaf5;
}

.mini-note {
  margin-top: 30px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 250, 245, 0.58);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.page-title {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.02;
  letter-spacing: 0;
}

.page-copy {
  margin: 0 0 28px;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 16px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

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

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 12px 28px rgba(52, 45, 39, 0.06);
}

.panel h2,
.panel h3 {
  margin: 0 0 10px;
}

.panel p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.form {
  display: grid;
  gap: 14px;
}

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

.field span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 760;
}

.input,
.textarea,
.file {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 12px 13px;
  outline: 0;
}

.textarea {
  min-height: 104px;
  resize: vertical;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.button {
  min-height: 44px;
  border-radius: 14px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fffaf5;
  background: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border: 1px solid var(--line);
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.status {
  min-height: 24px;
  color: var(--good);
  font-weight: 760;
  font-size: 14px;
}

.status.is-error {
  color: #a24d42;
}

.pet-list {
  display: grid;
  gap: 12px;
}

.pet-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 245, 0.72);
}

.thumb {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #ded0c4;
  object-fit: cover;
}

.pet-row h3,
.pet-row p {
  margin: 0;
}

.pet-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.prompt-box {
  white-space: pre-wrap;
  overflow: auto;
  max-height: 280px;
  padding: 14px;
  border-radius: 14px;
  background: #221e1b;
  color: #fff5ea;
  font-size: 13px;
  line-height: 1.55;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.media-grid img,
.media-grid video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
  background: #ded0c4;
}

.space-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(171, 128, 80, 0.2), transparent 36%),
    linear-gradient(180deg, #17130f, #070605);
}

.phone {
  position: relative;
  width: min(100vw, 430px);
  height: 100svh;
  max-height: 932px;
  overflow: hidden;
  background: #f4eadf;
  isolation: isolate;
}

.presence-phone {
  background: #1b1510;
}

@media (min-width: 520px) {
  .phone {
    height: min(92svh, 932px);
    border-radius: 34px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
  }
}

.stage,
.pet-clip,
.avatar-fallback {
  position: absolute;
  inset: 0;
}

.stage {
  background:
    radial-gradient(ellipse at 50% 60%, rgba(255, 255, 255, 0.34), transparent 46%),
    linear-gradient(180deg, #fff7ee 0%, #f1e4d6 72%, #ead7c5 100%);
}

.presence-phone .stage {
  background:
    radial-gradient(circle at 28% 20%, rgba(226, 177, 107, 0.28), transparent 9%),
    radial-gradient(circle at 70% 22%, rgba(232, 186, 120, 0.2), transparent 10%),
    radial-gradient(circle at 62% 58%, rgba(187, 137, 72, 0.18), transparent 12%),
    linear-gradient(180deg, #302216 0%, #1f1711 52%, #14100d 100%);
}

.presence-phone .stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 44%, transparent 42%, rgba(20, 15, 11, 0.26) 82%),
    linear-gradient(180deg, rgba(16, 12, 9, 0.34), transparent 22%, transparent 74%, rgba(12, 9, 7, 0.38));
}

.pet-clip,
.avatar-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.presence-phone .pet-clip,
.presence-phone .avatar-fallback {
  object-position: center center;
  transform: translateY(-4%) scale(1.035);
  transform-origin: center center;
}

.pet-clip {
  opacity: 0;
  transition: opacity 2400ms ease;
}

.pet-clip.is-visible {
  opacity: 1;
}

.avatar-fallback {
  opacity: 0.96;
}

.phone.video-ready .avatar-fallback {
  opacity: 0;
}

.veil-top,
.veil-bottom {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  pointer-events: none;
}

.veil-top {
  top: 0;
  height: 220px;
  background: linear-gradient(180deg, rgba(250, 244, 236, 0.96), rgba(250, 244, 236, 0));
}

.veil-bottom {
  bottom: 0;
  height: 260px;
  background: linear-gradient(0deg, rgba(250, 244, 236, 0.97), rgba(250, 244, 236, 0));
}

.presence-phone .veil-top {
  height: 190px;
  background: linear-gradient(180deg, rgba(12, 9, 7, 0.46), rgba(12, 9, 7, 0));
}

.presence-phone .veil-bottom {
  height: 168px;
  background: linear-gradient(0deg, rgba(10, 8, 6, 0.58), rgba(10, 8, 6, 0));
}

.presence-title {
  position: absolute;
  z-index: 8;
  top: max(54px, calc(46px + env(safe-area-inset-top)));
  left: 24px;
  right: 24px;
  text-align: center;
  pointer-events: none;
}

.presence-title h1,
.presence-title p,
.presence-copy p,
.presence-copy span {
  margin: 0;
}

.presence-title h1 {
  font-size: clamp(32px, 8.8vw, 42px);
  line-height: 1;
  letter-spacing: 0;
  color: rgba(255, 246, 234, 0.94);
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.32);
}

.presence-title p {
  margin-top: 9px;
  color: rgba(255, 246, 234, 0.78);
  font-size: 17px;
  letter-spacing: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.presence-copy {
  position: absolute;
  z-index: 8;
  left: 24px;
  right: 24px;
  bottom: max(48px, calc(42px + env(safe-area-inset-bottom)));
  text-align: center;
  color: rgba(255, 246, 234, 0.72);
  pointer-events: none;
}

.presence-copy p {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 540;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.presence-copy span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 246, 234, 0.66);
  font-size: 15px;
  line-height: 1.35;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.24);
}

.presence-phone.is-preparing .avatar-fallback {
  filter: saturate(0.92) brightness(0.9);
}

.presence-phone.is-preparing .veil-top {
  height: 260px;
  background: linear-gradient(180deg, rgba(12, 9, 7, 0.66), rgba(12, 9, 7, 0));
}

.presence-phone.is-preparing .veil-bottom {
  height: 360px;
  background: linear-gradient(0deg, rgba(10, 8, 6, 0.78), rgba(10, 8, 6, 0));
}

.presence-phone.is-preparing .presence-copy {
  top: 48%;
  bottom: auto;
  transform: translateY(-50%);
}

.presence-preparing-phone {
  background:
    radial-gradient(circle at 28% 18%, rgba(218, 174, 109, 0.16), transparent 14%),
    radial-gradient(circle at 68% 26%, rgba(220, 191, 135, 0.13), transparent 13%),
    linear-gradient(180deg, #2d2118 0%, #17110d 62%, #0b0807 100%);
}

.preparing-backdrop,
.preparing-backdrop::after,
.preparing-soft-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.preparing-backdrop {
  z-index: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 32% 22%, rgba(221, 177, 111, 0.22), transparent 12%),
    radial-gradient(circle at 68% 24%, rgba(226, 194, 135, 0.15), transparent 13%),
    radial-gradient(circle at 62% 60%, rgba(185, 136, 78, 0.13), transparent 15%),
    linear-gradient(180deg, #312419 0%, #1d1510 58%, #0d0a08 100%);
}

.preparing-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(22px) saturate(0.82) brightness(0.48);
  transform: scale(1.14);
  opacity: 0.42;
}

.preparing-backdrop::after {
  content: "";
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 240, 214, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(18, 13, 9, 0.38), transparent 25%, transparent 65%, rgba(8, 6, 5, 0.56));
}

.preparing-soft-light {
  z-index: 2;
  background:
    radial-gradient(circle at 26% 22%, rgba(236, 194, 126, 0.18), transparent 9%),
    radial-gradient(circle at 72% 25%, rgba(240, 215, 168, 0.13), transparent 11%),
    radial-gradient(circle at 55% 58%, rgba(196, 143, 78, 0.12), transparent 12%);
}

.presence-preparing-phone .presence-copy {
  top: 50%;
  bottom: auto;
  transform: translateY(-42%);
}

.presence-preparing-phone .presence-status-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  gap: 16px;
  padding-left: 16px;
  padding-right: 16px;
}

.presence-preparing-phone .presence-status-panel p {
  max-width: 300px;
  font-size: 23px;
  line-height: 1.08;
  font-weight: 760;
}

.presence-preparing-phone .presence-status-panel span {
  max-width: 305px;
  font-size: 15px;
  line-height: 1.42;
  color: rgba(255, 246, 234, 0.72);
}

.presence-status-panel {
  width: min(100%, 330px);
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 13px;
  padding: 22px 20px;
  color: rgba(255, 246, 234, 0.82);
  text-align: center;
  background: rgba(22, 17, 13, 0.28);
  border: 1px solid rgba(255, 246, 234, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.presence-status-panel p {
  font-size: 18px;
  line-height: 1.18;
}

.presence-status-panel span {
  margin-top: 0;
  max-width: 260px;
  font-size: 14px;
}

.presence-status-panel .button {
  margin-top: 4px;
  min-height: 42px;
  padding: 0 22px;
  pointer-events: auto;
}

.presence-wait-mark {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255, 246, 234, 0.2);
}

.presence-wait-mark::before,
.presence-wait-mark::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 246, 234, 0.34);
  animation: presencePulse 2.6s ease-in-out infinite;
}

.presence-wait-mark::after {
  inset: 17px;
  animation-delay: 0.42s;
}

.presence-wait-mark span {
  position: absolute;
  inset: 23px;
  border-radius: 50%;
  background: rgba(255, 246, 234, 0.78);
  box-shadow: 0 0 24px rgba(255, 246, 234, 0.26);
}

.presence-wait-mark.is-still::before,
.presence-wait-mark.is-still::after {
  animation: none;
  opacity: 0.48;
}

@keyframes presencePulse {
  0%, 100% {
    opacity: 0.34;
    transform: scale(0.92);
  }
  48% {
    opacity: 0.88;
    transform: scale(1.08);
  }
}

.presence-menu {
  position: absolute;
  z-index: 9;
  top: max(38px, calc(30px + env(safe-area-inset-top)));
  right: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 246, 234, 0.16);
  color: rgba(255, 246, 234, 0.86);
  font-size: 0;
  letter-spacing: 1px;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.presence-menu::before {
  content: "...";
  font-size: 18px;
  transform: translateY(-2px);
}

.topbar {
  position: absolute;
  z-index: 6;
  top: max(20px, env(safe-area-inset-top));
  left: 24px;
  right: 24px;
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  gap: 14px;
}

.round {
  width: 46px;
  height: 46px;
  border-radius: 17px;
  background: rgba(255, 250, 245, 0.76);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(77, 60, 46, 0.08);
  font-weight: 900;
}

.title {
  text-align: center;
}

.title h1,
.title p {
  margin: 0;
}

.title h1 {
  font-size: 40px;
  line-height: 1.05;
}

.title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 18px;
}

.opened {
  position: absolute;
  z-index: 6;
  top: calc(max(20px, env(safe-area-inset-top)) + 102px);
  left: 22px;
  right: 22px;
  text-align: center;
  color: rgba(44, 38, 33, 0.58);
  font-size: 18px;
  font-weight: 800;
}

.presence {
  position: absolute;
  z-index: 6;
  left: 28px;
  right: 28px;
  bottom: calc(124px + env(safe-area-inset-bottom));
  display: flex;
  gap: 12px;
  align-items: center;
}

.presence-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a8755d;
}

.presence strong {
  display: block;
  font-size: 17px;
}

.presence span {
  display: block;
  margin-top: 4px;
  color: rgba(44, 38, 33, 0.58);
}

.dock {
  position: absolute;
  z-index: 7;
  left: 18px;
  right: 18px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr 64px;
  gap: 12px;
}

.dock button {
  height: 58px;
  border-radius: 22px;
  background: rgba(255, 250, 245, 0.82);
  color: var(--ink);
  font-weight: 850;
  font-size: 17px;
}

.dock .primary {
  background: rgba(44, 38, 33, 0.94);
  color: #fffaf5;
}

.sheet {
  position: absolute;
  z-index: 12;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 76%;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  background: rgba(255, 250, 245, 0.97);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -20px 50px rgba(52, 45, 39, 0.18);
  transform: translateY(105%);
  transition: transform 280ms ease;
  overflow: auto;
}

.sheet.is-open {
  transform: translateY(0);
}

.sheet h2 {
  margin: 0 0 14px;
}

.presence-sheet {
  color: #2d251f;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  margin: 0 auto 18px;
  background: rgba(44, 38, 33, 0.18);
}

.sheet-copy {
  margin: -4px 0 16px;
  color: rgba(44, 38, 33, 0.64);
  font-size: 14px;
  line-height: 1.48;
}

.issue-status-card {
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid rgba(78, 139, 115, 0.2);
  background: rgba(78, 139, 115, 0.08);
  color: #2d251f;
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.issue-status-card span {
  color: rgba(44, 38, 33, 0.56);
  font-size: 12px;
  font-weight: 800;
}

.issue-status-card strong {
  font-size: 16px;
}

.issue-status-card p {
  margin: 0;
  color: rgba(44, 38, 33, 0.68);
  line-height: 1.45;
}

.issue-status-toast {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 8;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 250, 245, 0.88);
  color: #2d251f;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  line-height: 1.4;
}

.sheet-option {
  width: 100%;
  padding: 15px;
  border-radius: 18px;
  border: 1px solid rgba(44, 38, 33, 0.1);
  background: rgba(44, 38, 33, 0.045);
  color: #2d251f;
  text-align: left;
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.sheet-option strong {
  font-size: 15px;
}

.sheet-option span {
  color: rgba(44, 38, 33, 0.62);
  font-size: 13px;
  line-height: 1.35;
}

.sheet-option.quiet {
  background: rgba(44, 38, 33, 0.025);
}

.issue-list {
  display: grid;
  gap: 9px;
  margin: 14px 0 18px;
}

.issue-list label {
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 15px;
  background: rgba(44, 38, 33, 0.05);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: rgba(44, 38, 33, 0.76);
  font-weight: 720;
}

.price-card {
  display: grid;
  gap: 3px;
  padding: 18px;
  border-radius: 20px;
  margin: 16px 0;
  background: #2d251f;
  color: #fff6ea;
}

.price-card strong {
  font-size: 30px;
  line-height: 1;
}

.price-card span {
  color: rgba(255, 246, 234, 0.72);
}

.sheet-back {
  width: 100%;
  margin-top: 10px;
}

.sheet-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: rgba(44, 38, 33, 0.68);
  font-size: 13px;
  line-height: 1.4;
}

.sheet-status.is-error {
  color: #9f3b2f;
}

.onboarding-page {
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(218, 170, 106, 0.22), transparent 32%),
    linear-gradient(180deg, #18130f, #090807);
}

.onboarding-phone {
  position: relative;
  width: min(100vw, 430px);
  max-width: 100vw;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  min-width: 0;
  max-height: 932px;
  overflow: hidden;
  padding: max(22px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
  color: #fff6ea;
  background:
    radial-gradient(circle at 22% 16%, rgba(255, 221, 163, 0.22), transparent 16%),
    radial-gradient(circle at 82% 24%, rgba(215, 160, 93, 0.18), transparent 18%),
    linear-gradient(180deg, #2a2118, #14100d 58%, #0b0907);
  isolation: isolate;
}

@media (min-width: 520px) {
  .onboarding-phone {
    height: min(92svh, 932px);
    height: min(92dvh, 932px);
    min-height: 0;
    border-radius: 34px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  }
}

.onboarding-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 34%, rgba(255, 235, 199, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 38%, rgba(0, 0, 0, 0.22));
}

.onboarding-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  font-size: 13px;
  color: rgba(255, 246, 234, 0.72);
}

.onboarding-top strong {
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 246, 234, 0.92);
  font-size: 12px;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.onboarding-steps button {
  min-width: 0;
  height: 26px;
  border-radius: 999px;
  border: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 246, 234, 0.1);
  color: rgba(255, 246, 234, 0.52);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
  font-family: inherit;
}

.onboarding-steps button.is-active {
  background: rgba(255, 246, 234, 0.9);
  color: #2f2419;
}

.onboarding-steps button.is-done {
  background: rgba(211, 164, 105, 0.58);
  color: #fff6ea;
}

.onboarding-steps button:disabled {
  cursor: default;
  opacity: 0.48;
}

.onboarding-steps button:not(:disabled):hover {
  background: rgba(255, 246, 234, 0.2);
}

.onboarding-steps button.is-active:hover {
  background: rgba(255, 246, 234, 0.9);
}

.onboarding-card {
  align-self: stretch;
  display: flex;
  min-height: 0;
  min-width: 0;
  width: 100%;
  flex-direction: column;
  justify-content: flex-start;
  padding: 14px 4px 18px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.onboarding-card h1 {
  margin: 0 0 18px;
  font-size: clamp(32px, 9vw, 42px);
  line-height: 1.02;
  letter-spacing: 0;
  color: #fff6ea;
}

.onboarding-card.step-0 {
  justify-content: center;
  padding: 18px 4px;
  overflow: hidden;
}

.onboarding-card.step-1 {
  justify-content: flex-start;
  padding: 8px 4px 18px;
  overflow-y: auto;
}

.onboarding-card.step-0 h1 {
  font-size: clamp(38px, 11vw, 54px);
}

.onboarding-card.step-1 h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 9vw, 42px);
}

.onboarding-card.step-2 h1,
.onboarding-card.step-3 h1,
.onboarding-card.step-4 h1 {
  margin-bottom: 14px;
  font-size: clamp(32px, 9vw, 42px);
}

.onboarding-card.step-0 .onboarding-hero {
  margin-top: auto;
  margin-bottom: 28px;
}

.onboarding-card.step-0 .onboarding-primary {
  margin-bottom: 4px;
}

.onboarding-card.step-1 .onboarding-actions {
  position: static;
  margin-top: 16px;
  padding: 0;
  background: transparent;
}

.onboarding-card p {
  margin: 0 0 22px;
  color: rgba(255, 246, 234, 0.72);
  line-height: 1.55;
}

.onboarding-hero {
  margin-top: auto;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px !important;
  color: rgba(255, 218, 168, 0.82) !important;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.onboarding-form,
.onboarding-card .field {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.onboarding-card .field span {
  color: rgba(255, 246, 234, 0.7);
}

.onboarding-card .input,
.onboarding-card .textarea {
  border: 1px solid rgba(255, 232, 202, 0.2);
  border-radius: 16px;
  background: rgba(255, 246, 234, 0.09);
  color: #fff6ea;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.onboarding-card .input {
  min-height: 54px;
  padding: 0 14px;
}

.onboarding-card .textarea {
  min-height: 86px;
}

.onboarding-card .input::placeholder,
.onboarding-card .textarea::placeholder {
  color: rgba(255, 246, 234, 0.38);
}

.onboarding-card select.input {
  color: rgba(255, 246, 234, 0.88);
}

.compact-grid {
  gap: 11px;
}

.optional-feeling {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.optional-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  color: rgba(255, 246, 234, 0.7);
}

.optional-heading span {
  font-weight: 800;
}

.optional-heading small {
  min-width: 0;
  color: rgba(255, 246, 234, 0.46);
  font-size: 11px;
  text-align: right;
}

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

.optional-feeling {
  border-radius: 20px;
  transition: box-shadow 180ms ease, background 180ms ease, outline-color 180ms ease;
}

.optional-feeling.is-nudged {
  outline: 1px solid rgba(255, 227, 189, 0.8);
  outline-offset: 8px;
  background: rgba(255, 227, 189, 0.05);
  box-shadow: 0 0 0 7px rgba(255, 227, 189, 0.08);
  animation: feelingNudge 900ms ease;
}

@keyframes feelingNudge {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 227, 189, 0);
  }
  35% {
    box-shadow: 0 0 0 10px rgba(255, 227, 189, 0.13);
  }
  100% {
    box-shadow: 0 0 0 7px rgba(255, 227, 189, 0.08);
  }
}

.feeling-chip {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 246, 234, 0.12);
  background: rgba(255, 246, 234, 0.09);
  color: rgba(255, 246, 234, 0.72);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.feeling-chip.is-selected {
  border-color: rgba(255, 227, 189, 0.72);
  background: rgba(255, 246, 234, 0.88);
  color: #2f2419;
}

.personality-grid {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
}

.personality-card {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid rgba(255, 246, 234, 0.14);
  border-radius: 18px;
  background: rgba(255, 246, 234, 0.1);
  color: #fff6ea;
  text-align: left;
}

.personality-card.is-selected {
  border-color: rgba(255, 227, 189, 0.72);
  background: rgba(255, 246, 234, 0.2);
}

.personality-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.personality-card span {
  display: block;
  color: rgba(255, 246, 234, 0.62);
  font-size: 13px;
  line-height: 1.38;
}

.upload-zone {
  width: 100%;
  min-width: 0;
  min-height: 128px;
  border: 1px dashed rgba(255, 246, 234, 0.32);
  border-radius: 24px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 24px;
  background: rgba(255, 246, 234, 0.1);
  text-align: center;
}

.frame-upload {
  min-height: 116px;
  margin-bottom: 14px;
  border-color: rgba(255, 227, 189, 0.42);
  background:
    linear-gradient(145deg, rgba(255, 227, 189, 0.14), rgba(255, 246, 234, 0.07));
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-zone strong {
  font-size: 18px;
}

.frame-photo-preview {
  position: relative;
  margin: -4px 0 16px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 246, 234, 0.16);
  background: rgba(255, 246, 234, 0.08);
}

.frame-photo-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.photo-hints {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 4px;
}

.photo-hints span {
  min-height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 246, 234, 0.09);
  border: 1px solid rgba(255, 246, 234, 0.1);
  color: rgba(255, 246, 234, 0.68);
  font-size: 12px;
  font-weight: 750;
}

.photo-guidance {
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 7px 10px;
  align-items: center;
  margin: 10px 0 4px;
  padding: 0 2px;
  color: rgba(255, 246, 234, 0.56);
  font-size: 12px;
  line-height: 1.4;
}

.photo-guidance strong {
  width: 100%;
  color: rgba(255, 246, 234, 0.78);
  font-size: 12px;
  letter-spacing: 0;
}

.photo-guidance span {
  position: relative;
  min-width: 0;
  padding-left: 13px;
}

.photo-guidance span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 227, 189, 0.72);
}

.photo-order-note {
  max-width: 100%;
  margin: 2px 0 0;
  color: rgba(255, 246, 234, 0.58);
  font-size: 12px;
  line-height: 1.45;
}

.upload-zone span,
.onboarding-copy {
  color: rgba(255, 246, 234, 0.64);
  font-size: 14px;
}

.onboarding-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  width: 100%;
  gap: 8px;
  margin: 14px 0 8px;
}

.pet-photo-preview {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid transparent;
  background: rgba(255, 246, 234, 0.1);
  cursor: grab;
}

.pet-photo-preview.is-first {
  border-color: rgba(255, 232, 196, 0.92);
  box-shadow: 0 0 0 2px rgba(255, 232, 196, 0.12);
}

.pet-photo-preview.is-dragging {
  opacity: 0.58;
}

.pet-photo-preview.is-drop-target {
  border-color: rgba(255, 246, 234, 0.9);
}

.onboarding-preview img,
.pet-photo-preview img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.photo-remove-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(12, 9, 6, 0.62);
  color: #fff8ef;
  font-size: 21px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.photo-remove-button:active {
  transform: scale(0.94);
}

.photo-order-badge,
.photo-main-button {
  position: absolute;
  left: 6px;
  z-index: 2;
  border-radius: 999px;
  border: 0;
  font-family: inherit;
  font-weight: 750;
}

.photo-order-badge {
  top: 6px;
  min-width: 28px;
  padding: 4px 7px;
  background: rgba(12, 9, 6, 0.62);
  color: #fff8ef;
  font-size: 10px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.pet-photo-preview.is-first .photo-order-badge {
  background: rgba(255, 246, 234, 0.92);
  color: #2f2419;
}

.photo-main-button {
  bottom: 6px;
  max-width: calc(100% - 12px);
  min-width: 0;
  padding: 5px 8px;
  background: rgba(255, 246, 234, 0.88);
  color: #2f2419;
  font-size: 10px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-look-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 227, 189, 0.22);
  border-radius: 26px;
  background: rgba(255, 246, 234, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.main-look-card.is-primary-main {
  border-color: rgba(255, 216, 137, 0.82);
  box-shadow:
    0 0 0 1px rgba(255, 216, 137, 0.2),
    0 16px 38px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.main-look-image {
  width: 100%;
  max-height: min(48svh, 430px);
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  object-fit: cover;
  background: rgba(255, 246, 234, 0.08);
}

.main-look-copy {
  display: grid;
  gap: 6px;
}

.main-look-copy strong {
  color: #fff6ea;
  font-size: 18px;
  line-height: 1.15;
}

.main-look-copy p {
  margin: 0;
  color: rgba(255, 246, 234, 0.64);
  font-size: 13px;
  line-height: 1.5;
}

.main-look-copy small {
  color: rgba(255, 218, 156, 0.88);
  font-size: 12px;
  line-height: 1.45;
}

.main-photo-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 4px;
}

.main-photo-picker button {
  border: 2px solid transparent;
  border-radius: 15px;
  padding: 0;
  overflow: hidden;
  background: rgba(255, 246, 234, 0.08);
  color: rgba(255, 246, 234, 0.74);
  cursor: pointer;
  font-family: inherit;
  position: relative;
}

.main-photo-picker button.is-selected {
  border-color: rgba(255, 214, 135, 0.98);
  background: rgba(255, 220, 150, 0.18);
  box-shadow:
    0 0 0 2px rgba(255, 214, 135, 0.24),
    0 10px 24px rgba(0, 0, 0, 0.22);
}

.main-photo-picker button.is-selected::after {
  content: "Main";
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 232, 174, 0.96);
  color: #2c2118;
  font-size: 9px;
  font-weight: 850;
}

.main-photo-picker button.role-recommended:not(.is-selected) {
  border-color: rgba(168, 217, 167, 0.58);
}

.main-photo-picker button.role-conflict:not(.is-selected),
.main-photo-picker button.role-selected-warning {
  border-color: rgba(255, 183, 117, 0.66);
}

.main-photo-picker button.role-temporary:not(.is-selected) {
  border-color: rgba(184, 199, 255, 0.64);
}

.main-photo-picker button.role-not-ideal:not(.is-selected) {
  opacity: 0.72;
}

.main-photo-picker img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.main-photo-picker span {
  display: block;
  padding: 5px 2px 6px;
  font-size: 10px;
  font-weight: 750;
  min-height: 25px;
}

.approval-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 227, 189, 0.22);
  border-radius: 26px;
  background: rgba(255, 246, 234, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.approval-card img {
  display: block;
  width: 100%;
  max-height: min(54svh, 520px);
  aspect-ratio: 9 / 14;
  border-radius: 20px;
  object-fit: cover;
  object-position: center;
  background: rgba(255, 246, 234, 0.08);
}

.approval-card strong {
  color: #fff6ea;
  font-size: 18px;
  line-height: 1.15;
}

.approval-card p {
  margin: 6px 0 0;
  color: rgba(255, 246, 234, 0.66);
  font-size: 13px;
  line-height: 1.5;
}

.frame-intro {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: #19120d;
  animation: frameIntroFade 6s ease forwards;
}

.frame-intro img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  filter: blur(0);
  animation: frameIntroImage 6s ease forwards;
}

@keyframes frameIntroFade {
  0%, 50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes frameIntroImage {
  0%, 50% {
    transform: scale(1);
    filter: blur(0) brightness(1);
  }
  100% {
    transform: scale(1.028);
    filter: blur(8px) brightness(0.82);
  }
}

.creation-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.creation-list div {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 246, 234, 0.1);
  color: rgba(255, 246, 234, 0.78);
}

.creation-list strong {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 246, 234, 0.88);
  color: #2f2419;
}

.render-policy {
  padding: 15px;
  border-radius: 20px;
  border: 1px solid rgba(255, 227, 189, 0.2);
  background: rgba(255, 246, 234, 0.1);
  margin: 0 0 16px;
}

.render-policy strong {
  display: block;
  margin-bottom: 6px;
  color: #fff6ea;
  font-size: 15px;
}

.render-policy p {
  margin: 0;
  color: rgba(255, 246, 234, 0.66);
  font-size: 13px;
  line-height: 1.48;
}

.quality-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 246, 234, 0.14);
  background: rgba(255, 246, 234, 0.1);
  margin-bottom: 14px;
}

.quality-card.good {
  border-color: rgba(173, 219, 183, 0.44);
  background: rgba(136, 188, 151, 0.14);
}

.quality-card.warn {
  border-color: rgba(255, 212, 151, 0.48);
  background: rgba(210, 148, 82, 0.14);
}

.quality-card.needs {
  border-color: rgba(255, 180, 160, 0.44);
  background: rgba(190, 96, 74, 0.14);
}

.quality-card strong {
  display: block;
  margin-bottom: 6px;
  color: #fff6ea;
  font-size: 17px;
}

.quality-card p {
  margin: 0 0 12px;
  color: rgba(255, 246, 234, 0.7);
  line-height: 1.45;
}

.quality-card ul {
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 246, 234, 0.64);
  font-size: 13px;
  line-height: 1.5;
}

.onboarding-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  min-width: 0;
  width: 100%;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0 0 2px;
  background: transparent;
}

.onboarding-actions .button:last-child {
  width: 100%;
}

.onboarding-primary {
  width: 100%;
  min-height: 56px;
  border-radius: 20px;
  font-size: 17px;
}

.button:disabled {
  opacity: 0.62;
  cursor: default;
}

.message {
  padding: 14px;
  border-radius: 16px;
  background: rgba(234, 217, 202, 0.5);
  margin-bottom: 10px;
}

.message p {
  margin: 0;
  line-height: 1.5;
}

.message small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.page-head-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.page-head-row .button {
  width: auto;
  min-width: 132px;
}

.model-lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.model-lab-form h2,
.model-lab-note h2,
.model-lab-recent h2 {
  margin-top: 0;
}

.provider-picker {
  display: grid;
  gap: 10px;
  margin: 10px 0 18px;
}

.provider-picker > strong {
  font-size: 14px;
}

.duration-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 16px;
  padding: 0;
  border: 0;
}

.duration-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.duration-picker label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 800;
}

.provider-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.provider-option.is-muted {
  opacity: 0.62;
}

.provider-option span,
.provider-option small,
.provider-option em {
  display: block;
}

.provider-option b {
  display: block;
  font-size: 14px;
}

.provider-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.provider-cost-preview {
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(44, 38, 33, 0.06);
}

.provider-cost-preview a,
.result-cost a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.provider-option em {
  margin-top: 5px;
  color: rgba(44, 38, 33, 0.54);
  font-style: normal;
  font-size: 12px;
}

.model-run {
  margin-top: 22px;
}

.model-run-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.model-run-head h2,
.model-run-head p {
  margin: 0;
}

.model-source-panel {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.model-source-panel img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 8px;
}

.model-source-panel summary {
  cursor: pointer;
  font-weight: 800;
}

.model-source-panel pre {
  white-space: pre-wrap;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: rgba(44, 38, 33, 0.08);
  font-size: 12px;
  line-height: 1.45;
}

.model-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.model-result-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.model-result-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.model-result-card header strong,
.model-result-card header span {
  display: block;
}

.model-result-card header span,
.model-result-card p {
  color: var(--muted);
  font-size: 12px;
}

.result-cost {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(44, 38, 33, 0.1);
  border-radius: 8px;
  background: rgba(44, 38, 33, 0.05);
  font-size: 12px;
}

.result-cost strong,
.result-cost span,
.result-cost small {
  display: block;
}

.result-cost strong {
  color: var(--ink);
}

.result-cost span,
.result-cost small {
  color: var(--muted);
}

.result-version,
.result-history-note {
  margin: -4px 0 0;
}

.result-history-note {
  color: #a24d42;
}

.model-retry-button {
  width: 100%;
}

.model-result-card header b {
  align-self: start;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(78, 139, 115, 0.12);
  color: var(--good);
  font-size: 11px;
  text-transform: uppercase;
}

.model-result-card.status-failed header b,
.model-result-card.status-not_configured header b {
  background: rgba(162, 77, 66, 0.12);
  color: #a24d42;
}

.model-result-card video,
.model-empty-video,
.model-video-loader,
.history-video-poster {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  background: #1b1510;
}

.model-video-loader,
.history-video-poster {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: rgba(255, 250, 245, 0.78);
  text-align: center;
}

.model-video-loader img,
.history-video-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.74;
}

.model-video-loader::after,
.history-video-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(27, 21, 16, 0.18), rgba(27, 21, 16, 0.52));
}

.model-video-loader button,
.model-video-loader small,
.history-video-poster span {
  position: relative;
  z-index: 1;
}

.model-video-loader {
  gap: 10px;
  padding: 18px;
}

.model-video-loader small {
  max-width: 190px;
  font-size: 12px;
  line-height: 1.35;
}

.history-video-poster span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 245, 0.16);
  font-size: 12px;
  font-weight: 800;
}

.model-empty-video {
  display: grid;
  place-items: center;
  padding: 18px;
  white-space: pre-line;
  color: rgba(255, 250, 245, 0.72);
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
}

.model-empty-video.is-waiting {
  background: linear-gradient(180deg, rgba(44, 38, 33, 0.82), rgba(27, 21, 16, 0.92));
  color: rgba(255, 250, 245, 0.84);
}

.download-link {
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
}

.manual-result-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.manual-result-form input {
  min-width: 0;
}

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

.score-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.score-grid input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.score-grid .score-note {
  grid-column: 1 / -1;
}

.score-grid button {
  grid-column: 1 / -1;
}

.model-run-list {
  display: grid;
  gap: 8px;
}

.model-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.video-history-panel h2,
.video-history-panel p {
  margin-top: 0;
}

.video-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.video-history-head h2 {
  margin-bottom: 0;
}

.video-history-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.video-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

@media (max-width: 380px) {
  .onboarding-phone {
    padding-left: 14px;
    padding-right: 14px;
  }

  .onboarding-preview,
  .main-photo-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.video-history-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.video-history-meta {
  display: grid;
  gap: 6px;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.history-video-card a {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: inherit;
  text-decoration: none;
}

.history-video-card video,
.history-video-poster {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  background: #1b1510;
}

.history-video-card strong,
.history-video-card span,
.history-video-card small {
  display: block;
}

.history-video-card strong {
  font-size: 14px;
}

.history-video-card span,
.history-video-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.model-run-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.54);
}

.model-run-list span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 840px) {
  .shell {
    padding: 0;
    place-items: stretch;
  }

  .app-card {
    min-height: 100svh;
    border-radius: 0;
    grid-template-columns: 1fr;
  }

  .side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main {
    padding: 22px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .model-lab-layout,
  .model-source-panel {
    grid-template-columns: 1fr;
  }

  .model-source-panel img {
    max-width: 220px;
  }
}
