.grind-converter {
    --grind-wrapper-from: #f0e6d6;
    --grind-wrapper-to: #fdfaf7;
    --grind-bean: #e8d8c4;
    --grind-crema: #7a4b1e;
    --grind-accent: #e67e22;
    --grind-text: #2d1b17;
    --grind-text-dim: #8b6550;
    --grind-text-card: #3d2b20;
    --grind-border: rgba(78, 52, 46, 0.2);
    --grind-border-strong: rgba(78, 52, 46, 0.35);
    --grind-select-bg: rgba(78, 52, 46, 0.06);
    --grind-option-bg: #f0e6d6;
    --grind-sidebar-bg: rgba(255, 252, 248, 0.9);
    --grind-card-bg: rgba(78, 52, 46, 0.04);
    --grind-card-hover: rgba(78, 52, 46, 0.08);
    --grind-gauge-bg: rgba(78, 52, 46, 0.08);
    --grind-active-bg: #3d2b20;
    --grind-active-text: #fdfaf7;
    --grind-icon-bg: #e8d8c4;
    --grind-shadow: 0 20px 60px -10px rgba(78, 52, 46, 0.2);
    --grind-glow-opacity: 0.08;
    --grind-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%237a4b1e'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");

    max-width: 1200px;
    margin: 0 auto;
    color: var(--grind-text);
  }

  .grind-lab-wrapper {
    background: radial-gradient(circle at top left, var(--grind-wrapper-from), var(--grind-wrapper-to));
    border: 1px solid var(--grind-border);
    border-radius: 2.5rem;
    padding: 3.5rem;
    box-shadow: var(--grind-shadow);
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 4rem;
    position: relative;
    overflow: hidden;
  }

  .grind-lab-wrapper::after {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 400px;
    height: 400px;
    background: var(--grind-accent);
    filter: blur(150px);
    opacity: var(--grind-glow-opacity);
    pointer-events: none;
  }

  .grind-lab-main {
    display: flex;
    flex-direction: column;
    gap: 3rem;
  }

  .grind-interface-header {
    border-bottom: 1px solid var(--grind-border);
    padding-bottom: 1.5rem;
  }

  .grind-control-label {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--grind-crema);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
  }

  .grind-custom-select {
    width: 100%;
    background: var(--grind-select-bg);
    border: 1px solid var(--grind-crema);
    color: var(--grind-text);
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    background-image: var(--grind-select-arrow);
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  }

  .grind-custom-select option {
    background-color: var(--grind-option-bg);
    color: var(--grind-text);
  }

  .grind-custom-select:hover {
    border-color: var(--grind-text);
    background-color: var(--grind-card-hover);
    box-shadow: 0 0 15px rgba(122, 75, 30, 0.15);
  }

  .grind-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
  }

  .grind-method-tile {
    background: var(--grind-bean);
    border: 1px solid var(--grind-border);
    border-radius: 1.25rem;
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
  }

  .grind-method-tile:hover {
    background: var(--grind-card-hover);
    transform: translateY(-4px);
    border-color: var(--grind-border-strong);
  }

  .grind-method-tile.active {
    background: var(--grind-active-bg);
    border-color: var(--grind-active-bg);
    box-shadow: 0 15px 35px rgba(61, 43, 32, 0.25);
  }

  .grind-method-tile svg {
    width: 2rem;
    height: 2rem;
    color: var(--grind-text-dim);
    transition: color 0.3s;
  }

  .grind-method-tile.active svg {
    color: var(--grind-active-text);
  }

  .grind-method-tile label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--grind-text-dim);
    pointer-events: none;
  }

  .grind-method-tile.active label {
    color: var(--grind-active-text);
  }

  .grind-gauge {
    padding: 2rem;
    background: var(--grind-gauge-bg);
    border-radius: 2rem;
    border: 1px solid var(--grind-border);
  }

  .grind-gauge-track {
    height: 40px;
    background: linear-gradient(to right, #3d2b20 0%, #8b5a2b 40%, #d4a373 80%, #fdfaf7 100%);
    border-radius: 20px;
    position: relative;
    margin: 2rem 0;
    border: 2px solid rgba(61, 43, 32, 0.3);
    box-shadow: inset 0 2px 10px rgba(61, 43, 32, 0.2);
  }

  .grind-gauge-range {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(61, 43, 32, 0.35);
    border-left: 2px solid var(--grind-active-bg);
    border-right: 2px solid var(--grind-active-bg);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 25px rgba(61, 43, 32, 0.15);
    z-index: 5;
    display: flex;
    justify-content: center;
  }

  .grind-gauge-range::before {
    content: attr(data-micras);
    position: absolute;
    top: -25px;
    font-size: 0.65rem;
    font-weight: 900;
    white-space: nowrap;
    background: var(--grind-active-bg);
    color: var(--grind-active-text);
    padding: 2px 6px;
    border-radius: 4px;
  }

  .grind-gauge-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    opacity: 0.6;
    font-weight: 800;
    color: var(--grind-text);
  }

  .grind-sidebar {
    background: var(--grind-sidebar-bg);
    border-radius: 2rem;
    padding: 2.5rem;
    border: 1px solid var(--grind-border);
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    box-shadow: inset 0 0 40px rgba(78, 52, 46, 0.05);
  }

  .grind-result-header h3 {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    color: var(--grind-text);
    margin: 0;
  }

  .grind-digital-readout {
    background: #1a0f0d;
    padding: 3rem 1.5rem;
    border-radius: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .grind-value-large {
    font-size: 5rem;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    background: linear-gradient(to bottom, #fff, #bbb);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
  }

  .grind-unit-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--grind-accent);
    margin-top: 1rem;
  }

  .grind-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .grind-stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--grind-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.4rem;
  }

  .grind-stat-value {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--grind-crema);
  }

  .grind-preview-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .grind-dist-label {
    color: var(--grind-crema);
    margin-bottom: 0;
  }

  .grind-texture-engine {
    height: 180px;
    background: #000;
    border-radius: 1.5rem;
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    gap: 6px;
    box-shadow: inset 0 0 40px #000;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
  }

  .grind-method-info {
    font-size: 0.8rem;
    color: var(--grind-text-card);
    opacity: 0.85;
    line-height: 1.6;
    border-top: 1px solid var(--grind-border);
    padding-top: 1.5rem;
    margin: 0;
  }

  .grind-particle {
    background: #fff;
    border-radius: 40% 60% 50% 50% / 50% 40% 60% 50%;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }

  .grind-advice-section {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid var(--grind-border);
  }

  .grind-advice-card {
    background: var(--grind-card-bg);
    padding: 2.5rem;
    border-radius: 2rem;
    border: 1px solid var(--grind-border);
    position: relative;
  }

  .grind-advice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 2.5rem;
    width: 40px;
    height: 2px;
    background: var(--grind-crema);
  }

  .grind-advice-card:hover {
    background: var(--grind-card-hover);
    border-color: var(--grind-accent);
  }

  .grind-advice-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .grind-advice-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: var(--grind-icon-bg);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--grind-border);
    flex-shrink: 0;
  }

  .grind-advice-icon svg {
    width: 1.75rem;
    height: 1.75rem;
  }

  .grind-advice-icon-bitter svg {
    color: #e74c3c;
  }

  .grind-advice-icon-sour svg {
    color: #c9980a;
  }

  .grind-advice-card h4 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--grind-text);
    margin: 0;
  }

  .grind-advice-card p {
    color: var(--grind-text-card);
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0;
  }

  .grind-tag-badge {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.5rem 1rem;
    background: var(--grind-accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
    border-radius: 0.5rem;
    text-transform: uppercase;
  }

  @media (max-width: 1100px) {
    .grind-lab-wrapper {
      grid-template-columns: 1fr;
      padding: 2rem;
      gap: 3rem;
    }
  }

  @media (max-width: 850px) {
    .grind-advice-section {
      grid-template-columns: 1fr;
    }
  }

  .theme-dark .grind-converter {
    --grind-wrapper-from: #1a1412;
    --grind-wrapper-to: #0e0a08;
    --grind-bean: #2d241f;
    --grind-crema: #e6b980;
    --grind-accent: #ff6b00;
    --grind-text: #fff;
    --grind-text-dim: #a0a0a0;
    --grind-text-card: #ccc;
    --grind-border: rgba(255, 255, 255, 0.1);
    --grind-border-strong: rgba(255, 255, 255, 0.2);
    --grind-select-bg: rgba(0, 0, 0, 0.4);
    --grind-option-bg: #1a1412;
    --grind-sidebar-bg: rgba(255, 255, 255, 0.02);
    --grind-card-bg: rgba(255, 255, 255, 0.03);
    --grind-card-hover: rgba(255, 255, 255, 0.08);
    --grind-gauge-bg: rgba(0, 0, 0, 0.3);
    --grind-active-bg: #fff;
    --grind-active-text: #0e0a08;
    --grind-icon-bg: #0e0a08;
    --grind-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.7);
    --grind-glow-opacity: 0.05;
    --grind-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23e6b980'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  }

  .theme-dark .grind-gauge-track {
    background: linear-gradient(to right, #000 0%, #5d3a1a 40%, var(--grind-crema) 80%, #fff 100%);
    border: 2px solid rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  }

  .theme-dark .grind-gauge-range {
    background: rgba(255, 255, 255, 0.45);
    border-left: 2px solid #fff;
    border-right: 2px solid #fff;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.15);
  }

  .theme-dark .grind-method-tile.active {
    box-shadow: 0 15px 35px rgba(255, 255, 255, 0.15);
  }

  .theme-dark .grind-advice-icon-sour svg {
    color: #f1c40f;
  }