/* =====================================================================
   RVRN App v2 — app shell + shared components
   ===================================================================== */

/* ---------- desktop preview frame ---------- */
.stage {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--s6);
  padding: var(--s6) var(--s5);
}

.device {
  position: relative;
  width: var(--device-w);
  max-width: 100%;
  height: 844px;
  max-height: calc(100vh - 48px);
  background: var(--white);
  border: 1px solid #d8d8d8;
  border-radius: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.device-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--s5) 6px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  background: var(--white);
}

/* ---------- app shell ---------- */
.app-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px var(--s5) 12px;
  background: var(--white);
  border-bottom: 1px solid transparent;
}

.app-head.is-stuck {
  border-bottom-color: var(--line-2);
}

.app-head .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 14px;
}

.app-head .brand img {
  height: 18px;
  width: auto;
}

.app-head .spacer {
  margin-left: auto;
}

.app-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: var(--white);
  padding-bottom: var(--s6);
}

.app-dock {
  flex-shrink: 0;
}

.app-nav {
  background: var(--white);
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-shrink: 0;
  padding: 7px 2px 9px;
}

.app-nav button {
  width: 20%;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  min-height: 45px;
  padding-top: 3px;
  position: relative;
}

.app-nav button.active {
  color: var(--red);
}

.app-nav button.active svg {
  stroke-width: 2.1;
}

.app-nav .ico,
.app-nav svg {
  width: 20px;
  height: 20px;
}

.badge {
  position: absolute;
  top: -2px;
  left: calc(50% + 7px);
  min-width: 15px;
  height: 15px;
  padding: 1px 4px;
  background: var(--red);
  color: var(--white);
  border-radius: 10px;
  font-size: 9px;
  line-height: 13px;
}

/* ---------- layout ---------- */
.pad {
  padding: var(--s6) var(--s5);
}

.pad-sm {
  padding: var(--s4) var(--s5);
}

.pad-x {
  padding-left: var(--s5);
  padding-right: var(--s5);
}

.section-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s4);
}

.section-top h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
}

.row {
  display: flex;
  gap: var(--s3);
  align-items: center;
}

.between {
  justify-content: space-between;
}

/* ---------- buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: var(--tap-min);
  border-radius: var(--radius-2);
  background: var(--red);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  padding: var(--s3) 14px;
}

.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid #bbb;
}

.btn.dark {
  background: var(--black);
}

.btn.white {
  background: var(--white);
  color: var(--ink);
}

.btn svg {
  width: 17px;
  height: 17px;
}

.text-btn {
  background: none;
  font-size: 12px;
  font-weight: 500;
  padding: 10px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.text-btn svg {
  width: 15px;
  height: 15px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* centered narrow CTA (cart → studio entry) */
.cta-center {
  display: flex;
  justify-content: center;
  margin-top: var(--s6);
}

.cta-center .btn {
  max-width: 240px;
}

/* ---------- cards & rows ---------- */
.hero {
  position: relative;
  height: 350px;
  background: #151515;
  color: var(--white);
  overflow: hidden;
}

.hero > img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.93), transparent 90%);
}

.hero-content {
  position: absolute;
  left: var(--s6);
  right: var(--s6);
  bottom: 26px;
  z-index: 1;
}

.hero h1 {
  font-size: 39px;
  line-height: 1.04;
  letter-spacing: -1.8px;
  font-weight: 600;
  margin: var(--s3) 0 var(--s4);
}

.hero .eyebrow {
  color: #eee;
}

.hero .btn {
  margin-top: var(--s5);
}

.vehicle-row {
  display: flex;
  width: 100%;
  gap: var(--s3);
  align-items: center;
  padding: var(--s4) var(--s5);
  background: var(--paper);
  text-align: left;
}

