/* Reset & theme */
:root {
  --color-bg: #eef3fb;
  --color-bg-tint: #e6edf8;
  --color-surface: #ffffff;
  --color-surface-soft: #f4f7fc;
  --color-border: #d3dceb;
  --color-shadow: rgba(19, 32, 52, 0.12);
  --color-text: #1a273a;
  --color-text-soft: #45526a;
  --color-text-muted: #718198;
  --color-accent: #0b6cde;
  --color-accent-dark: #084d9c;
  --color-accent-soft: rgba(11, 108, 222, 0.16);
  --color-warm: #f28c2e;
  --color-warm-soft: rgba(242, 140, 46, 0.12);
  --color-ink: rgba(8, 25, 44, 0.85);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 22px 45px rgba(15, 23, 42, 0.12);
  --transition: 200ms ease;
  --transition-long: 420ms cubic-bezier(0.23, 1, 0.32, 1);
  /* Spacing system */
  --spacing-xs: clamp(4px, 0.5vw, 8px);
  --spacing-sm: clamp(8px, 1vw, 12px);
  --spacing-md: clamp(12px, 1.5vw, 20px);
  --spacing-lg: clamp(16px, 2vw, 28px);
  --spacing-xl: clamp(24px, 3vw, 40px);
}

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

*::selection {
  background: rgba(37, 99, 235, 0.18);
  color: var(--color-text);
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-size: 15px;
  line-height: 1.55;
  position: relative;
  font-family: "Poppins", "Space Grotesk", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  scroll-behavior: smooth;
  background-image:
    radial-gradient(140% 120% at 12% 8%, rgba(11, 108, 222, 0.1), transparent 55%),
    radial-gradient(120% 140% at 88% -10%, rgba(242, 140, 46, 0.18), transparent 60%),
    linear-gradient(180deg, var(--color-bg), var(--color-bg-tint));
  background-size: 100% 100%, 100% 100%, 100% 100%;
  background-repeat: no-repeat;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  display: block;
  max-width: 100%;
}

.container {
  width: min(1800px, 92vw);
  margin: 0 auto;
  max-width: 1800px;
}

.page-wrapper {
  position: relative;
  z-index: 0;
  isolation: isolate;
}

.page-wrapper::before {
  content: "";
  position: fixed;
  inset: -60px;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(120% 120% at 12% 10%, rgba(11, 108, 222, 0.12), transparent 65%),
    radial-gradient(140% 140% at 88% -15%, rgba(242, 140, 46, 0.18), transparent 70%);
  filter: blur(0.6px);
  opacity: 0.8;
}

.page-wrapper::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='%230b1f36' fill-opacity='0.06'%3E%3Cpath d='M15.4 9.8c2.3 0 4.1 2.2 4.1 5s-1.8 5-4.1 5-4.1-2.2-4.1-5 1.8-5 4.1-5Zm17.2 0c2.3 0 4.1 2.2 4.1 5s-1.8 5-4.1 5-4.1-2.2-4.1-5 1.8-5 4.1-5ZM9 20.9c2.5 0 4.5 2.6 4.5 5.8s-2 5.8-4.5 5.8S4.5 29.9 4.5 26.7 6.6 20.9 9 20.9Zm30 0c2.5 0 4.5 2.6 4.5 5.8s-2 5.8-4.5 5.8-4.5-2.6-4.5-5.8 2-5.8 4.5-5.8ZM24 25.6c5.8 0 10.8 4.2 10.8 9.2 0 3.7-3.3 6.3-10.8 6.3S13.2 38.5 13.2 34.8c0-5 5-9.2 10.8-9.2Z' transform='translate(26 36) scale(0.44)'/%3E%3Cpath d='M15.4 9.8c2.3 0 4.1 2.2 4.1 5s-1.8 5-4.1 5-4.1-2.2-4.1-5 1.8-5 4.1-5Zm17.2 0c2.3 0 4.1 2.2 4.1 5s-1.8 5-4.1 5-4.1-2.2-4.1-5 1.8-5 4.1-5ZM9 20.9c2.5 0 4.5 2.6 4.5 5.8s-2 5.8-4.5 5.8S4.5 29.9 4.5 26.7 6.6 20.9 9 20.9Zm30 0c2.5 0 4.5 2.6 4.5 5.8s-2 5.8-4.5 5.8-4.5-2.6-4.5-5.8 2-5.8 4.5-5.8ZM24 25.6c5.8 0 10.8 4.2 10.8 9.2 0 3.7-3.3 6.3-10.8 6.3S13.2 38.5 13.2 34.8c0-5 5-9.2 10.8-9.2Z' transform='translate(108 122) scale(0.5)'/%3E%3Cpath d='M15.4 9.8c2.3 0 4.1 2.2 4.1 5s-1.8 5-4.1 5-4.1-2.2-4.1-5 1.8-5 4.1-5Zm17.2 0c2.3 0 4.1 2.2 4.1 5s-1.8 5-4.1 5-4.1-2.2-4.1-5 1.8-5 4.1-5ZM9 20.9c2.5 0 4.5 2.6 4.5 5.8s-2 5.8-4.5 5.8S4.5 29.9 4.5 26.7 6.6 20.9 9 20.9Zm30 0c2.5 0 4.5 2.6 4.5 5.8s-2 5.8-4.5 5.8-4.5-2.6-4.5-5.8 2-5.8 4.5-5.8ZM24 25.6c5.8 0 10.8 4.2 10.8 9.2 0 3.7-3.3 6.3-10.8 6.3S13.2 38.5 13.2 34.8c0-5 5-9.2 10.8-9.2Z' transform='translate(168 52) scale(0.38)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 200px 200px;
  background-repeat: repeat;
  background-position: 0 0;
  opacity: 0.6;
  mix-blend-mode: normal;
  animation: pawFloat 72s linear infinite;
}

