.brine-container {
    width: 100%;
    max-width: 64rem;
    margin: 0 auto;

    --bg-base: #fff;
    --bg-muted: #f8fafc;
    --text-base: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --primary: #06b6d4;
    --primary-rgb: 6, 182, 212;
    --secondary: #a855f7;
    --accent: #f59e0b;
  }

  html.theme-dark .brine-container,
  body.theme-dark .brine-container,
  .theme-dark .brine-container {
    --bg-base: #1e293b;
    --bg-muted: #0f172a;
    --text-base: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
  }

  .brine-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
  }

  @media (min-width: 1024px) {
    .brine-grid {
      grid-template-columns: 1fr 1fr;
    }
  }

  .brine-controls {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  @media (min-width: 1024px) {
    .brine-controls {
      padding: 2.5rem;
    }
  }

  .brine-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .brine-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-base);
  }

  .brine-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
  }

  .brine-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .brine-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .brine-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
  }

  .brine-input-wrapper {
    position: relative;
  }

  .brine-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.25rem;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    color: var(--text-base);
    transition: all 0.2s;
  }

  .brine-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
    border-color: var(--primary);
  }

  .brine-unit {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 500;
  }

  .brine-salinity-section {
    padding-top: 1rem;
  }

  .brine-salinity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1rem;
  }

  .brine-salinity-display {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
  }

  .brine-salinity-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary);
  }

  .brine-salinity-unit {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    opacity: 0.7;
  }

  .brine-slider {
    width: 100%;
    height: 0.75rem;
    background: var(--border-color);
    border-radius: 9999px;
    cursor: pointer;
    accent-color: var(--primary);
  }

  .brine-slider:hover {
    accent-color: var(--primary-hover);
  }

  .brine-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .preset-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-muted);
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
  }

  .preset-btn:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-color: var(--primary);
  }

  .preset-btn.active {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px var(--primary);
  }

  .brine-sugar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-muted);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
  }

  .brine-toggle-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .brine-toggle-label {
    font-weight: 500;
    color: var(--text-base);
    cursor: pointer;
  }

  .brine-toggle-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
  }

  .brine-switch {
    position: relative;
    width: 3rem;
    height: 1.5rem;
  }

  .brine-switch-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
  }

  .brine-switch-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--border-color);
    border-radius: 9999px;
    transition: background-color 0.2s;
  }

  .brine-switch-circle {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    width: 1rem;
    height: 1rem;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
  }

  .brine-switch-input:checked ~ .brine-switch-bg {
    background: var(--primary);
  }

  .brine-switch-input:checked ~ .brine-switch-circle {
    transform: translateX(1.5rem);
  }

  .brine-results {
    background: var(--bg-muted);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
  }

  @media (min-width: 1024px) {
    .brine-results {
      border-top: none;
      border-left: 1px solid var(--border-color);
      padding: 2.5rem;
    }
  }

  .brine-visualization {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    margin-bottom: 2rem;
    position: relative;
  }

  .brine-jar {
    position: relative;
    width: 12rem;
    height: 16rem;
    border: 4px solid var(--border-color);
    border-radius: 1rem;
    border-top: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
  }

  .brine-jar-cap {
    position: absolute;
    top: -0.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 13rem;
    height: 1rem;
    background: var(--border-color);
    border-radius: 0.5rem 0.5rem 0 0;
  }

  .brine-water {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(59, 130, 246, 0.2);
    transition: height 0.5s ease-out;
    height: 50%;
  }

  .brine-water::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
      90deg,
      transparent,
      transparent 50%,
      rgba(59, 130, 246, 0.1) 50%,
      rgba(59, 130, 246, 0.1) 100%
    );
    animation: wave 10s linear infinite;
    opacity: 0.5;
  }

  @keyframes wave {
    0% {
      transform: translateX(0) scaleY(1);
    }
    50% {
      transform: translateX(-25%) scaleY(0.85);
    }
    100% {
      transform: translateX(-50%) scaleY(1);
    }
  }

  .brine-product {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease-out;
    width: 60%;
    height: 40%;
  }

  .brine-product-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .brine-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .brine-vis-info {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-base);
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
  }

  .brine-vis-label {
    font-weight: 500;
  }

  .brine-vis-value {
    font-weight: 700;
    color: var(--text-base);
  }

  .brine-output {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .brine-result-panel {
    background: var(--bg-base);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
  }

  .brine-result-icon {
    width: 3rem;
    height: 3rem;
    background: var(--bg-muted);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
  }

  .brine-salt-icon {
    color: var(--primary);
  }

  .brine-sugar-icon {
    color: var(--secondary);
  }

  .brine-time-icon {
    color: var(--accent);
  }

  .brine-result-content {
    flex: 1;
  }

  .brine-result-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
  }

  .brine-sugar-label {
    color: var(--secondary);
  }

  .brine-time-label {
    color: var(--accent);
  }

  .brine-result-value {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
  }

  .brine-result-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
  }

  .brine-sugar-number {
    color: var(--secondary);
  }

  .brine-result-unit {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
  }

  .brine-result-time {
    font-size: 1.875rem;
    font-weight: 900;
    color: var(--accent);
  }

  .brine-salt-panel {
    border-color: color-mix(in srgb, var(--primary) 20%, transparent);
  }

  .brine-sugar-panel {
    border-color: color-mix(in srgb, var(--secondary) 20%, transparent);
  }

  .brine-time-panel {
    border-color: color-mix(in srgb, var(--accent) 20%, transparent);
  }

  .brine-hidden {
    display: none;
  }

  @media (max-width: 640px) {
    .brine-controls {
      padding: 1.5rem;
    }

    .brine-results {
      padding: 1.5rem;
    }

    .brine-result-number {
      font-size: 2rem;
    }

    .brine-result-time {
      font-size: 1.5rem;
    }
  }