* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.upload-input-global-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.app-shell {
  width: min(460px, 100%);
  min-height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 0% 0%, rgba(212, 175, 55, 0.06), transparent 55%),
    linear-gradient(180deg, rgba(10, 20, 32, 0.98), rgba(6, 12, 22, 0.98));
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 24px;
  backdrop-filter: blur(8px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.app-header {
  flex-shrink: 0;
  padding: 18px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.app-header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-home-link {
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  display: flex;
  align-items: center;
  min-width: 0;
  border-radius: 12px;
  transition: filter 0.25s ease, box-shadow 0.25s ease;
}

.brand-home-link:hover .brand-logo {
  filter: drop-shadow(0 0 12px rgba(0, 200, 5, 0.55)) brightness(1.12);
}

.brand-home-link:focus-visible {
  outline: 2px solid var(--accent-emerald);
  outline-offset: 3px;
  box-shadow: 0 0 15px var(--accent-emerald);
}

.sos-confirm-footer {
  display: flex;
  gap: 10px;
}

.sos-confirm-footer .app-button {
  flex: 1;
}

.sos-success-scroll {
  max-height: 58vh;
}

.sos-success-lead {
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

.sos-success-para {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}

.sos-inline-hint.upload-hint {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 6px;
  position: relative;
}

.upload-tooltip--sos-thai {
  width: min(340px, calc(100vw - 32px));
  max-height: min(420px, 65vh);
}

.upload-tooltip--sos-thai .sos-tooltip-heading {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--luxury-gold);
}

.upload-tooltip--sos-thai .sos-tooltip-thai {
  margin: 0 0 14px;
  font-family: "Noto Sans Thai", "Inter", system-ui, sans-serif;
  font-size: clamp(1.2rem, 4.2vw, 1.48rem);
  font-weight: 700;
  line-height: 1.5;
  color: #fefaf0;
}

.upload-tooltip--sos-thai .sos-tooltip-ru {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

@media (max-width: 520px) {
  .upload-tooltip--sos-thai {
    max-height: min(78vh, 520px);
  }

  .upload-tooltip--sos-thai .sos-tooltip-thai {
    font-size: 1.46rem;
    line-height: 1.48;
  }
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mascot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: transparent;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: transparent;
  filter: drop-shadow(0 0 8px rgba(0, 200, 5, 0.4)) brightness(1.1);
  transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-name {
  margin: 0;
  letter-spacing: 0.2px;
  font-size: 1.12rem;
  font-weight: 700;
  color: #fefaf0;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.icon-button:active {
  transform: scale(0.97);
}

.hidden {
  opacity: 0;
  pointer-events: none;
}

.app-content {
  flex: 1;
  min-height: 0;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-screen-stack {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.app-screen {
  width: 100%;
}

.contact-card {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, 0.42);
  background: rgba(5, 12, 22, 0.72);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

.contact-card:hover {
  border-color: rgba(0, 200, 5, 0.55);
  box-shadow: 0 0 20px var(--accent-glow);
}

.contact-card:active {
  transform: scale(0.99);
}

.contact-card:focus-visible {
  outline: 2px solid var(--accent-emerald);
  outline-offset: 3px;
}

.contact-card-tg-wrap {
  flex-shrink: 0;
  line-height: 0;
}

.contact-card-tg-icon {
  display: block;
  animation: tg-breath 2.8s ease-in-out infinite;
}

.contact-card-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fefaf0;
  letter-spacing: 0.02em;
}

.screen {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.32s ease, transform 0.32s ease;
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 200, 5, 0.65) rgba(16, 24, 32, 0.95);
}

.screen::-webkit-scrollbar {
  width: 7px;
}

.screen::-webkit-scrollbar-track {
  background: rgba(8, 14, 22, 0.95);
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  margin: 4px 0;
}

.screen::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 200, 5, 0.55), rgba(212, 175, 55, 0.4));
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.35);
}

.screen::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(0, 200, 5, 0.8), rgba(212, 175, 55, 0.55));
}

.active-screen {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.eyebrow {
  color: var(--accent);
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.screen-title {
  margin: 0 0 26px;
  font-size: 1.7rem;
  line-height: 1.2;
}

.accent-text {
  color: #94e0a1;
}

.top-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 3px;
  margin: 0 0 14px;
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.top-nav--global {
  flex-shrink: 0;
  margin-bottom: 12px;
  position: relative;
  z-index: 6;
}

.top-nav--global .menu-item {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
