:root {
  --bg: #07110c;
  --bg-2: #0a2016;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --muted-2: rgba(255, 255, 255, 0.55);
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.28);

  --brand: #16a34a;
  --brand-2: #22c55e;
  --brand-3: #a3ffbe;
  --danger: #ef4444;
  --warn: #f59e0b;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --container: 1120px;
  --nav-space: 96px;
  --nav-container: 1260px;
}

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

html,
body {
  min-height: 100%;
}

html {
  scroll-padding-top: calc(var(--nav-space) + 16px);
  color-scheme: dark;
}

body.app-body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.text-muted {
  color: var(--muted) !important;
}

/* Bootstrap accordion theming */
.accordion {
  --bs-accordion-bg: transparent;
  --bs-accordion-border-color: rgba(255, 255, 255, 0.12);
  --bs-accordion-btn-color: var(--text);
  --bs-accordion-color: var(--muted);
  --bs-accordion-btn-bg: rgba(255, 255, 255, 0.05);
  --bs-accordion-active-bg: rgba(34, 197, 94, 0.12);
  --bs-accordion-active-color: var(--text);
  --bs-accordion-btn-focus-border-color: rgba(34, 197, 94, 0.5);
  --bs-accordion-btn-focus-box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.accordion-button {
  border-radius: 14px !important;
}

.accordion-button::after {
  filter: invert(1) opacity(0.7);
}

.accordion-item {
  border-radius: 16px;
  overflow: hidden;
}

.app-main {
  flex: 1 0 auto;
  padding-top: var(--nav-space);
  padding-bottom: 24px;
}

.skip-link {
  position: absolute;
  left: 10px;
  top: -60px;
  z-index: 2000;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  transition: top 180ms ease;
}

.skip-link:focus {
  top: 10px;
}

/* Buttons */
.btn {
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none;
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 14px 28px rgba(34, 197, 94, 0.32);
}

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

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.btn-pill {
  padding-inline: 16px;
}

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -50%;
  width: 42%;
  height: 220%;
  transform: rotate(25deg) translateX(-90%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.22),
    transparent
  );
  transition: transform 700ms ease;
}

.btn-glow:hover::after {
  transform: rotate(25deg) translateX(220%);
}

.btn-icon {
  padding: 0;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.btn-icon.btn-sm {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

/* Floating navbar */
.nav-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  padding: 6px 14px 0;
}

.navbar-floating {
  max-width: var(--nav-container);
  margin: 0 auto;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(10, 32, 22, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 8px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-text {
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.22);
  color: var(--brand-3);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-mark-sm {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.nav-toggle {
  display: none;
  border: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
}

.nav-toggle i {
  font-size: 1.35rem;
}

.nav-collapse {
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 12px;
}

@media (min-width: 992px) {
  .nav-collapse {
    display: flex !important;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.nav-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease,
    border-color 160ms ease;
}

.nav-link-pill i {
  opacity: 0.78;
  font-size: 1rem;
}

.nav-link-pill:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.nav-link-pill.is-active {
  color: var(--text);
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.25);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 8px;
}

/* Hero */
.hero {
  position: relative;
  padding: 96px 0 52px;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
}

.hero--top {
  margin-top: calc(-1 * var(--nav-space));
  padding-top: calc(92px + var(--nav-space));
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      90deg,
      rgba(7, 17, 12, 0.92),
      rgba(7, 17, 12, 0.6) 55%,
      rgba(7, 17, 12, 0.92)
    ),
    var(--hero-image);
  background-size: cover, cover;
  background-position: center, center calc(50% + var(--bg-offset, 0px));
  background-repeat: no-repeat;
  filter: saturate(1.15) contrast(1.05);
  transform: scale(1.05);
  opacity: 0.92;
  pointer-events: none;
  z-index: -1;
}

.hero::after {
  content: none;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 18px 0 10px;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 48ch;
}

.hero-card {
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: floaty 7.5s ease-in-out infinite;
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-stats {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat-pill {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 14px 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.22);
  color: var(--brand-3);
  flex-shrink: 0;
}

.stat-icon i {
  font-size: 1.15rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.stat-value {
  font-weight: 800;
  margin: 0;
}

/* Section */
.section {
  padding: 72px 0;
}

.section-title {
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.section-subtitle {
  color: var(--muted);
  margin: 10px 0 0;
  max-width: 60ch;
}

.glass {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background-clip: padding-box;
  overflow: hidden;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.feature-card {
  padding: 18px 18px 16px;
  height: 100%;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 197, 94, 0.26);
  background: rgba(255, 255, 255, 0.085);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.24);
  color: var(--brand-3);
}

.feature-icon i {
  font-size: 1.2rem;
}

.feature-card:hover .feature-icon {
  box-shadow: 0 18px 40px rgba(34, 197, 94, 0.22);
}

.feature-title {
  font-weight: 750;
  margin-bottom: 6px;
}

.feature-text {
  color: var(--muted);
  margin: 0;
}

/* Scenic section background */
.scenic {
  position: relative;
  overflow: hidden;
  z-index: 0;
  isolation: isolate;
}

.scenic::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--scenic-image);
  background-size: cover;
  background-position: center calc(50% + var(--bg-offset, 0px));
  background-repeat: no-repeat;
  filter: saturate(1.12) contrast(1.04);
  opacity: 0.26;
  transform: scale(1.05);
  pointer-events: none;
  z-index: -2;
}

.scenic::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(70% 90% at 50% 18%, rgba(34, 197, 94, 0.14), transparent 62%),
    linear-gradient(
      to bottom,
      rgba(7, 17, 12, 0.92) 0%,
      rgba(7, 17, 12, 0.55) 20%,
      rgba(7, 17, 12, 0.55) 80%,
      rgba(7, 17, 12, 0.92) 100%
    );
  transform: scale(1.05);
  pointer-events: none;
  z-index: -1;
}

.callout {
  padding: 30px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
}

/* Auth pages */
.auth-wrap {
  min-height: calc(100vh - var(--nav-space));
  display: grid;
  place-items: center;
  padding: 46px 0 70px;
}

.auth-wrap.scenic {
  padding: 56px 0 82px;
}

.auth-grid {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: stretch;
  margin-inline: auto;
}

.auth-panel {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--auth-image);
  background-size: cover;
  background-position: center;
  filter: saturate(1.15) contrast(1.05);
  transform: scale(1.06);
  pointer-events: none;
  z-index: -2;
}

.auth-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(70% 60% at 15% 10%, rgba(34, 197, 94, 0.18), transparent 60%),
    radial-gradient(70% 60% at 85% 20%, rgba(56, 189, 248, 0.18), transparent 62%),
    linear-gradient(110deg, rgba(7, 17, 12, 0.88), rgba(7, 17, 12, 0.5)),
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: auto, auto, auto, 44px 44px, 44px 44px;
  transform: scale(1.06);
  transform-origin: center;
  pointer-events: none;
  z-index: -1;
}