@keyframes pawFloat {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 200px 200px;
  }
}

/* Loader */
#page-preloader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 248, 255, 0.92);
  backdrop-filter: blur(18px);
  z-index: 9999;
  transition: opacity 260ms ease, visibility 260ms ease;
}

#page-preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-spinner {
  text-align: center;
  padding: 26px 34px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(8, 31, 52, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 38px rgba(12, 24, 40, 0.18);
  display: grid;
  gap: 14px;
  animation: fadeUp 620ms ease-out both;
}

.spinner-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border-radius: 26px;
  color: var(--color-warm);
  background: rgba(242, 140, 46, 0.14);
  animation: floatPulse 1.8s ease-in-out infinite;
}

.spinner-icon svg {
  width: 44px;
  height: 44px;
}

.spinner-glow {
  position: absolute;
  inset: 6px;
  border-radius: 20px;
  border: 2px dashed rgba(242, 140, 46, 0.35);
  animation: spin 2.6s linear infinite;
}

.spinner-paw {
  position: relative;
  animation: spin 1.9s ease-in-out infinite;
}

.loading-spinner p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-soft);
  letter-spacing: 0.02em;
}

@keyframes floatPulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

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

@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(20, 30, 44, 0.9);
  border-bottom: 1px solid rgba(8, 18, 32, 0.6);
  box-shadow: 0 14px 32px rgba(8, 18, 32, 0.25);
  padding: 14px 0;
}

.header-content {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(18px, 6vw, 36px);
  padding-right: 48px;
  animation: fadeDown 680ms cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

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

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f3a64c, #f17a24);
  color: #0f1b2b;
  box-shadow: 0 8px 20px rgba(241, 122, 36, 0.25);
}

.brand-icon svg {
  width: 28px;
  height: 28px;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.18rem;
  font-family: "Space Grotesk", "Poppins", sans-serif;
  letter-spacing: -0.01em;
  color: #f5f8ff;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(231, 238, 255, 0.58);
}

.header-metrics {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: center;
}

.metric-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 112px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 23, 36, 0.82);
  box-shadow: 0 10px 18px rgba(6, 12, 22, 0.32);
  transition: transform var(--transition), box-shadow var(--transition), border var(--transition);
  text-align: left;
}

.metric-chip:hover,
.metric-chip:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(6, 12, 22, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.metric-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(217, 228, 244, 0.55);
}

.metric-value {
  font-size: 0.86rem;
  font-weight: 600;
  color: #f2f6ff;
}

.status-chip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  min-width: 190px;
  border-radius: var(--radius-md);
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.28);
  animation: pulse 3s infinite;
}

.status-indicator[data-status="online"] {
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.28);
}

.status-indicator[data-status="offline"] {
  background: #dc2626;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.28);
}

.api-indicator {
  position: absolute;
  top: 6px;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(229, 236, 255, 0.62);
}

.api-label {
  pointer-events: none;
}

.header-links {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 19, 32, 0.68);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(237, 242, 255, 0.78);
  transition: transform 180ms ease, box-shadow 180ms ease, color 180ms ease,
    background 180ms ease;
}

