.mmg-root {
    width: 100%;
  }

  .mmg-top-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
    margin-bottom: 3rem;
  }

  .mmg-top-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .mmg-btn-icon {
    width: 1.25rem;
    height: 1.25rem;
  }

  .mmg-btn-clear {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: rgb(100, 116, 139);
    background: #fff;
    border: 1px solid rgb(226, 232, 240);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s;
  }

  .mmg-btn-clear:hover {
    color: rgb(220, 38, 38);
    border-color: rgb(254, 202, 202);
  }

  .theme-dark .mmg-btn-clear {
    background: rgb(15, 23, 42);
    border-color: rgb(30, 41, 59);
    color: rgb(148, 163, 184);
  }

  .mmg-btn-download {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 2rem;
    font-size: 0.875rem;
    font-weight: 900;
    color: #fff;
    background: rgb(15, 23, 42);
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.2);
  }

  .mmg-btn-download:hover {
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
  }

  .theme-dark .mmg-btn-download {
    background: #fff;
    color: rgb(15, 23, 42);
  }

  .mmg-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
  }

  @media (max-width: 1024px) {
    .mmg-layout {
      grid-template-columns: 1fr;
    }
  }

  .mmg-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .mmg-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 1.5rem;
    border: 1px solid rgb(226, 232, 240);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .theme-dark .mmg-card {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgb(30, 41, 59);
  }

  .mmg-settings-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .mmg-card-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgb(15, 23, 42);
    margin-bottom: 1rem;
  }

  .theme-dark .mmg-card-title {
    color: #fff;
  }

  .mmg-card-icon {
    width: 1rem;
    height: 1rem;
    color: rgb(99, 102, 241);
  }

  .mmg-drop-zone {
    position: relative;
    border: 2px dashed rgb(203, 213, 225);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
  }

  .mmg-drop-zone:hover {
    border-color: rgb(99, 102, 241);
    background: rgba(99, 102, 241, 0.05);
  }

  .theme-dark .mmg-drop-zone {
    border-color: rgb(51, 65, 85);
  }

  .mmg-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
  }

  .mmg-drop-icon {
    width: 3rem;
    height: 3rem;
    color: rgb(148, 163, 184);
    margin: 0 auto 0.75rem;
    display: block;
    transition: color 0.2s;
  }

  .mmg-drop-zone:hover .mmg-drop-icon {
    color: rgb(99, 102, 241);
  }

  .mmg-drop-hint {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(51, 65, 85);
  }

  .mmg-drop-formats {
    font-size: 0.75rem;
    color: rgb(100, 116, 139);
    margin-top: 0.25rem;
  }

  .theme-dark .mmg-drop-hint {
    color: rgb(203, 213, 225);
  }

  .mmg-mass-section {
    margin-top: 1rem;
  }

  .mmg-btn-mass {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    background: rgb(255, 251, 235);
    border: 1px solid rgb(253, 230, 138);
    color: rgb(180, 83, 9);
    border-radius: 1rem;
    font-size: 0.625rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 0.2s;
  }

  .mmg-btn-mass:hover {
    background: rgb(254, 243, 199);
  }

  .theme-dark .mmg-btn-mass {
    background: rgba(180, 83, 9, 0.1);
    border-color: rgba(180, 83, 9, 0.5);
    color: rgb(252, 211, 77);
  }

  .mmg-mass-hint {
    font-size: 0.5625rem;
    color: rgb(148, 163, 184);
    margin-top: 0.5rem;
    text-align: center;
    padding: 0 1rem;
    line-height: 1.5;
  }

  .mmg-config-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .mmg-config-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: rgb(100, 116, 139);
  }

  .mmg-config-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mmg-device-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .mmg-device-btn {
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 2px solid transparent;
    background: rgb(241, 245, 249);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgb(15, 23, 42);
  }

  .mmg-device-btn:hover {
    transform: translateY(-1px);
  }

  .mmg-device-active {
    background: rgb(238, 242, 255);
    border-color: rgb(79, 70, 229);
    transform: translateY(-1px);
  }

  .theme-dark .mmg-device-btn {
    background: rgb(15, 23, 42);
    color: rgb(203, 213, 225);
  }

  .theme-dark .mmg-device-active {
    background: rgba(79, 70, 229, 0.2);
    border-color: rgb(129, 140, 248);
  }

  .mmg-device-icon {
    width: 1.5rem;
    height: 1.5rem;
  }

  .mmg-select {
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    border: 2px solid rgb(226, 232, 240);
    background: #fff;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
    color: rgb(15, 23, 42);
  }

  .mmg-select:focus {
    border-color: rgb(99, 102, 241);
  }

  .theme-dark .mmg-select {
    background: rgb(2, 6, 23);
    border-color: rgb(30, 41, 59);
    color: #fff;
  }

  .mmg-presets-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
  }

  .mmg-gradient-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  .mmg-color-picker {
    flex: 1;
    height: 2rem;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
  }

  .mmg-arrow-icon {
    width: 1rem;
    height: 1rem;
    color: rgb(148, 163, 184);
    flex-shrink: 0;
  }

  .mmg-swap-btn {
    padding: 0.25rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: rgb(148, 163, 184);
    border-radius: 0.375rem;
    transition: background 0.2s;
  }

  .mmg-swap-btn:hover {
    background: rgb(241, 245, 249);
  }

  .theme-dark .mmg-swap-btn:hover {
    background: rgb(30, 41, 59);
  }

  .mmg-swap-icon {
    width: 1rem;
    height: 1rem;
  }

  .mmg-angle-section {
    margin-top: 1rem;
  }

  .mmg-angle-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgb(100, 116, 139);
    margin-bottom: 0.5rem;
  }

  .mmg-range {
    width: 100%;
    height: 4px;
    background: rgb(226, 232, 240);
    border-radius: 9999px;
    appearance: none;
    cursor: pointer;
    accent-color: rgb(99, 102, 241);
  }

  .theme-dark .mmg-range {
    background: rgb(30, 41, 59);
  }

  .mmg-range::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: rgb(79, 70, 229);
    border-radius: 50%;
    cursor: pointer;
  }

  .mmg-safe-section {
    padding-top: 1.5rem;
    border-top: 1px solid rgb(241, 245, 249);
  }

  .theme-dark .mmg-safe-section {
    border-color: rgba(30, 41, 59, 0.5);
  }

  .mmg-toggle {
    width: 2.5rem;
    height: 1.25rem;
    background: rgb(226, 232, 240);
    border-radius: 9999px;
    position: relative;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
  }

  .mmg-toggle-on {
    background: rgb(79, 70, 229);
  }

  .mmg-toggle-dot {
    width: 1rem;
    height: 1rem;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    transition: transform 0.2s;
  }

  .mmg-safe-color-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .mmg-color-picker-sm {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
  }

  .mmg-safe-color-label {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgb(148, 163, 184);
  }

  .mmg-preview-area {
    min-height: 0;
  }

  .mmg-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    background: rgb(248, 250, 252);
    border-radius: 2rem;
    border: 2px dashed rgb(226, 232, 240);
  }

  .theme-dark .mmg-empty {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgb(30, 41, 59);
  }

  .mmg-empty-icon-wrap {
    width: 5rem;
    height: 5rem;
    background: rgb(224, 231, 255);
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
  }

  .theme-dark .mmg-empty-icon-wrap {
    background: rgba(79, 70, 229, 0.3);
  }

  .mmg-empty-icon-svg {
    width: 2.5rem;
    height: 2.5rem;
    color: rgb(99, 102, 241);
  }

  .theme-dark .mmg-empty-icon-svg {
    color: rgb(129, 140, 248);
  }

  .mmg-empty-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: rgb(15, 23, 42);
  }

  .mmg-empty-subtitle {
    color: rgb(100, 116, 139);
    margin-top: 0.5rem;
  }

  .theme-dark .mmg-empty-title {
    color: #fff;
  }

  .mmg-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  @media (max-width: 640px) {
    .mmg-preview-grid {
      grid-template-columns: 1fr;
    }
  }

  .mmg-preview-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 2.5rem;
    padding: 1.5rem;
    border: 1px solid rgb(226, 232, 240);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
  }

  .theme-dark .mmg-preview-card {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgb(30, 41, 59);
  }

  .mmg-card-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
  }

  .mmg-preview-card:hover .mmg-card-actions {
    opacity: 1;
  }

  .mmg-card-action-btn {
    padding: 0.5rem;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
  }

  .mmg-card-action-btn:hover {
    transform: scale(1.1);
  }

  .theme-dark .mmg-card-action-btn {
    background: rgb(15, 23, 42);
  }

  .mmg-duplicate-img {
    color: rgb(99, 102, 241);
  }

  .mmg-replace-img {
    color: rgb(217, 119, 6);
  }

  .mmg-canvas-wrap {
    aspect-ratio: 9/16;
    background: rgb(241, 245, 249);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    outline: 1px solid rgb(226, 232, 240);
  }

  .theme-dark .mmg-canvas-wrap {
    background: rgba(15, 23, 42, 0.5);
    outline-color: rgb(30, 41, 59);
  }

  .mmg-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }

  .mmg-card-body {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .mmg-section {
    padding-top: 1rem;
    border-top: 1px solid rgb(241, 245, 249);
  }

  .theme-dark .mmg-section {
    border-color: rgba(30, 41, 59, 0.5);
  }

  .mmg-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
  }

  .mmg-section-label {
    font-size: 0.625rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgb(148, 163, 184);
  }

  .mmg-reset-btn {
    padding: 0.375rem;
    color: rgb(148, 163, 184);
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
  }

  .mmg-reset-btn:hover {
    color: rgb(99, 102, 241);
    background: rgb(238, 242, 255);
  }

  .theme-dark .mmg-reset-btn:hover {
    background: rgba(99, 102, 241, 0.3);
  }

  .mmg-presets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .mmg-preset-btn {
    padding: 0.625rem 0.5rem;
    font-size: 0.5625rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgb(100, 116, 139);
    background: rgb(248, 250, 252);
    border: 1px solid rgb(241, 245, 249);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.2;
  }

  .mmg-preset-btn:hover {
    background: rgb(241, 245, 249);
    border-color: rgb(199, 210, 254);
    color: rgb(79, 70, 229);
  }

  .mmg-preset-btn:active {
    transform: scale(0.95);
  }

  .theme-dark .mmg-preset-btn {
    background: rgb(15, 23, 42);
    border-color: rgb(30, 41, 59);
    color: rgb(148, 163, 184);
  }

  .theme-dark .mmg-preset-btn:hover {
    background: rgba(79, 70, 229, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: rgb(129, 140, 248);
  }

  .mmg-color-row {
    margin-bottom: 0.75rem;
  }

  .mmg-color-sublabel {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgb(148, 163, 184);
    margin-bottom: 0.25rem;
    margin-left: 0.25rem;
  }

  .mmg-color-field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgb(248, 250, 252);
    border: 1px solid rgb(226, 232, 240);
    border-radius: 1rem;
  }

  .theme-dark .mmg-color-field {
    background: rgb(2, 6, 23);
    border-color: rgb(30, 41, 59);
  }

  .mmg-color-input {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
  }

  .mmg-color-hex {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgb(71, 85, 105);
  }

  .theme-dark .mmg-color-hex {
    color: rgb(148, 163, 184);
  }

  .mmg-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgb(248, 250, 252);
    border: 1px solid rgb(226, 232, 240);
    border-radius: 1rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
    font-weight: 500;
    min-height: 5rem;
    resize: none;
    box-sizing: border-box;
    color: rgb(15, 23, 42);
  }

  .mmg-textarea:focus {
    border-color: rgb(99, 102, 241);
  }

  .theme-dark .mmg-textarea {
    background: rgb(2, 6, 23);
    border-color: rgb(30, 41, 59);
    color: #fff;
  }

  .mmg-range-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
  }

  .mmg-range-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .mmg-range-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgb(148, 163, 184);
  }

  .mmg-scene-row {
    display: flex;
    gap: 0.5rem;
  }

  .mmg-scene-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgb(79, 70, 229);
    background: rgb(238, 242, 255);
    border: 1px solid rgb(199, 210, 254);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
  }

  .mmg-scene-btn:hover {
    background: rgb(224, 231, 255);
  }

  .theme-dark .mmg-scene-btn {
    background: rgba(79, 70, 229, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: rgb(129, 140, 248);
  }

  .mmg-clear-bg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: rgb(239, 68, 68);
    background: rgb(254, 242, 242);
    border: 1px solid rgb(254, 202, 202);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
  }

  .mmg-clear-bg-btn:hover {
    background: rgb(254, 226, 226);
  }

  .theme-dark .mmg-clear-bg-btn {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
  }

  .mmg-delete-btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.625rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgb(148, 163, 184);
    background: transparent;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
  }

  .mmg-delete-btn:hover {
    color: rgb(239, 68, 68);
    background: rgb(254, 242, 242);
  }

  .theme-dark .mmg-delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
  }

  .mmg-preset-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .mmg-preset-swatch:hover {
    transform: scale(1.1);
  }