.auth-panel-inner {
  padding: 34px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
}

.auth-panel-title {
  font-size: 2.15rem;
  font-weight: 850;
  margin: 0;
}

.auth-panel-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.auth-card {
  border-radius: 28px;
  padding: 26px;
  position: relative;
  overflow: hidden;
}

.auth-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(60% 60% at 20% 0%, rgba(34, 197, 94, 0.14), transparent 60%),
    radial-gradient(60% 60% at 80% 10%, rgba(168, 85, 247, 0.14), transparent 64%);
  opacity: 0.55;
  pointer-events: none;
}

.auth-card > * {
  position: relative;
  z-index: 1;
}
.form-control,
.form-select {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  padding: 12px 14px;
}

.form-select {
  color-scheme: dark;
  background-color: rgba(255, 255, 255, 0.08);
}

.form-select option,
.form-select optgroup {
  background: #0f1c15 !important;
  color: #e8fff0 !important;
}

.form-select option:checked {
  background: #1f8a59 !important;
  color: #f8fff8 !important;
}

select option,
select optgroup {
  background: #0f1c15 !important;
  color: #e8fff0 !important;
}

select option:checked,
select option:focus,
select option:hover {
  background: #1f8a59 !important;
  color: #f8fff8 !important;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  opacity: 1 !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.85);
}

.form-text {
  color: rgba(255, 255, 255, 0.6);
}

.form-label {
  color: var(--muted);
  font-weight: 650;
  font-size: 0.92rem;
}

.lock-card {
  position: relative;
}

.lock-card.is-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 6, 0.38);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  z-index: 2;
}

.lock-card.is-locked::before {
  content: "Locked";
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.86);
  font-weight: 750;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  z-index: 3;
}

/* Chatbot */
.chat-hero {
  --scenic-image:
    radial-gradient(60% 80% at 30% 18%, rgba(34, 197, 94, 0.22), transparent 65%),
    radial-gradient(55% 90% at 80% 32%, rgba(59, 130, 246, 0.16), transparent 70%),
    radial-gradient(70% 70% at 55% 80%, rgba(236, 72, 153, 0.12), transparent 68%);
}

.chat-side {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: var(--chat-shell-height, auto) !important;
}

.chat-shell {
  height: var(--chat-shell-height, auto);
}

@media (max-width: 991.98px) {
  .chat-shell {
    height: auto;
  }
  .chat-side {
    height: auto !important;
  }
  .chat-panel {
    height: auto !important;
    min-height: 640px;
  }
}

.chat-side::after {
  content: "";
  position: absolute;
  inset: -1px;
  background-image:
    linear-gradient(to right, rgba(34, 197, 94, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(34, 197, 94, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.18;
  transform: translate3d(0, 0, 0);
  pointer-events: none;
  z-index: 0;
  animation: chatGridDrift 12s linear infinite;
}

.chat-side > * {
  position: relative;
  z-index: 1;
}

.chat-core {
  position: relative;
  width: 100px;
  height: 100px;
  margin-inline: auto;
  display: grid;
  place-items: center;
}

.chat-orb {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 44%),
    radial-gradient(circle at 50% 60%, rgba(34, 197, 94, 0.72), rgba(34, 197, 94, 0.12) 55%, rgba(0, 0, 0, 0) 76%),
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.38), rgba(0, 0, 0, 0) 65%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 20px 50px rgba(34, 197, 94, 0.22),
    0 10px 40px rgba(59, 130, 246, 0.14);
  animation: chatPulse 2.8s ease-in-out infinite;
}

.chat-orb-ring {
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 28px rgba(34, 197, 94, 0.18);
  opacity: 0.9;
}

.chat-orb-ring.ring-a {
  transform: rotate(10deg);
  animation: chatSpin 7s linear infinite;
}

.chat-orb-ring.ring-b {
  inset: 18px;
  border-style: dashed;
  border-color: rgba(34, 197, 94, 0.2);
  opacity: 0.75;
  animation: chatSpinReverse 10s linear infinite;
}

.chat-orb-spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  top: 50%;
  left: 50%;
  background: rgba(34, 197, 94, 0.9);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.8);
  animation: chatSparkOrbit 2.9s linear infinite;
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
  font-size: 0.82rem;
}