.vehicle-row .ico,
.vehicle-row svg {
  color: var(--muted);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.vehicle-row strong {
  font-size: 12px;
  display: block;
  font-weight: 600;
}

.vehicle-row span {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-top: var(--s1);
}

.vehicle-row .end {
  margin-left: auto;
  width: 16px;
}

.vehicle-row.is-prompt {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
}

.photo-card {
  background: var(--paper);
  position: relative;
  width: 100%;
  text-align: left;
  padding: 0;
}

.photo-card > img {
  aspect-ratio: 1.78;
  object-fit: cover;
  width: 100%;
}

.photo-card .caption {
  padding: 14px var(--s4);
  background: var(--paper);
}

.photo-card h3 {
  font-size: 14px;
  line-height: 1.4;
  margin: 5px 0;
}

.photo-card p {
  font-size: 11px;
  color: #666;
}

.photo-caption {
  font-size: 10px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.7;
}

.mini-action {
  min-height: 110px;
  padding: var(--s4);
  background: var(--paper);
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  text-align: left;
  gap: var(--s3);
}

.mini-action strong {
  font-size: 12px;
  font-weight: 500;
}

.mini-action svg {
  width: 20px;
  height: 20px;
}

.feature-links {
  border-top: 1px solid var(--line);
  margin-top: 22px;
}

.link-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 0;
  min-height: 54px;
  text-align: left;
  background: transparent;
  border-bottom: 1px solid var(--line);
  gap: 14px;
}

.link-row strong {
  font-size: 13px;
  display: block;
  font-weight: 500;
}

.link-row small {
  font-size: 11px;
  display: block;
  color: var(--muted);
  margin-top: var(--s1);
}

.link-row svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* ---------- status / progress ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 6px var(--s2);
  background: #f0f0f0;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--red);
  border-radius: 50%;
}

.progress {
  display: flex;
  gap: 5px;
  margin: 18px 0 var(--s2);
}

.progress i {
  height: 3px;
  background: #ddd;
  flex: 1;
}

.progress i.done {
  background: var(--black);
}

.progress i.current {
  background: var(--red);
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
}

.progress-labels span {
  flex: 1;
  text-align: center;
}

/* ---------- project / member strips ---------- */
.project-card {
  border: 1px solid #ddd;
  padding: 18px;
  margin-top: 23px;
}

.project-card h2 {
  font-size: 21px;
  letter-spacing: -0.6px;
  margin: var(--s3) 0 5px;
}

.project-card img {
  width: 100%;
  height: 132px;
  object-fit: cover;
  object-position: center 54%;
  margin: 14px 0 var(--s3);
}

.project-card .btn {
  margin-top: 17px;
}

.project-card .update {
  margin-top: var(--s3);
  font-size: 11px;
  line-height: 1.8;
}

.project-card .update strong {
  display: block;
  font-weight: 500;
}

.support-strip {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: 22px;
  padding: 18px 0;
  border-top: 1px solid #ddd;
}

