:root {
  --bg: #070709;
  --glass-top: rgba(255, 255, 255, 0.042);
  --glass-bottom: rgba(255, 255, 255, 0.015);
  --border: rgba(255, 255, 255, 0.075);
  --border-active: rgba(168, 85, 247, 0.36);
  --text: #f4f4f7;
  --muted: #8c8c99;
  --violet: #a855f7;
  --violet-glow: rgba(168, 85, 247, 0.45);
  --violet-soft: rgba(168, 85, 247, 0.14);
  --ok: #34d399;
  --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 Text", "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Feixe diagonal sutil estilo a referência */
.ambient-beam {
  position: fixed;
  inset: -20% -15% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.055) 0%,
    rgba(168, 85, 247, 0.04) 32%,
    transparent 70%
  );
  transform: rotate(-28deg);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px 16px calc(104px + var(--safe-bottom));
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 20px;
}

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

.brand-logo {
  color: #ffffff;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pill-counter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 10px var(--violet);
}

.main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Painel principal em vidro escuro */
.glass-panel {
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 24px 48px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-label {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0 4px;
  letter-spacing: 0.01em;
}

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

/* Pílula estilo o item "Home" da referência */
.nav-pill {
  position: relative;
  appearance: none;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.1s ease;
}

.nav-pill:active {
  transform: scale(0.975);
}

.pill-indicator {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #e879f9, #8b5cf6);
  box-shadow: 0 0 12px 2px var(--violet-glow);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.pill-icon-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.pill-text {
  flex: 1;
  text-align: left;
  white-space: nowrap;
}

.pill-badge {
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--muted);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.nav-pill.active {
  color: #ffffff;
  background: radial-gradient(circle at 18% 50%, rgba(168, 85, 247, 0.18), rgba(255, 255, 255, 0.025) 62%);
  border-color: var(--border-active);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-pill.active .pill-indicator {
  opacity: 1;
}

.nav-pill.active .pill-icon-wrap {
  color: #ffffff;
  background: rgba(168, 85, 247, 0.24);
  box-shadow:
    0 0 16px rgba(168, 85, 247, 0.48),
    inset 0 0 0 1px rgba(232, 121, 249, 0.35);
}

.nav-pill.active .pill-badge {
  color: #e9d5ff;
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.16);
}

.glass-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  margin: 2px 0;
}

/* Seletor de fotos */
.picker-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 8px;
  border-radius: 18px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.16s ease, transform 0.1s ease;
}

.picker-row:active,
.picker-row.dragover {
  background: rgba(168, 85, 247, 0.08);
  transform: scale(0.985);
}

.picker-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #ffffff;
  background: radial-gradient(circle at 30% 30%, rgba(232, 121, 249, 0.28), rgba(139, 92, 246, 0.16));
  border: 1px solid rgba(192, 132, 252, 0.35);
  box-shadow: 0 0 22px rgba(168, 85, 247, 0.32);
}

.picker-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.picker-copy strong {
  font-size: 0.94rem;
  font-weight: 500;
  color: #ffffff;
}

.picker-copy span {
  font-size: 0.74rem;
  color: var(--muted);
}

.picker-arrow {
  color: var(--muted);
  opacity: 0.7;
}

/* Fila de resultados */
.queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.queue-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.count-chip {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 0.72rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.clear-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 8px;
  cursor: pointer;
}

.clear-btn:active {
  color: #ffffff;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.photo-card {
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 40px rgba(0, 0, 0, 0.4);
  animation: fadeUp 0.22s ease-out;
}

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

.photo-stage {
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  max-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-preview {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

.photo-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #e9d5ff;
  background: rgba(12, 12, 16, 0.72);
  border: 1px solid rgba(168, 85, 247, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.22);
}

.photo-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.photo-name {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-specs {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.photo-removed {
  font-size: 0.73rem;
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.22);
  padding: 5px 10px;
  border-radius: 999px;
  align-self: flex-start;
}

.photo-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.photo-actions.has-share {
  grid-template-columns: 1fr 1.25fr;
}

.btn-pill-ghost,
.btn-pill-glow {
  appearance: none;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 11px 14px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease, border-color 0.16s ease, background 0.16s ease;
}

.btn-pill-ghost {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-pill-glow {
  background: radial-gradient(circle at 20% 50%, rgba(168, 85, 247, 0.24), rgba(255, 255, 255, 0.04) 70%);
  border: 1px solid var(--border-active);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 22px rgba(168, 85, 247, 0.2);
}

.btn-pill-ghost:active,
.btn-pill-glow:active,
.dock-pill:active {
  transform: scale(0.975);
}

/* Dock flutuante inferior */
.dock-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(14px + var(--safe-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.dock-pill {
  pointer-events: auto;
  position: relative;
  width: 100%;
  max-width: 448px;
  appearance: none;
  border: 1px solid var(--border-active);
  border-radius: 999px;
  padding: 15px 20px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  background: radial-gradient(circle at 12% 50%, rgba(168, 85, 247, 0.28), rgba(18, 18, 24, 0.92) 55%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 32px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(168, 85, 247, 0.22);
  cursor: pointer;
  touch-action: manipulation;
  overflow: hidden;
}

.dock-pill .pill-indicator {
  opacity: 1;
  height: 20px;
}

.dock-pill:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}