.chat-panel {
  height: var(--chat-shell-height, clamp(780px, calc(100vh - 120px), 980px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: var(--chat-shell-height, clamp(780px, calc(100vh - 120px), 980px)) !important;
}

.chat-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(80% 200% at 20% 0%, rgba(34, 197, 94, 0.14), transparent 65%),
    radial-gradient(70% 180% at 90% 0%, rgba(59, 130, 246, 0.12), transparent 60%);
}

.chat-live-status {
  gap: 12px !important;
  align-items: center;
}

.chat-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 10px;
  background: rgba(34, 197, 94, 0.95);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12), 0 0 20px rgba(34, 197, 94, 0.6);
  animation: chatLive 1.4s ease-in-out infinite;
}

.chat-live-copy {
  display: grid;
  gap: 2px;
  line-height: 1.15;
}

.chat-live-title {
  font-weight: 850;
  letter-spacing: -0.01em;
}

.chat-messages {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  min-height: 0;
  overflow-x: hidden;
  scroll-behavior: smooth;
  font-size: 0.95rem;
  background-image:
    radial-gradient(80% 90% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 65%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.chat-row.is-user {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(560px, 92%);
  border-radius: 18px;
  padding: 12px 14px;
  line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-bubble--user {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.22);
}

.chat-bubble--assistant {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.18);
}

.chat-bubble-content {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 520;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-row.is-entering .chat-bubble {
  transform: translateY(10px) scale(0.985);
  opacity: 0;
  animation: chatPop 320ms ease forwards;
}

.chat-compose {
  padding: 16px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.12);
}

.chat-compose-inner {
  display: flex;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 16, 12, 0.38);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.chat-attach {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  align-self: center;
}

.chat-attachment-preview {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-attachment-thumb {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex: 0 0 auto;
}

.chat-attachment-meta {
  flex: 1;
  min-width: 0;
}

.chat-attachment-name {
  font-weight: 750;
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment-remove {
  flex: 0 0 auto;
}

.chat-panel.is-drop-target {
  outline: 2px dashed rgba(34, 197, 94, 0.55);
  outline-offset: 6px;
}

.chat-bubble-image {
  width: min(420px, 100%);
  max-height: 320px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
  margin-bottom: 10px;
}

.chat-md-p {
  margin: 0;
}

.chat-md-gap {
  height: 10px;
}

.chat-md-heading {
  margin: 0 0 6px;
  font-weight: 860;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.94);
}

.chat-md-list {
  margin: 0;
  padding-left: 18px;
}

.chat-md-link {
  color: rgba(147, 197, 253, 0.95);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chat-inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-code-block {
  margin: 10px 0 0;
  padding: 12px 12px;
  border-radius: 14px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-code-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: rgba(255, 255, 255, 0.9);
  white-space: pre;
}

.chat-side-top {
  flex: 0 0 auto;
}

.chat-input {
  resize: none;
  min-height: 50px;
  height: 50px;
  max-height: 160px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.96);
  padding: 12px 14px;
  line-height: 1.35;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.chat-send {
  border-radius: 14px;
  min-height: 50px;
  height: 50px;
  padding-inline: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  align-self: center;
}

.chat-typing {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  height: 18px;
}

.chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  opacity: 0.7;
  animation: chatTyping 1.1s ease-in-out infinite;
}

.chat-typing span:nth-child(2) {
  animation-delay: 0.12s;
}

.chat-typing span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes chatPop {
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes chatTyping {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@keyframes chatPulse {
  0%,
  100% {
    transform: scale(1);
    filter: saturate(1.05);
  }
  50% {
    transform: scale(1.04);
    filter: saturate(1.25);
  }
}

@keyframes chatSpin {
  to {
    transform: rotate(370deg);
  }
}

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

@keyframes chatSparkOrbit {
  from {
    transform: translate(-50%, -50%) rotate(0deg) translate(0, -44px) scale(1);
    opacity: 1;
  }
  60% {
    opacity: 0.92;
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg) translate(0, -44px) scale(0.92);
    opacity: 1;
  }
}

@keyframes chatLive {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes chatGridDrift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(42px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-side::after,
  .chat-orb,
  .chat-orb-ring,
  .chat-orb-spark,
  .chat-live-dot,
  .chat-typing span {
    animation: none !important;
  }
  .chat-messages {
    scroll-behavior: auto;
  }
}

/* Mini chat widget */
.chat-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1060;
}

.chat-widget-fab {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.chat-widget-fab:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.chat-widget-fab-core {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.chat-widget-fab-orb {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 44%),
    radial-gradient(circle at 50% 60%, rgba(34, 197, 94, 0.7), rgba(34, 197, 94, 0.1) 58%, rgba(0, 0, 0, 0) 78%),
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.34), rgba(0, 0, 0, 0) 65%);
  filter: saturate(1.15);
  opacity: 0.95;
  animation: chatPulse 2.8s ease-in-out infinite;
}

.chat-widget-fab-ring {
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 24px rgba(34, 197, 94, 0.18);
  opacity: 0.8;
  animation: chatSpinReverse 9s linear infinite;
}

.chat-widget-fab-spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.92);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.75);
  animation: chatSparkOrbit 2.9s linear infinite;
}