.header-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.header-link:hover,
.header-link:focus-visible {
  color: #f7fbff;
  transform: translateY(-1px);
  background: rgba(11, 108, 222, 0.28);
  box-shadow: 0 12px 24px rgba(11, 108, 222, 0.24);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Layout */
.main-content {
  padding: clamp(40px, 5.2vw, 64px) 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr;
  gap: clamp(28px, 4.5vw, 44px);
  align-items: start;
}

/* Info panel */
.info-panel {
  display: grid;
  gap: 24px;
}

.hero-section h2 {
  margin: 0 0 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.9rem, 2.6vw, 2.4rem);
  letter-spacing: -0.01em;
}

.hero-description {
  margin: 0;
  color: var(--color-text-soft);
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  line-height: 1.55;
  max-width: 34ch;
}

.insight-cards {
  display: grid;
  gap: 16px;
}

.insight-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  box-shadow: 0 22px 42px rgba(21, 32, 52, 0.12);
  display: grid;
  gap: 8px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.insight-card:hover,
.insight-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 28px 52px rgba(21, 32, 52, 0.18);
}

.insight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(11, 108, 222, 0.12);
  color: var(--color-accent);
}

.insight-icon svg {
  width: 20px;
  height: 20px;
}

.insight-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-accent);
}

.insight-title {
  margin: 0;
  font-size: 1.05rem;
}

.insight-text {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.meta-item {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 14px;
  display: grid;
  gap: 5px;
  box-shadow: var(--shadow-soft);
}

.meta-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-text-muted);
}

.meta-value {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--color-text);
}

/* Interaction panel */
.interaction-panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: 0 22px 44px rgba(21, 36, 63, 0.12);
  padding: clamp(24px, 3.6vw, 32px);
  animation: fadeUp 620ms ease-out both;
}

.analysis-shell {
  display: grid;
  gap: var(--spacing-lg);
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.section-head h3 {
  margin: 0;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  font-family: "Space Grotesk", sans-serif;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--color-text-soft);
  font-size: clamp(0.85rem, 1vw, 0.95rem);
}

.input-hint {
  margin: 8px 0 14px;
  font-size: 0.86rem;
  color: var(--color-text-muted);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.input-tabs {
  display: inline-flex;
  border-radius: 999px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  padding: 3px;
  margin: 18px 0 16px;
}

.tab-btn {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    transform var(--transition);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: #fff;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.25);
}

.tab-btn:not(.active):hover,
.tab-btn:not(.active):focus-visible {
  color: var(--color-text);
  transform: translateY(-1px);
}

.tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.tab-content.active {
  display: flex;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 14px;
}

.example-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-soft);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
  display: flex;
  flex-direction: column;
}

.example-item img {
  height: 110px;
  object-fit: cover;
}

.example-item span {
  padding: 9px 10px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text);
}

.example-item:hover,
.example-item:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 16px 26px rgba(15, 23, 42, 0.14);
  border-color: rgba(11, 108, 222, 0.45);
}

.example-item.active {
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 20px 32px rgba(37, 99, 235, 0.2);
}

.upload-area {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  padding: var(--spacing-xl) var(--spacing-lg);
  border: 1.5px dashed rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-text-soft);
  cursor: pointer;
  transition: transform var(--transition), background var(--transition);
  flex: 1;
  min-height: 0;
}

.upload-area:hover,
.upload-area:focus-within {
  transform: translateY(-2px);
  background: rgba(37, 99, 235, 0.14);
}

.upload-icon {
  font-size: 2rem;
  color: var(--color-accent);
}

.camera-container {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-soft);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  flex: 1;
  min-height: 0;
}

.camera-container video {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 400px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--color-surface-soft);
  position: relative;
}

.camera-overlay {
  position: absolute;
  top: var(--spacing-md);
  left: var(--spacing-md);
  width: calc(100% - var(--spacing-md) * 2);
  aspect-ratio: 16 / 9;
  max-height: 400px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(37, 99, 235, 0.24);
  pointer-events: none;
  z-index: 1;
}

.camera-controls {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-top: auto;
  flex-shrink: 0;
}

.camera-controls .btn {
  flex: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.camera-controls .btn.primary {
  border: none;
  color: #fff;
}

.camera-controls .btn:hover:not(:disabled),
.camera-controls .btn:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(11, 108, 222, 0.12), rgba(11, 108, 222, 0.04));
  color: var(--color-accent-dark);
}

.camera-controls .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Output */
.output-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 3vw, 32px);
}

.inference-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--color-text-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: 14px 16px;
}

.inference-list strong {
  color: var(--color-text);
}

.results-panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  padding: clamp(22px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3vw, 24px);
  animation: fadeUp 640ms ease-out both;
}

.result-media {
  position: relative;
  border-radius: var(--radius-md);
  background: #e6edfb;
  overflow: hidden;
  min-height: clamp(300px, 35vh, 450px);
  max-height: 500px;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.result-media img,
.result-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity var(--transition);
}