.avatar {
  background: var(--black);
  color: var(--white);
  height: 36px;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.support-strip .text-btn {
  margin-left: auto;
}

.member-strip {
  background: var(--black);
  color: var(--white);
  padding: 22px var(--s5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.member-strip .big {
  font-size: 28px;
  letter-spacing: -1px;
  margin-top: 5px;
}

.member-strip .text-btn {
  color: var(--white);
}

.member-strip .tiny {
  color: #aaa;
}

.member-strip .eyebrow {
  color: #aaa;
}

/* ---------- forms ---------- */
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin: 14px 0 var(--s2);
}

.field select,
.field input,
.field textarea {
  width: 100%;
  border: 1px solid #ccc;
  background: var(--white);
  border-radius: var(--radius-2);
  padding: var(--s3) 10px;
  font-size: 13px;
  min-height: 46px;
  max-width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid #333;
  outline-offset: 2px;
}

.field select:disabled {
  background: var(--paper);
  color: #aaa;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
}

.notice {
  padding: 13px 14px;
  line-height: 1.7;
  font-size: 12px;
  background: var(--paper);
  margin: 14px 0;
}

.notice.warn {
  background: var(--red-soft);
}

.steprail {
  display: flex;
  gap: 7px;
  margin: 5px 0 var(--s5);
}

.steprail i {
  height: 3px;
  flex: 1;
  background: #ddd;
}

.steprail i.on {
  background: var(--red);
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: var(--s5);
  font-size: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #eee;
}

.kv span {
  color: var(--muted-2);
}

.kv b {
  font-weight: 500;
  text-align: right;
}

/* ---------- lists ---------- */
.filterbar {
  display: flex;
  gap: var(--s2);
  margin: var(--s5) 0 22px;
  flex-wrap: wrap;
}

.filterbar button {
  padding: 9px 13px;
  border: 1px solid #ccc;
  background: var(--white);
  font-size: 11px;
  min-height: 38px;
}

.filterbar button.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.vehicle-tabs {
  display: flex;
  overflow-x: auto;
  gap: var(--s2);
  padding: 14px var(--s5);
  background: var(--paper);
  scrollbar-width: none;
}

.vehicle-tabs::-webkit-scrollbar {
  display: none;
}

.vehicle-tabs button {
  white-space: nowrap;
  padding: 11px var(--s3);
  background: var(--white);
  border: 1px solid #ddd;
  font-size: 11px;
  min-height: 42px;
}

.vehicle-tabs button.active {
  border-color: var(--black);
  background: var(--black);
  color: var(--white);
}

.build-card {
  padding: var(--s4);
  border: 1px solid #ddd;
  margin: 14px 0;
  background: var(--white);
}

.build-card h3 {
  font-size: 16px;
  margin: 5px 0;
  letter-spacing: -0.4px;
}

.build-card .build-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}

.build-card .build-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.build-card .build-actions button {
  flex: 1;
  background: var(--paper);
  padding: var(--s3) var(--s2);
  font-size: 11px;
  min-height: 44px;
}

.build-card .build-actions button.primary {
  background: var(--black);
  color: var(--white);
}

.mini-photo {
  width: 90px;
  height: 90px;
  object-fit: contain;
  background: #fafafa;
  border: 1px solid var(--line);
}

.empty {
  padding: var(--s6) 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.empty h3 {
  font-size: 15px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: var(--s2);
}

.empty .btn {
  max-width: 220px;
  margin: var(--s4) auto 0;
}

/* ---------- modal / toast ---------- */
.modal-layer {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-end;
  z-index: 40;
}

.sheet {
  background: var(--white);
  width: 100%;
  max-height: 88%;
  overflow-y: auto;
  border-radius: 14px 14px 0 0;
  padding: var(--s5) var(--s5) var(--s6);
  animation: sheet-in 0.22s ease-out;
}

@keyframes sheet-in {
  from {
    transform: translateY(14px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s3);
}

.sheet-head h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.sheet .btn {
  margin-top: var(--s3);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  background: rgba(10, 10, 10, 0.94);
  color: var(--white);
  font-size: 12px;
  padding: 11px var(--s4);
  border-radius: var(--radius);
  max-width: 82%;
  text-align: center;
  z-index: 60;
  line-height: 1.6;
}

/* ---------- boot / error ---------- */
.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  height: 100%;
  padding: var(--s8);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.boot .code {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--red);
  word-break: break-all;
}

/* ---------- desktop side panels (screen index) ---------- */
.side {
  width: 250px;
  flex-shrink: 0;
  padding-top: var(--s2);
}

.side h3 {
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #8c8c8c;
  margin-bottom: var(--s5);
}

.side nav button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  padding: 10px;
  font-size: 12px;
  color: #444;
  border-radius: var(--radius);
}

.side nav button.active {
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 900px) {
  .side {
    display: none;
  }
  .stage {
    padding: var(--s4) 0;
  }
  .device {
    height: 100vh;
    max-height: none;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }
}