.chat-widget-fab-icon {
  position: relative;
  z-index: 1;
  font-size: 1.08rem;
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.chat-widget-panel {
  width: min(420px, calc(100vw - 36px));
  height: 520px;
  max-height: calc(100vh - 120px);
  position: absolute;
  right: 0;
  bottom: 74px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  transform-origin: 92% 100%;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease;
}

.chat-widget.is-open .chat-widget-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.chat-widget-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(90% 200% at 20% 0%, rgba(34, 197, 94, 0.14), transparent 65%),
    radial-gradient(70% 180% at 90% 0%, rgba(59, 130, 246, 0.12), transparent 60%);
}

.chat-widget-messages {
  flex: 1;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  min-height: 0;
  overflow-x: hidden;
  background-image:
    radial-gradient(80% 90% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 65%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}

.chat-history {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-threads {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.chat-thread {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.chat-thread:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.chat-thread.is-active {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.12);
}

.chat-thread-main {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 2px 2px;
}

.chat-thread-main:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
  border-radius: 10px;
}

.chat-thread-delete {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.16);
  color: rgba(255, 255, 255, 0.78);
}

.chat-thread-delete:hover {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.18);
  color: #fee2e2;
}

.chat-thread-delete i {
  pointer-events: none;
}

.chat-thread-title {
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-thread-meta {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-widget-compose {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.12);
}

.chat-widget-compose-inner {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-widget-input {
  resize: none;
  min-height: 44px;
  max-height: 120px;
}

.chat-widget-send {
  border-radius: 14px;
  padding-inline: 14px;
  padding-block: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .chat-widget-fab-orb,
  .chat-widget-fab-ring,
  .chat-widget-fab-spark {
    animation: none !important;
  }
}

/* Predictor */
.model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.batch-item {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  padding: 8px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.batch-item:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(255, 255, 255, 0.07);
}

.batch-item.is-active {
  border-color: rgba(34, 197, 94, 0.65);
  background: rgba(34, 197, 94, 0.12);
}

.batch-item:focus-visible {
  outline: 3px solid rgba(34, 197, 94, 0.45);
  outline-offset: 2px;
}

.batch-remove:focus-visible {
  outline: 3px solid rgba(34, 197, 94, 0.45);
  outline-offset: 2px;
}

.batch-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: block;
}

.batch-meta {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.85);
  display: grid;
  place-items: center;
}

.batch-remove:hover {
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
}

.batch-results-shell {
  --batch-card-min-h: 600px;
  display: grid;
  gap: 12px;
  align-content: start;
  border-radius: 20px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(56, 189, 248, 0.11), transparent 62%),
    rgba(4, 14, 12, 0.42);
  padding: 12px;
}

.batch-results {
  display: grid;
  gap: 12px;
  height: calc(var(--batch-card-min-h) * 2 + 12px);
  align-content: start;
  overflow: hidden;
}

.batch-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.batch-page-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(8, 18, 14, 0.76);
  color: #e2e8f0;
  font-weight: 820;
  display: inline-grid;
  place-items: center;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.batch-page-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.52);
  background: rgba(56, 189, 248, 0.16);
  color: #f8fafc;
}

.batch-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.batch-page-btn.is-active {
  border-color: rgba(34, 197, 94, 0.78);
  background:
    radial-gradient(110% 110% at 20% 10%, rgba(34, 197, 94, 0.24), transparent 60%),
    rgba(13, 31, 20, 0.94);
  color: #bbf7d0;
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.24) inset,
    0 10px 24px rgba(34, 197, 94, 0.2);
}

.batch-page-btn.is-dots {
  border-style: dashed;
}

.batch-result {
  height: var(--batch-card-min-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(136, 255, 188, 0.2);
  background:
    radial-gradient(90% 150% at 0% 0%, rgba(34, 197, 94, 0.16), transparent 52%),
    linear-gradient(145deg, rgba(8, 22, 15, 0.85), rgba(8, 16, 14, 0.7));
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.32);
}

.batch-result-header {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.18);
}

.batch-result-thumb {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  object-fit: cover;
  display: block;
}

.batch-result-title {
  font-weight: 850;
  margin: 0;
  color: #f8fff8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.batch-result-subtitle {
  color: rgba(236, 253, 245, 0.76);
  margin: 2px 0 0;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.14);
  color: #ffedd5;
  font-weight: 750;
  font-size: 0.85rem;
  white-space: nowrap;
}

.batch-confidence {
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(34, 197, 94, 0.42);
  background: rgba(3, 18, 11, 0.75);
}

.batch-confidence-value {
  font-weight: 900;
  font-size: 1.25rem;
  color: #22c55e;
  line-height: 1.1;
}

.batch-confidence-label {
  color: rgba(236, 253, 245, 0.86);
  font-size: 0.86rem;
  font-weight: 700;
}

.batch-why {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.24);
  color: rgba(248, 250, 252, 0.94);
  font-size: 1.02rem;
  line-height: 1.5;
  padding: 10px 12px;
  min-height: 4.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.batch-details {
  margin-top: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.batch-details .row {
  margin-left: 0;
  margin-right: 0;
}

.batch-details::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.batch-details::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.38);
}

.batch-details::-webkit-scrollbar-track {
  background: transparent;
}

.batch-panel {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(1, 10, 8, 0.3);
  padding: 10px;
}

.batch-panel--actions {
  border-color: rgba(56, 189, 248, 0.34);
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(56, 189, 248, 0.15), transparent 62%),
    rgba(1, 10, 8, 0.38);
}

.batch-panel-title {
  color: rgba(248, 250, 252, 0.95);
  font-weight: 780;
  font-size: 0.98rem;
}

