.jam-container {
  --color-ruby: #e11d48;
  --color-ruby-dark: #be123c;
  --color-ruby-light: #fda4af;
  --color-garnet: #9f1239;
  --color-amber: #d97706;
  --color-amber-dark: #b45309;
  --color-amber-light: #fcd34d;
  --color-topaz: #ea580c;
  --color-amethyst: #7c3aed;
  --color-amethyst-dark: #6d28d9;
  --color-amethyst-light: #c4b5fd;
  --color-sapphire: #4f46e5;
  --color-emerald: #059669;
  --color-emerald-dark: #047857;
  --color-emerald-bright: #34d399;
  --color-peridot: #65a30d;
  --color-ivory: #fef3c7;
  --color-cream: #fef9ef;
  --color-white: #fff;
  --color-slate-900: #1e1b2e;
  --color-slate-800: #2d2a3e;
  --color-slate-700: #3d3a4e;
  --color-slate-500: #6b6880;
  --color-slate-400: #8b88a0;
  --color-slate-300: #b8b5c8;
  --color-slate-200: #d4d1e0;
  --color-slate-100: #eae7f2;
  --color-slate-50: #f7f5fb;
  --jam-radius-sm: 16px;
  --jam-radius-md: 24px;
  --jam-radius-lg: 32px;
  --jam-radius-xl: 40px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.jam-card {
  position: relative;
  width: 100%;
  max-width: 720px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--jam-radius-xl);
  padding: 2.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  box-sizing: border-box;
}

.theme-dark .jam-card {
  background: rgba(30, 27, 46, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.jam-glow-1,
.jam-glow-2,
.jam-glow-3 {
  position: absolute;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.jam-glow-1 {
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(225, 29, 72, 0.08) 0%, transparent 70%);
}

.jam-glow-2 {
  bottom: -40px;
  left: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.08) 0%, transparent 70%);
}

.jam-glow-3 {
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
}

.theme-dark .jam-glow-1 {
  background: radial-gradient(circle, rgba(225, 29, 72, 0.12) 0%, transparent 70%);
}

.theme-dark .jam-glow-2 {
  background: radial-gradient(circle, rgba(217, 119, 6, 0.12) 0%, transparent 70%);
}

.theme-dark .jam-glow-3 {
  background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
}

.jam-main-grid {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  width: 100%;
}

.jam-section-label {
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-slate-500);
  margin-bottom: 1.1rem;
}

.theme-dark .jam-section-label {
  color: var(--color-slate-300);
}

.jam-fruit-scroll {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding: 0.6rem 0 1.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.jam-fruit-scroll::-webkit-scrollbar {
  display: none;
}

.jam-fruit-pill {
  --fruit-color: #e11d48;

  display: flex;
  align-items: center;
  gap: 0.95rem;
  background: var(--color-white);
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 1.15rem 1.85rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.theme-dark .jam-fruit-pill {
  background: rgba(30, 27, 46, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.08);
}

.jam-fruit-pill.active {
  border-color: var(--fruit-color);
  background: var(--fruit-color);
  box-shadow: 0 6px 20px rgba(var(--fruit-color-rgb, 225, 29, 72), 0.35);
  transform: translateY(-2px);
}

.jam-fruit-pill.active .jam-fruit-name {
  color: var(--color-white);
}

.jam-fruit-pill.active .jam-fruit-dot {
  background: rgba(255, 255, 255, 0.4);
}

.jam-fruit-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.jam-fruit-name {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--color-slate-700);
  white-space: nowrap;
}

.theme-dark .jam-fruit-name {
  color: var(--color-slate-200);
}

.jam-filter-pills {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
}

.jam-filter-pill {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 0.75rem 1.45rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-slate-500);
  cursor: pointer;
  transition: all 0.2s;
  white-space: normal;
  text-align: center;
}

.theme-dark .jam-filter-pill {
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-slate-400);
}

.jam-filter-pill.active {
  background: var(--color-slate-100);
  color: var(--color-slate-900);
  border-color: var(--color-slate-300);
}

.theme-dark .jam-filter-pill.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-slate-100);
  border-color: rgba(255, 255, 255, 0.15);
}

.jam-inputs-section {
  display: flex;
  flex-direction: column;
  gap: 1.85rem;
}

.jam-input-row {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
}

.jam-input-row.jam-hidden {
  display: none;
}

.jam-input-label {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-slate-700);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.theme-dark .jam-input-label {
  color: var(--color-slate-200);
}

.jam-weight-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(247, 245, 251, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--jam-radius-md);
  padding: 0.8rem;
  transition: border-color 0.2s;
}

.theme-dark .jam-weight-input-wrap {
  background: rgba(45, 42, 62, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.jam-weight-input-wrap:focus-within {
  border-color: var(--color-amethyst);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.jam-weight-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--color-slate-900);
  padding: 1rem 1.3rem;
  min-width: 0;
  -moz-appearance: textfield;
}

.jam-weight-input::-webkit-inner-spin-button,
.jam-weight-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.theme-dark .jam-weight-input {
  color: var(--color-white);
}

.jam-weight-unit {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-slate-500);
  padding-right: 1.45rem;
  flex-shrink: 0;
}

.theme-dark .jam-weight-unit {
  color: var(--color-slate-300);
}

.jam-sugar-auto-hint {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-slate-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: -0.25rem;
}

.jam-toggle-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(234, 231, 242, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--jam-radius-sm);
  padding: 0.6rem;
}