.result-media img,
.result-media canvas {
  object-fit: contain;
}

.result-media canvas {
  pointer-events: none;
}

.result-media img.hidden {
  display: none;
}

.results-panel[data-empty="true"] .result-overlay {
  display: none;
}

.result-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
  color: var(--color-text-muted);
  background: linear-gradient(
    rgba(248, 250, 255, 0.92),
    rgba(248, 250, 255, 0.92)
  );
  transition: opacity var(--transition), visibility var(--transition);
}

.result-placeholder.hidden {
  opacity: 0;
  visibility: hidden;
}

.results-panel[data-empty="true"] .result-media {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02));
}

.result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.result-caption {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-breed {
  font-family: "Space Grotesk", "Poppins", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.result-confidence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-accent);
  background: rgba(11, 108, 222, 0.14);
}

.results-count {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
}

.results-head h3 {
  margin: 0;
  font-size: 1.08rem;
}

#prediction-count {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.prediction-list {
  display: grid;
  gap: 11px;
}

.prediction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
  transition: transform var(--transition), box-shadow var(--transition), border var(--transition);
}

.prediction-item:hover,
.prediction-item:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
  border-color: rgba(11, 108, 222, 0.3);
}

.prediction-item > div {
  display: grid;
  gap: 5px;
}

.prediction-item strong {
  font-size: 0.96rem;
}

.prediction-item footer {
  display: flex;
  gap: 10px;
  align-items: center;
}

.confidence-bar {
  width: 104px;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  overflow: hidden;
  position: relative;
}

.confidence-bar span {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--color-accent), #60a5fa);
  transform-origin: left center;
}

.confidence-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--color-accent);
  background: rgba(11, 108, 222, 0.12);
}

.prediction-item.primary {
  border-color: rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, rgba(11, 108, 222, 0.1), rgba(11, 108, 222, 0.04));
}

.prediction-item.primary strong {
  font-size: 1.08rem;
  color: var(--color-text);
}

.prediction-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(37, 99, 235, 0.18);
  color: var(--color-accent-dark);
}

.prediction-list .placeholder {
  margin: 0;
  text-align: center;
  padding: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
}

/* Footer */
.app-footer {
  border-top: 1px solid rgba(11, 18, 30, 0.2);
  background: rgba(14, 22, 34, 0.94);
  padding: 28px 0;
  box-shadow: 0 -12px 32px rgba(6, 12, 22, 0.26);
  margin-top: auto;
  animation: fadeUp 720ms ease-out both;
}

.app-footer p {
  margin: 0 0 12px;
  text-align: center;
  color: rgba(226, 235, 249, 0.75);
  font-size: 0.88rem;
}

.footer-links {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 19, 32, 0.78);
  color: rgba(226, 235, 249, 0.78);
  font-weight: 600;
  font-size: 0.84rem;
  transition: transform 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: #f5f8ff;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(11, 108, 222, 0.24);
}

.footer-links .link-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Responsive */
@media (min-width: 1920px) {
  .app-shell {
    max-width: 1800px;
    margin: 0 auto;
  }
  
  .container {
    max-width: 1800px;
  }
}

@media (min-width: 2560px) {
  .app-shell {
    max-width: 1800px;
  }
  
  .container {
    max-width: 1800px;
  }
}

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .output-section {
    grid-template-columns: 1fr;
  }

  .header-content {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .header-metrics {
    justify-content: flex-start;
  }

  .header-links {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .input-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .camera-controls {
    flex-direction: column;
  }

  .prediction-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .brand-block {
    gap: 14px;
  }

  .examples-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

@keyframes fadeDown {
  0% {
    opacity: 0;
    transform: translateY(-16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.no-scroll {
  overflow: hidden;
}

/* ============================================================================
   Global Native UI Overrides
   ============================================================================ */

/* Scrollbars - Webkit */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(11, 108, 222, 0.4);
  border-radius: 4px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(11, 108, 222, 0.6);
}

/* Scrollbars - Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(11, 108, 222, 0.4) var(--color-bg);
}

/* Text Selection (já existe, mas vamos garantir consistência) */
::selection {
  background: rgba(11, 108, 222, 0.25);
  color: var(--color-text);
}

::-moz-selection {
  background: rgba(11, 108, 222, 0.25);
  color: var(--color-text);
}

/* Inputs & Dropdowns */
input,
textarea,
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  padding: 10px 14px;
  font: inherit;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230b6cde' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-color: var(--color-accent);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

/* Focus Ring */
*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