.batch-footnote {
  color: rgba(186, 230, 253, 0.9);
  font-size: 0.84rem;
}

.batch-result .result-metric {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.batch-result .result-metric strong {
  color: #f8fafc;
}

.batch-result .result-metric.is-good {
  border-color: rgba(34, 197, 94, 0.58);
  background: rgba(22, 163, 74, 0.22);
}

.batch-result .btn-ghost {
  border-color: rgba(56, 189, 248, 0.34);
  background: rgba(56, 189, 248, 0.12);
  color: #e0f2fe;
}

.batch-result .btn-ghost:hover {
  border-color: rgba(56, 189, 248, 0.62);
  background: rgba(56, 189, 248, 0.24);
  color: #f8fafc;
}

.choice-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

.choice-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(255, 255, 255, 0.085);
}

.choice-card.is-selected {
  border-color: rgba(34, 197, 94, 0.65);
  background: rgba(34, 197, 94, 0.12);
}

.choice-title {
  font-weight: 850;
  margin: 0;
}

.choice-meta {
  color: var(--muted);
  margin: 8px 0 0;
}

.dropzone {
  border-radius: 26px;
  border: 1.5px dashed rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
}

.dropzone.is-dragover {
  border-color: rgba(34, 197, 94, 0.85);
  background: rgba(34, 197, 94, 0.12);
  transform: translateY(-2px);
}

.preview-img {
  width: min(320px, 100%);
  max-height: 180px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.preview-img.is-blurred {
  filter: blur(10px) saturate(1.15);
  transform: scale(1.03);
}

.result-card {
  border-radius: 26px;
  padding: 22px;
}

.result-empty {
  color: var(--muted);
  display: grid;
  place-items: center;
  min-height: 240px;
  text-align: center;
}

.result-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.result-metric strong {
  font-weight: 850;
}

.result-metric.is-warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.result-metric.is-good {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.result-insights {
  border: 1px solid rgba(56, 189, 248, 0.2);
  background:
    linear-gradient(150deg, rgba(6, 20, 18, 0.78), rgba(6, 14, 22, 0.76)),
    radial-gradient(120% 100% at 85% 0%, rgba(56, 189, 248, 0.14), transparent 62%);
}

.result-insight-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
}

.result-confidence-donut {
  --pct: 0%;
  width: min(170px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(5, 12, 9, 0.92) 56%, transparent 57%),
    conic-gradient(rgba(34, 197, 94, 0.9) 0 var(--pct), rgba(255, 255, 255, 0.12) var(--pct) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.result-confidence-donut strong {
  font-size: 1.26rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.result-confidence-donut span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.result-confidence-donut.is-mid {
  background:
    radial-gradient(circle at center, rgba(5, 12, 9, 0.92) 56%, transparent 57%),
    conic-gradient(rgba(56, 189, 248, 0.9) 0 var(--pct), rgba(255, 255, 255, 0.12) var(--pct) 100%);
}

.result-confidence-donut.is-warn {
  background:
    radial-gradient(circle at center, rgba(5, 12, 9, 0.92) 56%, transparent 57%),
    conic-gradient(rgba(245, 158, 11, 0.9) 0 var(--pct), rgba(255, 255, 255, 0.12) var(--pct) 100%);
}

.result-prob-bars {
  display: grid;
  gap: 9px;
}

.result-prob-row {
  display: grid;
  grid-template-columns: minmax(108px, 1.3fr) minmax(90px, 2.4fr) auto;
  gap: 10px;
  align-items: center;
}

.result-prob-label {
  color: var(--muted);
  font-weight: 750;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-prob-track {
  height: 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.result-prob-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.92), rgba(14, 165, 233, 0.52));
  transition: width 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.result-prob-fill.is-primary {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.95), rgba(16, 185, 129, 0.6));
}

.result-prob-value {
  color: var(--text);
  font-weight: 850;
  font-size: 0.9rem;
}

.result-insight-metric {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-insight-metric .label {
  color: var(--muted);
  font-weight: 700;
}

.result-insight-metric strong {
  color: var(--text);
  font-weight: 900;
}

.feedback-label-select {
  min-width: 220px;
  width: min(320px, 100%);
}

.feedback-label-select,
.batch-feedback-select,
.tile-feedback-select {
  color: #f8fff8;
  background: rgba(2, 24, 20, 0.82);
  border-color: rgba(56, 189, 248, 0.36);
  color-scheme: dark;
}

.feedback-label-select option,
.batch-feedback-select option,
.tile-feedback-select option {
  color: #e8fff0 !important;
  background: #0f1c15 !important;
}

.batch-feedback {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.16);
}

.batch-feedback-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.batch-feedback-select {
  min-width: 180px;
  width: min(280px, 100%);
  border-color: rgba(56, 189, 248, 0.46);
  background: rgba(2, 24, 20, 0.84);
  color: #f8fff8;
}

.batch-result [data-batch-correct-status] {
  color: rgba(191, 219, 254, 0.92);
}

.tile-feedback {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.tile-feedback-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.tile-feedback-select {
  min-width: 0;
  width: 100%;
}

.tile-feedback .text-muted {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 650;
}

.app-tabs {
  gap: 8px;
}

.app-tabs .nav-link {
  color: var(--muted);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  font-weight: 750;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.app-tabs .nav-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.app-tabs .nav-link.active {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--text);
}

/* Live predictor */
.live-shell {
  border-radius: 28px;
}

.live-stage-wrap {
  border-radius: 24px;
}

.live-stage {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.28);
  aspect-ratio: 16 / 9;
  min-height: 300px;
}

.live-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateZ(0);
}

.live-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.live-result-banner {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(8px);
}

.live-result-banner.is-good {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(7, 17, 12, 0.46);
}

.live-result-banner.is-warn {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(40, 25, 5, 0.52);
}

.live-result-title {
  font-weight: 850;
  font-size: clamp(0.96rem, 1.6vw, 1.1rem);
  line-height: 1.1;
}

.live-result-meta {
  margin-top: 3px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.76);
}

