:root {
  --bg: #171932;
  --bg-deep: #14162b;
  --card: #313550;
  --card-hover: #383d5b;
  --btn-dark: #1d213d;
  --accent: #6bc5d2;
  --accent-soft: rgba(107, 197, 210, 0.16);
  --cta-teal: #5a7a86;
  --cta-teal-text: #121a2d;
  --text: #ffffff;
  --text-soft: #e6ecf5;
  --muted: #9298b3;
  --border: rgba(255, 255, 255, 0.08);
  --warn: #e59a54;
  --danger: #f06a7a;
  --success: #5dd39e;
  --radius-card: 22px;
  --radius-btn: 15px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body.overlay-open {
  overflow: hidden;
}

body.auth-locked .top-bar,
body.auth-locked .main-content,
body.auth-locked .bottom-nav {
  visibility: hidden;
}

.app-shell {
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  padding-top: calc(8px + var(--safe-top));
  padding-bottom: calc(78px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 10px;
}

.car-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.car-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.car-title-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.car-chevron {
  font-size: 13px;
  color: var(--muted);
}

.car-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.96);
}

.conn-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(107, 197, 210, 0.16);
  color: var(--accent);
}

.conn-badge.online {
  background: rgba(93, 211, 158, 0.16);
  color: var(--success);
}

.conn-badge.offline {
  background: rgba(240, 106, 122, 0.18);
  color: var(--danger);
}

.last-sync {
  font-size: 11px;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn:active {
  transform: scale(0.93);
  background: rgba(255, 255, 255, 0.12);
}

.icon-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

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

/* Main & Tabs */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tab-view {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 0 14px 18px;
}

.tab-view[hidden] {
  display: none;
}

/* Base Card */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

/* Hero Swipeable Carousel */
.hero-carousel-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 12px;
  scrollbar-width: none;
}

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

.hero-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  padding: 14px 18px 16px;
  min-height: 206px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* Slide 1: Official Voyah main hero card */
.hero-overview-slide {
  padding-top: 0;
}

.avail-banner {
  margin: 0 -18px 6px;
  padding: 5px 12px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 500;
  color: #a9dbe2;
  background: rgba(107, 197, 210, 0.11);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.avail-banner.sleep {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.avail-banner.error {
  color: #ff9ba8;
  background: rgba(240, 106, 122, 0.14);
}

.hero-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-indicators {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-ind {
  display: inline-flex;
  color: rgba(255, 255, 255, 0.36);
  transition: color 0.2s ease;
}

.mini-ind.active {
  color: var(--accent);
}

.mini-ind.warn {
  color: var(--warn);
}

.gps-circle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--btn-dark);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gps-circle-btn:active {
  transform: scale(0.92);
}

.car-front-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 108px;
  margin: -4px 0 2px;
}

.car-front-img {
  max-width: 96%;
  max-height: 112px;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.hero-bottom-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
  font-size: 13.5px;
}

.hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-stat strong {
  font-weight: 500;
}

.stat-ico {
  display: inline-flex;
  color: var(--muted);
}

/* Slide 2: Tires + Top-down car + 3 metrics */
.hero-tires-slide {
  padding-top: 22px;
}

.car-tire-stage {
  display: grid;
  grid-template-columns: 1fr 104px 1fr;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}

.tire-col {
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.tire-col.left {
  align-items: flex-end;
  padding-right: 4px;
}

.tire-col.right {
  align-items: flex-start;
  padding-left: 4px;
}

.tire-val {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.2px;
}

.tire-val.low {
  color: var(--warn);
}

.tire-val small {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
}

.car-top-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 126px;
}

.car-top-img {
  max-height: 126px;
  width: auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 4px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.metric-val-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.metric-ico {
  display: inline-flex;
  color: var(--muted);
}

.metric-val {
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
}

.metric-label {
  font-size: 10.5px;
  line-height: 1.2;
  color: var(--muted);
}

/* Carousel Dashes */
.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.dot {
  border: 0;
  padding: 0;
  height: 3px;
  width: 18px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.25s ease;
}

.dot.active {
  width: 34px;
  background: #ffffff;
}

/* Preparation Card */
.prep-card {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
}

.prep-duration {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.muted {
  color: var(--muted);
}

.link-cyan {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: none;
}

.chevron-right {
  font-size: 13px;
}

/* Primary & Secondary Action Buttons */
.btn-primary-cta,
.btn-secondary-dark {
  width: 100%;
  border-radius: var(--radius-btn);
  padding: 13px 16px;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.15s ease, transform 0.1s ease;
}

.btn-primary-cta {
  border: 1px solid rgba(107, 197, 210, 0.34);
  background: linear-gradient(180deg, #24364e, #1d2b40);
  color: #f0f9fc;
}

.btn-primary-cta.running {
  background: linear-gradient(180deg, #275063, #1d3c4d);
  border-color: rgba(107, 197, 210, 0.72);
  color: #ffffff;
}

.btn-primary-cta.btn-compact {
  font-size: 14px;
  padding: 12px 10px;
}

.btn-secondary-dark {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-soft);
  font-size: 14px;
  padding: 12px 10px;
}

.btn-primary-cta:active,
.btn-secondary-dark:active,
.btn-teal-cta:active {
  transform: scale(0.985);
}

button.busy,
button:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Quick Actions Grid */
.actions-card {
  padding: 15px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.actions-row {
  display: grid;
  align-items: start;
}

.actions-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.actions-row-2 {
  grid-template-columns: repeat(2, 1fr);
  padding: 0 22px;
}

.quick-action {
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 4px;
  border-radius: 14px;
  transition: background 0.18s ease, transform 0.1s ease;
}

.quick-action:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.05);
}

.qa-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border-radius: 12px;
  transition: color 0.2s ease;
  position: relative;
}

.quick-action.active .qa-icon,
.quick-action.active .qa-label {
  color: var(--accent);
}

.quick-action.busy .qa-icon::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 2px solid rgba(107, 197, 210, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

.quick-action.busy .qa-icon svg {
  opacity: 0.22;
}

.qa-label {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

/* Bottom 2 Tiles */
.tiles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.nav-tile {
  padding: 14px 15px 13px;
  min-height: 98px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.2s ease, transform 0.1s ease;
}

.nav-tile.climate-on {
  border-color: rgba(107, 197, 210, 0.5);
}

.nav-tile:active {
  transform: scale(0.98);
  background: var(--card-hover);
}

.tile-title {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.94);
}

.active-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  vertical-align: middle;
  margin-left: 5px;
}

.nav-tile.climate-on .active-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.tile-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 8px;
}

.tile-bottom-end {
  justify-content: flex-end;
}

.tile-temp {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.tile-icon {
  display: inline-flex;
  color: #ffffff;
}

.nav-tile.climate-on .tile-icon {
  color: var(--accent);
}

/* Tab 2 cards */
.section-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
}

.status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--muted);
}

