:root {
    --dc-primary: #6366f1;
    --dc-primary-dark: #4f46e5;
    --dc-primary-light: #818cf8;
    --dc-accent: #f59e0b;
    --dc-accent-dark: #d97706;
    --dc-accent-light: #fbbf24;
    --dc-danger: #ef4444;
    --dc-success: #10b981;
    --dc-neutral: #374151;
    --dc-border: #e5e7eb;
  }

  .theme-dark {
    --dc-primary: #818cf8;
    --dc-primary-dark: #6366f1;
    --dc-accent: #fbbf24;
    --dc-border: rgba(255, 255, 255, 0.1);
  }



  .dc-root {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
  }

  .dc-card {
    border: 1px solid var(--dc-border);
    border-radius: 32px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.3);
  }

  .theme-dark .dc-card {
    background: rgba(255, 255, 255, 0.01);
  }

  .dc-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    min-height: 600px;
  }

  .dc-sidebar {
    padding: 3rem;
    background: rgba(255, 255, 255, 0.6);
    border-right: 1px solid var(--dc-border);
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
  }

  .theme-dark .dc-sidebar {
    background: rgba(255, 255, 255, 0.02);
  }

  .dc-main {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
  }

  .theme-dark .dc-main {
    background: rgba(255, 255, 255, 0.005);
  }

  .dc-field {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }

  .dc-field-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6b7280;
  }

  .theme-dark .dc-field-label {
    color: #9ca3af;
  }

  .dc-mat-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1rem;
  }

  .dc-mat-chip {
    padding: 1rem;
    border: 2px solid var(--dc-border);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dc-neutral);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
  }

  .dc-mat-icon {
    width: 64px;
    height: 64px;
    color: var(--dc-primary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
  }

  .dc-mat-chip:hover {
    border-color: var(--dc-primary);
  }

  .dc-mat-chip.active {
    background: white;
    border-color: var(--dc-accent);
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
  }

  .theme-dark .dc-mat-chip {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
  }

  .theme-dark .dc-mat-chip.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--dc-accent);
  }

  .dc-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .dc-toggle-btn {
    padding: 0.8rem 1rem;
    border: 1px solid var(--dc-border);
    border-radius: 8px;
    background: white;
    color: var(--dc-neutral);
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .dc-toggle-btn:hover {
    border-color: var(--dc-primary);
  }

  .dc-toggle-btn.active {
    background: var(--dc-primary);
    border-color: var(--dc-primary);
    color: white;
  }

  .theme-dark .dc-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
  }

  .theme-dark .dc-toggle-btn.active {
    background: var(--dc-primary);
    border-color: var(--dc-primary);
    color: white;
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.4);
  }

  .dc-diameter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
  }

  .dc-unit-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

  .dc-unit-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--dc-border);
    border-radius: 6px;
    background: white;
    color: var(--dc-neutral);
    font-weight: 700;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
  }

  .dc-unit-btn.active {
    background: white;
    border-color: var(--dc-primary);
    color: var(--dc-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
  }

  .theme-dark .dc-unit-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
  }

  .dc-diameter-display {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--dc-primary);
    margin-bottom: 0.5rem;
  }

  .theme-dark .dc-diameter-display {
    color: var(--dc-primary-light);
  }

  .dc-slider-box {
    width: 100%;
  }

  .dc-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--dc-border);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
  }

  .dc-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--dc-primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  }

  .dc-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--dc-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  }

  .dc-mode-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 1rem;
  }

  .theme-dark .dc-mode-badge {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
  }

  .dc-mode-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--dc-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .theme-dark .dc-mode-label {
    color: var(--dc-primary-light);
  }

  .dc-toggle-switch {
    width: 48px;
    height: 24px;
    border-radius: 12px;
    background: var(--dc-border);
    cursor: pointer;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
  }

  .dc-toggle-switch.active {
    background: var(--dc-primary);
  }

  .dc-toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .dc-toggle-switch.active::after {
    left: 26px;
  }

  .dc-advanced {
    margin-top: auto;
  }
  .dc-advanced-trigger {
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: 2px dashed var(--dc-border);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    color: var(--dc-primary);
    font-size: 0.8rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .dc-advanced-trigger:hover {
    border-style: solid;
    background: rgba(99, 102, 241, 0.05);
  }
  .theme-dark .dc-advanced-trigger {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--dc-primary-light);
  }

  .dc-chevron {
    width: 16px;
    height: 16px;
    color: inherit;
    transition: transform 0.2s;
  }

  .dc-chevron.rotate {
    transform: rotate(180deg);
  }

  .dc-advanced-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0;
  }
  .dc-advanced-body.visible {
    max-height: 500px;
    margin-top: 1rem;
  }
  .dc-adv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .dc-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--dc-border);
    border-radius: 8px;
    font-weight: 700;
    background: white;
    color: var(--dc-neutral);
    transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .dc-input:focus {
    outline: none;
    border-color: var(--dc-primary);
  }

  .theme-dark .dc-input {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f9fafb;
  }

  .dc-hero {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(245, 158, 11, 0.05));
    border-radius: 16px;
  }

  .dc-hero-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--dc-primary);
  }

  .theme-dark .dc-hero-label {
    color: var(--dc-primary-light);
  }

  .dc-rpm-number {
    font-size: 6rem;
    font-weight: 900;
    color: var(--dc-primary);
    line-height: 1;
    margin: 1rem 0;
  }
  .dc-rpm-number.limited { color: var(--dc-danger); }
  .dc-rpm-number.slow { color: var(--dc-accent); }
  .dc-rpm-number.optimal { color: var(--dc-success); }
  .theme-dark .dc-rpm-number { color: var(--dc-primary-light); }
  .theme-dark .dc-rpm-number.slow { color: var(--dc-accent-light); }

  .dc-hero-unit {
    font-size: 0.85rem;
    font-weight: 800;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .dc-rotation-visual {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid;
    border-top-color: var(--dc-primary);
    border-right-color: var(--dc-accent);
    border-bottom-color: var(--dc-primary);
    border-left-color: var(--dc-accent);
    margin: 1rem auto;
    animation: dc-spin 2s linear infinite;
    animation-play-state: paused;
  }

  @keyframes dc-spin {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(360deg);
    }
  }

  .dc-status-row {
    min-height: 32px;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    gap: 0.5rem;
  }

  .dc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
  }

  .dc-badge-warning {
    background: rgba(99, 102, 241, 0.15);
    color: var(--dc-primary);
  }

  .theme-dark .dc-badge-warning {
    background: rgba(99, 102, 241, 0.25);
  }

  .dc-badge-alert {
    background: rgba(239, 68, 68, 0.15);
    color: var(--dc-danger);
  }

  .theme-dark .dc-badge-alert {
    background: rgba(239, 68, 68, 0.25);
  }

  .dc-badge-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: inherit;
  }

  .dc-badge-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentcolor;
    fill: currentcolor;
  }

  .dc-badge-icon path {
    stroke: currentcolor;
    fill: currentcolor;
  }

  .dc-tiles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dc-tile {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.2s;
  }

  .dc-tile:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--dc-border);
  }

  .theme-dark .dc-tile {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
  }

  .dc-tile-icon {
    width: 56px;
    height: 56px;
    color: var(--dc-primary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
  }

  .theme-dark .dc-tile-icon {
    color: var(--dc-primary-light);
  }

  .dc-tile-content {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .dc-tile-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.05em;
  }

  .theme-dark .dc-tile-label {
    color: #9ca3af;
  }

  .dc-tile-value {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--dc-primary);
  }

  .theme-dark .dc-tile-value {
    color: var(--dc-primary-light);
  }

  .dc-machine-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .theme-dark .dc-machine-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
  }

  .dc-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    border: 1px solid var(--dc-border);
  }
  .dc-preset-btn {
    padding: 0.8rem 1rem;
    border: none;
    border-right: 1px solid var(--dc-border);
    background: white;
    color: var(--dc-neutral);
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .dc-preset-btn:last-child {
    border-right: none;
  }

  .dc-preset-btn:hover {
    background: rgba(99, 102, 241, 0.05);
  }

  .dc-preset-btn.active {
    background: var(--dc-primary);
    color: white;
  }

  .theme-dark .dc-preset-btn {
    background: rgba(255, 255, 255, 0.05);
    border-right-color: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
  }

  .dc-manual-input {
    display: flex;
    gap: 0;
    border: 1px solid var(--dc-border);
    border-radius: 8px;
    overflow: hidden;
    background: white;
    margin-top: 0.75rem;
  }
  .dc-manual-input .dc-input {
    flex: 1;
    border: none;
    border-radius: 0;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
  }

  .dc-input::placeholder {
    color: #9ca3af;
  }

  .dc-manual-input .dc-input:focus {
    background: rgba(99, 102, 241, 0.02);
  }

  .theme-dark .dc-manual-input .dc-input {
    background: rgba(255, 255, 255, 0.08);
    color: #f9fafb;
    border-color: rgba(255, 255, 255, 0.1);
  }
  .dc-add-btn {
    padding: 0.8rem 1.2rem;
    background: var(--dc-primary);
    color: white;
    border: none;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
  }
  .dc-add-btn:hover {
    background: var(--dc-primary-dark);
  }

  .dc-chips-area {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 0;
  }
  .dc-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--dc-primary);
    padding: 0.5rem 0.8rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 700;
  }
  .theme-dark .dc-chip {
    background: rgba(99, 102, 241, 0.15);
    color: var(--dc-primary-light);
  }
  .dc-chip button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-weight: 900;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
  }
  .dc-chip button:hover { color: var(--dc-danger); }

  .dc-match-box {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
    animation: slide-in-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  @keyframes slide-in-up {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .dc-match-header {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--dc-primary);
    margin-bottom: 0.6rem;
    letter-spacing: 0.05em;
  }

  .theme-dark .dc-match-header {
    color: var(--dc-primary-light);
  }

  .dc-match-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--dc-primary);
  }

  .theme-dark .dc-match-value {
    color: var(--dc-primary-light);
  }

  .dc-match-hint {
    font-size: 0.65rem;
    color: #6b7280;
    margin: 0.6rem 0 0;
  }

  @media (max-width: 900px) {
    .dc-grid {
      grid-template-columns: 1fr;
    }

    .dc-sidebar {
      border-right: none;
      border-bottom: 1px solid var(--dc-border);
      padding: 2rem;
      gap: 2rem;
    }

    .dc-main {
      padding: 2rem;
      gap: 2rem;
    }

    .dc-tiles {
      grid-template-columns: 1fr;
    }

    .dc-mat-list {
      grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .dc-rpm-number {
      font-size: 3.5rem;
    }
  }

  .hidden {
    display: none;
  }