.live-center-guide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.live-center-ring {
  width: min(52vmin, 46%);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 0 0 999px rgba(0, 0, 0, 0.16),
    inset 0 0 0 2px rgba(0, 0, 0, 0.22);
}

.live-center-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: rgba(34, 197, 94, 0.85);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.18);
}

@media (max-width: 991px) {
  .live-stage {
    min-height: 240px;
  }

  .live-center-ring {
    width: min(68vmin, 62%);
  }

  .batch-results-shell {
    --batch-card-min-h: 560px;
  }
}

/* Smart fridge tiles */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.fridge-controls {
  flex-wrap: wrap;
}

.predict-mode-group {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.predict-mode-group .predict-mode-btn {
  border-radius: 14px !important;
  padding-inline: 14px;
  min-width: 110px;
}

.predict-mode-group .btn-check:checked + .predict-mode-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.22);
  color: var(--text);
}

.fridge-modal .modal-header {
  padding-bottom: 8px;
}

.fridge-crop-stage {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
}

.fridge-crop-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  cursor: crosshair;
}

.fridge-preset-group {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.fridge-preset-group .btn {
  border-radius: 14px !important;
  padding-inline: 14px;
  min-width: 64px;
}

.fridge-preset-group .btn-check:checked + .btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.22);
  color: var(--text);
}

.fridge-controls .fridge-grid-btn,
.fridge-controls .btn {
  height: 40px;
}

.tile-chip {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  min-height: 84px;
  display: grid;
  gap: 6px;
  transition: transform 180ms ease, border-color 180ms ease;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.tile-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  display: block;
}

.tile-index {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  font-weight: 800;
}

.tile-label {
  font-weight: 850;
  line-height: 1.15;
  min-width: 0;
  font-size: 0.98rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-score {
  color: var(--muted);
  font-weight: 700;
}

#fridgeTiles[data-grid="3"] {
  gap: 8px;
}

#fridgeTiles[data-grid="3"] .tile-chip {
  padding: 9px;
  border-radius: 14px;
}

#fridgeTiles[data-grid="3"] .tile-index {
  top: 12px;
  left: 12px;
  padding: 3px 8px;
}

#fridgeTiles[data-grid="3"] .tile-label {
  font-size: 0.92rem;
}

#fridgeTiles[data-grid="3"] .tile-score {
  font-size: 0.86rem;
}

#fridgeSummary .result-metric {
  align-items: center;
  gap: 12px;
}

#fridgeSummary .result-metric span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#fridgeSummary .result-metric strong {
  flex: 0 0 auto;
  white-space: nowrap;
}

.tile-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.28);
}

.tile-chip strong {
  font-weight: 850;
}

.tile-chip .small {
  color: var(--muted);
}

/* Mini charts */
.mini-bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 12px;
}

.bar-row .label {
  color: var(--muted);
  font-weight: 700;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.75), rgba(34, 197, 94, 0.25));
  transition: width 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bar-fill.is-warn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.75), rgba(245, 158, 11, 0.25));
}

.bar-row .value {
  font-weight: 850;
  color: var(--text);
}

@media (max-width: 575px) {
  .batch-results-shell {
    --batch-card-min-h: 500px;
  }

  .result-prob-row {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
  }

  .result-prob-value {
    text-align: right;
  }

  .bar-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .tile-feedback-row {
    grid-template-columns: 1fr;
  }

  .tile-feedback-row .btn {
    width: 100%;
  }
}

/* Profile */
.profile-page {
  --profile-accent-a: rgba(56, 189, 248, 0.42);
  --profile-accent-b: rgba(168, 85, 247, 0.36);
}

.profile-hero {
  padding-top: 34px;
}

.profile-card {
  border-radius: 28px;
  padding: 22px;
}

.profile-card--hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.profile-cover {
  position: absolute;
  inset: -1px;
  background-image:
    radial-gradient(70% 60% at 20% 10%, rgba(34, 197, 94, 0.18), transparent 60%),
    radial-gradient(70% 60% at 70% 20%, var(--profile-accent-a), transparent 58%),
    linear-gradient(to bottom, rgba(7, 17, 12, 0.92), rgba(7, 17, 12, 0.35)),
    var(--cover-image);
  background-size: cover;
  background-position: center;
  filter: saturate(1.1) contrast(1.05);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.profile-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to bottom, rgba(7, 17, 12, 0.35) 0%, rgba(7, 17, 12, 0.9) 100%),
    radial-gradient(60% 60% at 50% 0%, rgba(34, 197, 94, 0.08), transparent 60%);
  pointer-events: none;
}

.profile-hero-inner {
  position: relative;
  z-index: 1;
}

.profile-name {
  font-weight: 950;
  letter-spacing: -0.03em;
}

.profile-badge-hunter {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(251, 146, 60, 0.55);
  background:
    radial-gradient(90% 90% at 28% 22%, rgba(255, 237, 213, 0.45), transparent 58%),
    linear-gradient(140deg, rgba(249, 115, 22, 0.32), rgba(245, 158, 11, 0.22) 55%, rgba(244, 63, 94, 0.24));
  color: #ffd166;
  box-shadow:
    0 12px 28px rgba(249, 115, 22, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  cursor: help;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.profile-badge-hunter i {
  font-size: 1.28rem;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.45));
}