.status-pill.online {
  background: rgba(107, 197, 210, 0.16);
  color: var(--accent);
}

.energy-bars {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.energy-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 5px;
  color: var(--muted);
}

.energy-bar-head strong {
  color: var(--text);
  font-weight: 500;
}

.bar-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.bar-fill.cyan {
  background: linear-gradient(90deg, #4ca8b8, var(--accent));
}

.bar-fill.soft {
  background: linear-gradient(90deg, #757db2, #a5addc);
}

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

.mini-stat {
  background: var(--btn-dark);
  border-radius: 13px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

.mini-stat span {
  font-size: 11px;
}

.mini-stat strong {
  font-size: 16px;
  font-weight: 600;
}

.control-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.helper-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.time-input,
.text-input {
  background: var(--btn-dark);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
}

.text-input {
  width: 100%;
}

.text-input:focus {
  border-color: var(--accent);
}

.fields-dimmed {
  opacity: 0.5;
}

/* FULL-SCREEN CLIMATE VIEW (Voyah PDF page 5 — zero empty gap, zero double icons) */
.fullscreen-screen {
  position: fixed;
  inset: 0;
  max-width: 460px;
  margin: 0 auto;
  background: linear-gradient(180deg, #171932 0%, #191e3a 55%, #171932 100%);
  z-index: 40;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 18px calc(22px + var(--safe-bottom));
  overflow-y: auto;
  scrollbar-width: none;
}

.fullscreen-screen::-webkit-scrollbar {
  display: none;
}

.fullscreen-screen.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

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

.fs-header {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
}

.fs-header h2 {
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.fs-back {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.climate-temps-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 10px 0;
}

.climate-temp-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.climate-temp-col.right {
  text-align: right;
}

.climate-temp-col strong {
  font-size: 20px;
  font-weight: 500;
}

/* Large fluid cabin stage matching ref-climate.png */
.cabin-stage {
  position: relative;
  width: min(348px, 90vw);
  aspect-ratio: 336 / 378;
  max-height: 50dvh;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cabin-svg-bg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cabin-top-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

/* Clean icon-only hotspots positioned strictly over steering wheel & seat cushions */
.cabin-hotspot {
  position: absolute;
  width: 50px;
  height: 50px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55));
  transition: color 0.2s ease, background 0.2s ease, transform 0.12s ease;
}

.cabin-hotspot:active {
  transform: translate(-50%, -50%) scale(0.92);
}

.cabin-hotspot svg {
  width: 30px;
  height: 30px;
}

.cabin-hotspot.active {
  background: rgba(229, 154, 84, 0.24);
  color: #ffb870;
  box-shadow: 0 0 18px rgba(229, 154, 84, 0.5);
}

.wheel-spot {
  left: 35.5%;
  top: 37%;
}

.seat-drv-spot {
  left: 35.5%;
  top: 53.5%;
}

.seat-psg-spot {
  left: 65%;
  top: 53.5%;
}

.climate-controls-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
}

.climate-preset-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.preset-caption {
  font-size: 12px;
  color: var(--muted);
}

.preset-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

.preset-chip {
  flex: 1;
  max-width: 96px;
  padding: 9px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #d6deec;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.preset-chip.active {
  color: #ffffff;
  background: rgba(107, 197, 210, 0.18);
  border-color: rgba(107, 197, 210, 0.6);
}

/* Official Voyah PDF CTA: muted teal with dark high-contrast text */
.btn-teal-cta {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  color: var(--cta-teal-text);
  background: var(--cta-teal);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-teal-cta.active {
  background: var(--accent);
  color: #0e1526;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 460px;
  height: calc(62px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #23263e;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  grid-template-columns: 1fr 1fr;
  z-index: 20;
}

.nav-item {
  border: 0;
  background: transparent;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
}

.nav-item.active {
  color: var(--accent);
  background: linear-gradient(180deg, rgba(107, 197, 210, 0.16) 0%, rgba(107, 197, 210, 0.02) 100%);
}

.nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: transparent;
}

.nav-item.active .nav-indicator {
  background: var(--accent);
}

.nav-icon {
  display: inline-flex;
}

/* Bottom Sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 22, 0.68);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.sheet-backdrop.open {
  display: flex;
}

.sheet-panel {
  width: 100%;
  max-width: 460px;
  max-height: 82dvh;
  overflow-y: auto;
  background: #1f223b;
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 18px calc(26px + var(--safe-bottom));
  animation: slideUp 0.22s ease;
  scrollbar-width: none;
}

.sheet-panel::-webkit-scrollbar {
  display: none;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 auto 12px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sheet-header h3 {
  margin: 0;
  font-size: 17.5px;
  font-weight: 600;
}

.sheet-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  flex: 1;
  min-width: 64px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #252a49;
  color: var(--text-soft);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pill-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #ffffff;
}

.pill-btn.action-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
}

.sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--btn-dark);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

/* Centered Confirmation Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 22, 0.74);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 55;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.16s ease;
}

.modal-card {
  width: 100%;
  max-width: 340px;
  background: #232744;
  border: 1px solid rgba(107, 197, 210, 0.25);
  border-radius: 22px;
  padding: 22px 18px 18px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(229, 154, 84, 0.18);
  border: 1px solid rgba(229, 154, 84, 0.5);
  color: var(--warn);
  font-size: 20px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.modal-desc {
  margin: 0 0 6px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}

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

.confirm-pin-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.confirm-pin-wrap[hidden] {
  display: none;
}

.pin-input {
  text-align: center;
  letter-spacing: 6px;
  font-size: 18px;
  font-weight: 600;
}

.pin-input::placeholder {
  letter-spacing: normal;
  font-size: 13.5px;
  font-weight: 400;
}

.pin-error {
  font-size: 12px;
  color: var(--danger);
  min-height: 16px;
  text-align: center;
}

/* Auth Gate (Zero-leakage public entry screen) */
.auth-gate {
  position: fixed;
  inset: 0;
  max-width: 460px;
  margin: 0 auto;
  background: linear-gradient(180deg, #13152a 0%, #171932 60%, #13152a 100%);
  z-index: 75;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
}

.auth-gate.open {
  display: flex;
}

.auth-card {
  width: 100%;
  max-width: 350px;
  background: #232744;
  border: 1px solid rgba(107, 197, 210, 0.22);
  border-radius: 24px;
  padding: 26px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.48);
}

.auth-title {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 600;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.auth-form[hidden] {
  display: none;
}

.auth-cfg-link {
  margin-top: 6px;
  font-size: 12.5px;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--btn-dark);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 13px;
  padding: 10px 12px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-name {
  font-size: 13.5px;
  font-weight: 600;
}

.user-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.user-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.mini-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #252a49;
  color: var(--text-soft);
  border-radius: 9px;
  padding: 6px 9px;
  font-size: 11.5px;
  cursor: pointer;
}

.mini-btn.danger {
  border-color: rgba(240, 106, 122, 0.45);
  color: #ff9ba8;
}

.invite-code-box {
  background: #14172e;
  border: 1px dashed rgba(107, 197, 210, 0.6);
  border-radius: 12px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 16px;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-align: center;
  user-select: all;
}

/* App Lock Screen */
.lock-screen {
  position: fixed;
  inset: 0;
  max-width: 460px;
  margin: 0 auto;
  background: rgba(15, 17, 36, 0.97);
  backdrop-filter: blur(12px);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lock-screen.open {
  display: flex;
}

.lock-card {
  width: 100%;
  max-width: 320px;
  background: #232744;
  border: 1px solid rgba(107, 197, 210, 0.25);
  border-radius: 24px;
  padding: 28px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.lock-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
}

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: none;
}

.audit-list::-webkit-scrollbar {
  display: none;
}

.audit-item {
  background: var(--btn-dark);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audit-item-top {
  display: flex;
  justify-content: space-between;
  color: var(--accent);
  font-weight: 600;
}

.audit-item-detail {
  color: var(--muted);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(78px + var(--safe-bottom));
  transform: translateX(-50%) translateY(16px);
  background: #101226;
  border: 1px solid rgba(107, 197, 210, 0.45);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
  max-width: 90vw;
  text-align: center;
}

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