/* Voyatale V2 foundation (Master Bible baseline).
   Canonical source: css/v2-foundation.css. */

.vt-v2 {
  --vt-v2-purple: #7d0088;
  --vt-v2-purple-deep: #4f075f;
  --vt-v2-orange: #ff7900;
  --vt-v2-ink: #17151d;
  --vt-v2-canvas: #faf9f7;
  --vt-v2-line: #dedce2;
  --vt-v2-surface: #ffffff;
  --vt-v2-muted: #68636f;
  --vt-v2-success: #277a4b;
  --vt-v2-danger: #b42334;
  --vt-v2-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --vt-v2-radius-sm: 12px;
  --vt-v2-radius-md: 14px;
  --vt-v2-radius-lg: 16px;
  --vt-v2-sheet-radius: 24px;
  --vt-v2-tap: 44px;
  --vt-v2-page-max: 1180px;
  --vt-v2-safe-top: env(safe-area-inset-top, 0px);
  --vt-v2-safe-right: env(safe-area-inset-right, 0px);
  --vt-v2-safe-bottom: env(safe-area-inset-bottom, 0px);
  --vt-v2-safe-left: env(safe-area-inset-left, 0px);
  --vt-v2-shadow: 0 8px 24px rgba(23, 21, 29, 0.08);
  --vt-v2-motion-fast: 140ms;
  --vt-v2-motion: 220ms;
  min-width: 0;
  color: var(--vt-v2-ink);
  background: var(--vt-v2-canvas);
  font-family: var(--vt-v2-font);
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.vt-v2,
.vt-v2 *,
.vt-v2 *::before,
.vt-v2 *::after {
  box-sizing: border-box;
}

.vt-v2 img,
.vt-v2 svg,
.vt-v2 video {
  max-width: 100%;
}

.vt-v2-page {
  width: min(var(--vt-v2-page-max), calc(100% - 32px));
  margin-inline: auto;
}

.vt-v2-safe-area {
  padding-top: max(16px, var(--vt-v2-safe-top));
  padding-right: max(16px, var(--vt-v2-safe-right));
  padding-bottom: max(16px, var(--vt-v2-safe-bottom));
  padding-left: max(16px, var(--vt-v2-safe-left));
}

.vt-v2 h1,
.vt-v2-page-title {
  margin: 0;
  font-size: clamp(28px, 7vw, 32px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.vt-v2-section-title {
  margin: 0;
  font-size: clamp(22px, 5vw, 26px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.vt-v2-card-title {
  margin: 0;
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 750;
  line-height: 1.25;
}

.vt-v2-body {
  margin: 0;
  font-size: 16px;
}

.vt-v2-meta {
  color: var(--vt-v2-muted);
  font-size: clamp(13px, 3vw, 14px);
  line-height: 1.4;
}

.vt-v2-app-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(10px, var(--vt-v2-safe-top)) max(16px, var(--vt-v2-safe-right)) 10px max(16px, var(--vt-v2-safe-left));
  border-bottom: 1px solid var(--vt-v2-line);
  background: color-mix(in srgb, var(--vt-v2-surface) 94%, transparent);
}

.vt-v2-bottom-nav {
  min-height: calc(60px + var(--vt-v2-safe-bottom));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  padding: 6px max(8px, var(--vt-v2-safe-right)) max(6px, var(--vt-v2-safe-bottom)) max(8px, var(--vt-v2-safe-left));
  border-top: 1px solid var(--vt-v2-line);
  background: var(--vt-v2-surface);
}

.vt-v2-bottom-nav__item {
  min-width: 0;
  min-height: var(--vt-v2-tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: var(--vt-v2-radius-sm);
  color: var(--vt-v2-muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.vt-v2-bottom-nav__item[aria-current="page"] {
  color: var(--vt-v2-purple);
  background: color-mix(in srgb, var(--vt-v2-purple) 8%, white);
}

.vt-v2-button,
.vt-v2-icon-button {
  min-height: var(--vt-v2-tap);
  border: 1px solid transparent;
  border-radius: var(--vt-v2-radius-md);
  font: 750 16px/1 var(--vt-v2-font);
  cursor: pointer;
  transition: background-color var(--vt-v2-motion-fast) ease, border-color var(--vt-v2-motion-fast) ease, color var(--vt-v2-motion-fast) ease, transform var(--vt-v2-motion-fast) ease;
}

.vt-v2-button {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  text-align: center;
  text-decoration: none;
}

.vt-v2-icon-button {
  width: var(--vt-v2-tap);
  min-width: var(--vt-v2-tap);
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.vt-v2-button--primary {
  color: var(--vt-v2-ink);
  background: var(--vt-v2-orange);
}

.vt-v2-button--secondary {
  color: white;
  background: var(--vt-v2-purple);
}

.vt-v2-button--outline {
  color: var(--vt-v2-purple-deep);
  border-color: var(--vt-v2-line);
  background: var(--vt-v2-surface);
}

.vt-v2-button--ghost,
.vt-v2-icon-button {
  color: var(--vt-v2-ink);
  background: transparent;
}

.vt-v2-button--danger {
  color: white;
  background: var(--vt-v2-danger);
}

.vt-v2-tabs {
  min-width: 0;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.vt-v2-tabs::-webkit-scrollbar {
  display: none;
}

.vt-v2-tab,
.vt-v2-chip {
  min-height: var(--vt-v2-tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--vt-v2-line);
  color: var(--vt-v2-ink);
  background: var(--vt-v2-surface);
  font: 700 14px/1.2 var(--vt-v2-font);
  text-decoration: none;
  cursor: pointer;
}

.vt-v2-tab {
  padding: 0 16px;
  border-radius: var(--vt-v2-radius-sm);
}

.vt-v2-chip {
  padding: 0 14px;
  border-radius: 999px;
}

.vt-v2-tab[aria-selected="true"],
.vt-v2-chip[aria-pressed="true"] {
  color: var(--vt-v2-purple);
  border-color: color-mix(in srgb, var(--vt-v2-purple) 28%, var(--vt-v2-line));
  background: color-mix(in srgb, var(--vt-v2-purple) 8%, white);
}

.vt-v2-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--vt-v2-line);
  border-radius: var(--vt-v2-radius-lg);
  background: var(--vt-v2-surface);
  box-shadow: var(--vt-v2-shadow);
}

.vt-v2-sheet-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  align-items: end;
  background: rgba(23, 21, 29, 0.42);
}

.vt-v2-sheet {
  width: min(100%, 680px);
  max-height: min(88dvh, 780px);
  margin-inline: auto;
  overflow: auto;
  padding: 20px max(16px, var(--vt-v2-safe-right)) max(20px, var(--vt-v2-safe-bottom)) max(16px, var(--vt-v2-safe-left));
  border-radius: var(--vt-v2-sheet-radius) var(--vt-v2-sheet-radius) 0 0;
  background: var(--vt-v2-surface);
  box-shadow: 0 -18px 48px rgba(23, 21, 29, 0.18);
}

.vt-v2-map-control {
  width: var(--vt-v2-tap);
  min-width: var(--vt-v2-tap);
  height: var(--vt-v2-tap);
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--vt-v2-line);
  border-radius: var(--vt-v2-radius-sm);
  color: var(--vt-v2-ink);
  background: var(--vt-v2-surface);
  box-shadow: var(--vt-v2-shadow);
}

.vt-v2-gallery {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  overflow: hidden;
  border-radius: var(--vt-v2-radius-lg);
}

.vt-v2-gallery--mosaic > :first-child {
  grid-row: span 2;
}

.vt-v2-gallery__item {
  min-width: 0;
  min-height: 120px;
  overflow: hidden;
  background: var(--vt-v2-line);
}

.vt-v2-gallery__item > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.vt-v2-skeleton {
  min-height: 16px;
  border-radius: var(--vt-v2-radius-sm);
  background: linear-gradient(90deg, #efedf1 25%, #f8f7f8 50%, #efedf1 75%);
  background-size: 200% 100%;
  animation: vt-v2-shimmer 1.4s linear infinite;
}

.vt-v2-state {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px 16px;
  border: 1px dashed var(--vt-v2-line);
  border-radius: var(--vt-v2-radius-lg);
  color: var(--vt-v2-muted);
  background: var(--vt-v2-surface);
  text-align: center;
}

.vt-v2-state--error {
  color: var(--vt-v2-danger);
}

.vt-v2-state--offline,
.vt-v2-state--permission {
  color: var(--vt-v2-purple-deep);
}

.vt-v2-state--loading,
.vt-v2-state--syncing {
  cursor: progress;
}

.vt-v2 input,
.vt-v2 textarea,
.vt-v2 select {
  max-width: 100%;
  min-height: var(--vt-v2-tap);
  border: 1px solid var(--vt-v2-line);
  border-radius: var(--vt-v2-radius-sm);
  color: var(--vt-v2-ink);
  background: var(--vt-v2-surface);
  font: 500 16px/1.4 var(--vt-v2-font);
}

.vt-v2 :is(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--vt-v2-purple) 34%, transparent);
  outline-offset: 3px;
}

.vt-v2-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes vt-v2-shimmer {
  to { background-position-x: -200%; }
}

@media (max-width: 768px) {
  .vt-v2-page {
    width: min(100% - 24px, var(--vt-v2-page-max));
  }
}

@media (prefers-reduced-motion: reduce) {
  .vt-v2 *,
  .vt-v2 *::before,
  .vt-v2 *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