.profile-badge-hunter:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow:
    0 16px 32px rgba(249, 115, 22, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.profile-badge-active {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.58);
  background:
    radial-gradient(85% 85% at 22% 18%, rgba(224, 242, 254, 0.45), transparent 58%),
    linear-gradient(145deg, rgba(6, 182, 212, 0.3), rgba(59, 130, 246, 0.3) 58%, rgba(14, 165, 233, 0.22));
  color: #dbeafe;
  box-shadow:
    0 12px 28px rgba(14, 165, 233, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  cursor: help;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.profile-badge-active i {
  font-size: 1.2rem;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.46));
}

.profile-badge-active:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow:
    0 16px 32px rgba(14, 165, 233, 0.44),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.24);
  display: grid;
  place-items: center;
  color: var(--brand-3);
  font-weight: 850;
  font-size: 1.25rem;
}

.avatar--glow {
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.38),
    0 0 0 6px rgba(34, 197, 94, 0.14);
}

.dashboard-tile {
  border-radius: 22px;
  position: relative;
  overflow: hidden;
}

.dashboard-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(135deg, rgba(34, 197, 94, 0.12), transparent 55%),
    radial-gradient(60% 60% at 70% 10%, var(--profile-accent-b), transparent 60%),
    linear-gradient(
      to right,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px
    ),
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px
    );
  background-size: auto, auto, 34px 34px, 34px 34px;
  opacity: 0.45;
  pointer-events: none;
}

.tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: var(--brand-3);
  box-shadow: 0 18px 44px rgba(34, 197, 94, 0.12);
}

.tile-icon i {
  font-size: 1.1rem;
}

.stat-card {
  border-radius: 22px;
  padding: 18px;
  height: 100%;
}

.stat-card--neon {
  position: relative;
  overflow: hidden;
}

.stat-card--neon::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(60% 70% at 20% 0%, rgba(34, 197, 94, 0.16), transparent 60%),
    radial-gradient(60% 70% at 80% 10%, var(--profile-accent-a), transparent 64%);
  opacity: 0.35;
  pointer-events: none;
}

.stat-card--neon::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.55), transparent);
  opacity: 0.6;
  pointer-events: none;
}

.kpi-value {
  font-weight: 950;
  font-size: 1.9rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.kpi-value--sm {
  font-size: 1.35rem;
}

.dashboard-card {
  border-radius: 26px;
  position: relative;
  overflow: hidden;
}

.dashboard-card:not(.scenic)::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(70% 60% at 50% 0%, rgba(34, 197, 94, 0.09), transparent 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 55%);
  opacity: 0.55;
  pointer-events: none;
}

.dashboard-card > * {
  position: relative;
  z-index: 1;
}

.history-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  transition: transform 180ms ease, border-color 180ms ease;
  position: relative;
  overflow: hidden;
}

.history-item--selected {
  border-color: rgba(56, 189, 248, 0.72);
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(34, 197, 94, 0.12) 60%, rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.07);
  box-shadow:
    0 24px 58px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(56, 189, 248, 0.35) inset;
}

.history-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(50% 70% at 10% 0%, rgba(34, 197, 94, 0.12), transparent 60%),
    radial-gradient(50% 70% at 90% 0%, var(--profile-accent-b), transparent 62%);
  opacity: 0.25;
  pointer-events: none;
}

.history-item > * {
  position: relative;
  z-index: 1;
}

.history-item:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.3);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.35);
}

.history-thumb {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  background:
    radial-gradient(100% 100% at 10% 0%, rgba(34, 197, 94, 0.22), transparent 60%),
    rgba(34, 197, 94, 0.12);
  display: grid;
  place-items: center;
  color: var(--brand-3);
  background-image:
    linear-gradient(to bottom, rgba(7, 17, 12, 0.15), rgba(7, 17, 12, 0.75)),
    var(--thumb-image, none);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  position: relative;
}

.history-thumb.has-image {
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.history-thumb i {
  font-size: 1.1rem;
  opacity: 0.92;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

.history-thumb.has-image i {
  opacity: 0.85;
}

.history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.chip--good {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
  color: var(--text);
}

.chip--warn {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.1);
  color: var(--text);
}

.chip--model {
  border-color: rgba(56, 189, 248, 0.26);
  background: rgba(56, 189, 248, 0.1);
  color: var(--text);
}

.chip--fridge {
  border-color: rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.12);
  color: var(--text);
}

.chip--corrected {
  border-color: rgba(236, 72, 153, 0.45);
  background: rgba(236, 72, 153, 0.2);
  color: #fdf2f8;
  box-shadow: 0 0 0 1px rgba(251, 207, 232, 0.22) inset;
}

.history-meter {
  width: 150px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-top: 8px;
}

.history-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.75), rgba(56, 189, 248, 0.4));
  transition: width 850ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.history-score {
  text-align: right;
}

.history-score strong {
  color: var(--brand-2);
  font-size: 1.15rem;
}

.history-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.history-icon-btn {
  border-radius: 12px;
}

.history-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.32);
  background: rgba(6, 18, 12, 0.62);
  color: rgba(186, 230, 253, 0.95);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.history-select--left {
}

.profile-page .history-item {
  grid-template-columns: 40px 56px 1fr auto;
  grid-template-areas: "select thumb main score";
}

