/* Shared components: buttons, chips, cards, fields, sheets, toasts, banners, skeletons. Every
   tappable one is at least 44 px high (docs/design/ux-v2.md §4.8); rows are 48 px or more. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--bg2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.5;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-danger {
  color: var(--danger);
}

.btn-small {
  min-height: 44px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.main-button-fallback {
  min-height: 48px;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabs-h) + var(--safe-bottom) + 8px);
  z-index: 30;
}

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--separator);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.chip-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.card {
  background: var(--section);
  border-radius: var(--radius);
  padding: var(--gap);
  margin: 0 var(--gap) var(--gap);
}

.list-item {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px var(--gap);
  background: var(--section);
  border-bottom: 1px solid var(--separator);
}

.name-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  font-weight: 600;
}

/* A name can be one word of up to 40 letters: it wraps inside the card instead of pushing the
   badge, the age and the rating out of it. */
.name-line .name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.badge-chip {
  flex-shrink: 0;
  font-size: 0.95em;
}

/* «Name 🎉, 23» in one row: the name wraps, the age stays next to it. */
.name-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.name-age {
  flex-shrink: 0;
  white-space: nowrap;
}

.rating {
  font-size: 13px;
  color: var(--hint);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--gap);
}

.field label {
  font-size: 13px;
  color: var(--hint);
}

.input,
textarea.input,
select.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--separator);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

textarea.input {
  min-height: 90px;
  resize: vertical;
}

.counter {
  align-self: flex-end;
  font-size: 12px;
  color: var(--hint);
}

.segments {
  display: flex;
  margin: var(--gap);
  padding: 3px;
  border-radius: 10px;
  background: var(--bg2);
}

.segment {
  flex: 1;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.segment-on {
  background: var(--bg);
  font-weight: 600;
}

.toasts {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabs-h) + var(--safe-bottom) + 64px);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.toast {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(20, 20, 20, 0.88);
  color: #fff;
  font-size: 14px;
  transition: opacity 0.4s ease;
}

.toast-hide {
  opacity: 0;
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: var(--gap);
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  font-size: 14px;
}

.banner-warn {
  background: rgba(255, 179, 0, 0.18);
}

.banner-error {
  background: rgba(229, 57, 53, 0.15);
}

.empty {
  padding: 32px var(--gap);
  text-align: center;
  color: var(--hint);
}

.fatal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 70vh;
  padding: 24px;
  text-align: center;
}

.fatal-text {
  font-size: 17px;
}

.skeleton-list {
  padding: var(--gap);
}

.skeleton {
  height: 72px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--bg) 25%, var(--bg2) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