.theme-dark .jam-toggle-wrap {
  background: rgba(45, 42, 62, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.jam-toggle-btn {
  background: transparent;
  border: none;
  padding: 1.3rem;
  border-radius: calc(var(--jam-radius-sm) - 2px);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-slate-500);
  cursor: pointer;
  transition: all 0.2s;
  white-space: normal;
  overflow-wrap: break-word;
}

.theme-dark .jam-toggle-btn {
  color: var(--color-slate-300);
}

.jam-toggle-btn.active {
  background: var(--color-white);
  color: var(--color-slate-900);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.theme-dark .jam-toggle-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  box-shadow: none;
}

.jam-visual-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.jam-drop-hint {
  font-size: 1.25rem;
  color: var(--color-slate-500);
  text-align: center;
  margin-bottom: 1.25rem;
  margin-top: -0.5rem;
}

.theme-dark .jam-drop-hint {
  color: var(--color-slate-400);
}

.jam-plate-stage {
  position: relative;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;

  --jam-fruit-color: #e11d48;
  --jam-fruit-color-light: #fda4af;
  --jam-fruit-color-dark: #be123c;
}

.jam-plate-svg {
  width: 100%;
  max-width: 300px;
  height: auto;
  color: var(--color-slate-300);
}

.theme-dark .jam-plate-svg {
  color: var(--color-slate-400);
}

.jam-drop {
  transition: cy 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.jam-drop-highlight {
  transition: cy 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.jam-drop-status {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  opacity: 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: left;
  padding: 0.95rem 0;
  transition: opacity 0.3s;
}

.jam-drop-status.visible {
  opacity: 1;
}

.jam-drop-status-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.jam-drop-status.perfect {
  color: var(--color-emerald);
}

.jam-drop-status.slightly-thin {
  color: var(--color-amber);
}

.jam-drop-status.too-thin {
  color: var(--color-ruby);
}

.jam-drop-status.too-stiff {
  color: var(--color-sapphire);
}

.theme-dark .jam-drop-status.perfect {
  color: var(--color-emerald-bright);
}

.theme-dark .jam-drop-status.too-thin {
  color: var(--color-ruby-light);
}

.jam-recipe-section {
  --fruit-color: #e11d48;
  --fruit-color-rgb: 225, 29, 72;
}

.jam-recipe-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.45rem;
}

@media (min-width: 600px) {
  .jam-recipe-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .jam-recipe-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.jam-recipe-item {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: rgba(247, 245, 251, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--jam-radius-md);
  padding: 1.45rem;
}

.theme-dark .jam-recipe-item {
  background: rgba(45, 42, 62, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.jam-recipe-icon {
  flex-shrink: 0;
  color: var(--color-slate-400);
  display: flex;
  align-items: center;
}

.theme-dark .jam-recipe-icon {
  color: var(--color-slate-300);
}

.jam-recipe-info {
  min-width: 0;
}

.jam-recipe-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-slate-900);
  line-height: 1.2;
  display: flex;
  align-items: baseline;
}

.theme-dark .jam-recipe-val {
  color: var(--color-white);
}

.jam-recipe-unit {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-slate-400);
  margin-left: 0.35rem;
}

.jam-recipe-label {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-slate-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

.theme-dark .jam-recipe-label {
  color: var(--color-slate-400);
}

.jam-sugar-hint {
  font-weight: 400;
  text-transform: none;
  opacity: 0.6;
}

.jam-recipe-sub {
  font-size: 1.1rem;
  color: var(--color-slate-400);
  margin-top: 0.25rem;
}

.theme-dark .jam-recipe-sub {
  color: var(--color-slate-500);
}

.jam-sugar-bar-wrap {
  background: rgba(247, 245, 251, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--jam-radius-md);
  padding: 1.45rem;
}

.theme-dark .jam-sugar-bar-wrap {
  background: rgba(45, 42, 62, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.jam-sugar-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-slate-500);
  margin-bottom: 0.95rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.jam-sugar-bar-val {
  font-size: 1.45rem;
  color: var(--color-slate-900);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.theme-dark .jam-sugar-bar-val {
  color: var(--color-white);
}

#sugar-pct-context {
  font-size: 1rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-slate-400);
}

.jam-sugar-bar {
  position: relative;
  width: 100%;
  height: 16px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  overflow: visible;
  margin-bottom: 0.8rem;
}

.theme-dark .jam-sugar-bar {
  background: rgba(255, 255, 255, 0.06);
}

.jam-sugar-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--fruit-color), var(--color-amber));
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.jam-sugar-bar-fill.good {
  background: linear-gradient(90deg, var(--color-emerald), var(--color-emerald-bright));
}

.jam-sugar-bar-fill.warn {
  background: linear-gradient(90deg, var(--color-amber), var(--color-ruby));
}

.jam-sugar-bar-marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--color-slate-400);
  border-radius: 1px;
  opacity: 0.3;
}

.jam-sugar-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-slate-400);
}

.jam-sugar-bar-ideal {
  color: var(--color-emerald);
  font-weight: 700;
}

@media (max-width: 480px) {
  .jam-card {
    padding: 1.75rem;
    border-radius: var(--jam-radius-lg);
  }

  .jam-weight-input {
    font-size: 2.2rem;
  }

  .jam-recipe-val {
    font-size: 1.8rem;
  }

  .jam-fruit-pill {
    padding: 0.95rem 1.45rem;
  }

  .jam-fruit-name {
    font-size: 1.25rem;
  }

  .jam-fruit-dot {
    width: 18px;
    height: 18px;
  }

  .jam-toggle-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.6rem;
  }

  .jam-toggle-btn {
    padding: 1.1rem;
    font-size: 1.25rem;
  }

  .jam-sugar-bar-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .jam-sugar-bar-val {
    font-size: 1.25rem;
  }
}