.profile-page .history-thumb {
  grid-area: thumb;
}

.profile-page .history-main {
  grid-area: main;
}

.profile-page .history-score {
  grid-area: score;
}

.profile-page .history-select--left {
  grid-area: select;
}

.history-select i {
  font-size: 1.1rem;
}

.history-select:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.62);
  background: rgba(8, 26, 18, 0.78);
}

.history-select input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.history-select.is-selected {
  border-color: rgba(34, 197, 94, 0.85);
  background: linear-gradient(160deg, rgba(34, 197, 94, 0.28), rgba(56, 189, 248, 0.3));
  color: #f0fdf4;
  box-shadow:
    0 0 0 1px rgba(240, 253, 244, 0.24) inset,
    0 10px 24px rgba(16, 185, 129, 0.35);
}

.history-preview-modal {
  border-radius: 24px;
}

.history-preview-image-wrap {
  min-height: 260px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.history-preview-image {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
}

.history-preview-image-empty {
  display: grid;
  gap: 8px;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.history-preview-image-empty i {
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.78);
}

.history-preview-benefit {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
}

.history-preview-benefit i {
  color: var(--brand-3);
  margin-top: 2px;
}

.history-preview-donut {
  width: 112px;
  height: 112px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side, rgba(9, 19, 14, 0.92) 73%, transparent 74%),
    conic-gradient(
      rgba(34, 197, 94, 0.9) 0 calc(var(--pct) * 1%),
      rgba(255, 255, 255, 0.12) calc(var(--pct) * 1%) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
}

.history-preview-donut strong {
  font-size: 1.05rem;
  color: #ecfdf5;
}

.history-preview-topk {
  display: grid;
  gap: 12px;
}

.history-preview-topk-row {
  display: grid;
  gap: 6px;
}

.history-preview-topk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
}

.history-preview-bar-track {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.history-preview-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.78), rgba(168, 85, 247, 0.52));
}

.history-preview-bar-fill.is-primary {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.88), rgba(56, 189, 248, 0.62));
}

.history-preview-compare {
  display: grid;
  gap: 12px;
}

.history-preview-compare-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 10px;
}

@media (max-width: 575px) {
  .profile-page .history-item {
    grid-template-columns: 40px 56px 1fr;
    grid-template-areas:
      "select thumb main"
      "score score score";
    align-items: start;
  }

  .history-score {
    text-align: left;
    margin-top: 8px;
  }

  .history-meter {
    width: 100%;
    margin-top: 10px;
  }

  .history-actions {
    justify-content: flex-start;
  }

  .history-preview-compare-row {
    grid-template-columns: 64px 1fr;
    gap: 8px;
  }

  .history-preview-compare-row strong {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

/* Footer */
.site-footer {
  margin-top: 0;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
}

.footer-title {
  font-size: 1rem;
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.footer-links a {
  color: var(--muted);
  transition: color 160ms ease;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: transform 160ms ease, color 160ms ease, background 160ms ease;
}

.footer-icon:hover {
  transform: translateY(-2px);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--muted);
  font-weight: 650;
  font-size: 0.85rem;
}

.status-badge--good {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.12);
  color: var(--text);
}

.status-badge--warn {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.1);
  color: var(--text);
}

.status-badge--info {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(56, 189, 248, 0.16);
  color: #e0f2fe;
}

.status-badge--accent {
  border-color: rgba(168, 85, 247, 0.42);
  background: rgba(168, 85, 247, 0.16);
  color: #f5e8ff;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.status-badge--warn .status-dot {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.status-badge--info .status-dot {
  background: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18);
}

.status-badge--accent .status-dot {
  background: #a855f7;
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.18);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.reveal[data-reveal="fade-left"] {
  transform: translateX(-18px);
}

.reveal[data-reveal="fade-right"] {
  transform: translateX(18px);
}

.reveal[data-reveal="zoom"] {
  transform: scale(0.96);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Global page loader */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(80% 80% at 20% 15%, rgba(34, 197, 94, 0.2), transparent 60%),
    radial-gradient(70% 60% at 80% 10%, rgba(56, 189, 248, 0.16), transparent 58%),
    linear-gradient(180deg, rgba(7, 17, 12, 0.97), rgba(8, 18, 14, 0.98));
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 280ms ease, visibility 280ms ease;
}

.page-loader-spinner {
  position: relative;
  width: 86px;
  height: 86px;
}

.page-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.page-loader-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.96);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
  transform: rotate(calc(var(--i) * 30deg)) translateY(-34px);
  opacity: 0.18;
  animation: loaderDotPulse 0.96s linear infinite;
  animation-delay: calc(var(--i) * -0.08s);
}

.page-loader-label {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

body.app-body {
  opacity: 1;
  transition: opacity 220ms ease;
}

body.app-body.is-ready:not(.is-loading):not(.is-leaving) .page-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.app-body.is-leaving {
  opacity: 1;
}

@media (max-width: 991px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-collapse {
    padding: 8px 0 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-collapse.show {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    margin: 0;
  }

  .nav-actions {
    padding: 6px 0 6px;
    justify-content: flex-end;
  }

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

  .hero {
    padding-top: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }

  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .hero-card {
    animation: none;
  }

  body.app-body {
    transition: none;
    opacity: 1;
  }

  .page-loader,
  .page-loader-dot {
    transition: none !important;
    animation: none !important;
  }
}

@keyframes loaderDotPulse {
  0%,
  39%,
  100% {
    opacity: 0.18;
  }
  40% {
    opacity: 1;
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -10px, 0);
  }
}
